-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Fix ICE in rustdoc when merging generic and where bounds of an Fn with an output #63937
Conversation
…of an Fn with an output Fixes rust-lang#57180
|
} | ||
_ => panic!("expected only type parameters"), | ||
} | ||
} | ||
params | ||
} | ||
|
||
fn ty_bounds(bounds: Vec<clean::GenericBound>) -> Vec<clean::GenericBound> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seemed like pointless noise, so I removed it. If this was setup for future work, let me know so I can add a comment explaining that for future readers 😃
@@ -45,11 +45,6 @@ pub fn where_clauses(cx: &DocContext<'_>, clauses: Vec<WP>) -> Vec<WP> { | |||
} | |||
} | |||
|
|||
// Simplify the type parameter bounds on all the generics |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since ty_bounds
was a nop, just a pass-through, this transform seemed to just be added noise and should be safe to remove.
I was also able to determine that this bug was introduced somewhere between 1.30 and 1.31. The compiler processes the code just fine in 1.30, but ICE's in 1.31. |
impl<F: Fn() -> u32> | ||
Trait for Struct<F> | ||
where | ||
F: Fn() -> u32, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I run format on this? Also, does this test need a comment saying it's a regression test, or is its existence enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Existence alone is fine.
Ping from triage |
Ping from triage |
I was doing some analysis on the originating cause (documented in #57180). I mostly believe this is still the proper fix, but I was hoping someone familiar with this codebase could review and help bump up the confidence here. I requested @QuietMisdreavus for review since she was helping me track down the bug during impl days. |
Ping from triage: requesting a review from @rust-lang/rustdoc |
Since the real change is only one line, pretty quick to review. The regression test is also present so all good. Don't hesitate to ping me or @rust-lang/rustdoc directly next time. Thanks! @bors: r+ |
📌 Commit 143b83a has been approved by |
…meGomez Fix ICE in rustdoc when merging generic and where bounds of an Fn with an output Fixes rust-lang#57180
Fix ICE in rustdoc when merging generic and where bounds of an Fn with an output Fixes #57180
☀️ Test successful - checks-azure |
Fixes #57180