Uh oh!
There was an error while loading. Please reload this page.
rustdoc: Render HRTB correctly for bare functions - #79991
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
jyn514
commented
Dec 13, 2020
This is invalid syntax: Is it simple to display |
camelid
commented
Dec 13, 2020
Yes, I was planning on opening a follow-up PR; I figured we should do it in two stages so the rendered syntax is at least plausible. I can do it in this PR instead if you think that's better though. |
jyn514
commented
Dec 13, 2020
Yes, I think it would be better to fix it here if possible. |
camelid
commented
Dec 13, 2020
I fixed it for bare functions, but I think it will be harder to fix for |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
jyn514
commented
Dec 13, 2020
Ok, that seems reasonable. The new output for traits is at least vaguely right so this is definitely a step in the right direction 😆 |
cf5a620 to
c82b548Compare
This comment has been minimized.
This comment has been minimized.
jyn514
commented
Dec 23, 2020
camelid
commented
Dec 23, 2020
This PR is blocked on me figuring out why the These are the htmldocck errors: #79991 (comment) |
GuillaumeGomez
commented
Jan 11, 2021
Can you provide the full diff provided by the |
aebf392 to
9c31372Comparecamelid
commented
Jan 17, 2021
Rebased. |
This comment has been minimized.
This comment has been minimized.
camelid
commented
Jan 19, 2021
I fixed the test! It was a silly mistake on my part: There were two issues:
The first one was the primary issue, though, because I couldn't Glad I was able to figure it out! |
camelid
commented
Jan 19, 2021
Should be ready for review! (Let me know before you |
GuillaumeGomez
commented
Jan 19, 2021
Looks good to me. Just waiting for @jyn514 now. ;) |
bors
commented
Jan 27, 2021
☔ The latest upstream changes (presumably #80987) made this pull request unmergeable. Please resolve the merge conflicts. |
camelid
commented
Jan 28, 2021
I'm going to squash before I rebase since the conflicts are non-trivial (and it |
b58c71b to
8a389b2Compare8a389b2 to
65a7ac0Comparecamelid
commented
Jan 28, 2021
Rebased! @GuillaumeGomez Given that Joshua is taking a break for a bit, do you want to be |
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.
Uh oh!
There was an error while loading. Please reload this page.
65a7ac0 to
cd8dceeCompareGuillaumeGomez
commented
Jan 28, 2021
Looks good to me, thanks! @bors: r=GuillaumeGomez,jyn514 |
bors
commented
Jan 28, 2021
📌 Commit cd8dcee has been approved by |
…llaumeGomez,jyn514 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. r? `@jyn514`
Rollup of 10 pull requests Successful merges: - rust-lang#79570 (rustc: Stabilize `-Zrun-dsymutil` as `-Csplit-debuginfo`) - rust-lang#79819 (Add `SEMICOLON_IN_EXPRESSIONS_FROM_MACROS` lint) - rust-lang#79991 (rustdoc: Render HRTB correctly for bare functions) - rust-lang#80215 (Use -target when linking binaries for Mac Catalyst) - rust-lang#81158 (Point to span of upvar making closure FnMut) - rust-lang#81176 (Improve safety of `LateContext::qpath_res`) - rust-lang#81287 (Split rustdoc JSON types into separately versioned crate) - rust-lang#81306 (Fuse inner iterator in FlattenCompat and improve related tests) - rust-lang#81333 (clean up some const error reporting around promoteds) - rust-lang#81459 (Fix rustdoc text selection for page titles) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
jyn514
commented
Apr 5, 2021
@hi-rustin there are some instructions in #78482. Please try to keep discussion in one place, this PR is not super relevant to 78482. |
The angle brackets were not rendered, so code like this:
would be rendered as:
However, rendering with angle brackets is still invalid syntax:
so now it renders correctly as:
However, note that this code:
will still render as:
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::Typethat this code operates on. Perhaps that case canbe fixed in a later PR.
r? @jyn514