Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustdoc: Render HRTB correctly for bare functions #79991

Merged
merged 1 commit into from
Jan 29, 2021

Commits on Jan 28, 2021

  1. rustdoc: Render HRTB correctly for bare functions

    The angle brackets were not rendered, so code like this:
    
        some_func: for<'a> fn(val: &'a i32) -> i32
    
    would be rendered as:
    
        some_func: fn'a(val: &'a i32) -> i32
    
    However, rendering with angle brackets is still invalid syntax:
    
        some_func: fn<'a>(val: &'a i32) -> i32
    
    so now it renders correctly as:
    
        some_func: for<'a> fn(val: &'a i32) -> i32
    
    -----
    
    However, note that this code:
    
        some_trait: dyn for<'a> Trait<'a>
    
    will still render as:
    
        some_trait: dyn Trait<'a>
    
    which is not invalid syntax, but is still unclear. Unfortunately I think
    it's hard to fix that case because there isn't enough information in the
    `rustdoc::clean::Type` that this code operates on. Perhaps that case can
    be fixed in a later PR.
    camelid committed Jan 28, 2021
    Configuration menu
    Copy the full SHA
    cd8dcee View commit details
    Browse the repository at this point in the history