Fix rustdoc ICE when checking if a generic arg can be elided - #160295
Fix rustdoc ICE when checking if a generic arg can be elided#160295Colepng wants to merge 4 commits into
Conversation
|
rustbot has assigned @GuillaumeGomez. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
Please add a regression test. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| // Regression test for issue #133637. Previously we would index into the flattened generics list | ||
| // with the children generic indexes. This resulted in an ICE when debug assertions were on. | ||
|
|
||
| struct SomeDefault; |
There was a problem hiding this comment.
This is not the regression test for #133637 as it works fine with current nightly.
There was a problem hiding this comment.
When I run the test locally, I run into the ICE. It might pass on current nightly since I don't believe it's built with debug assertions enabled.
|
Reminder, once the PR becomes ready for a review, use |
|
@rustbot ready |
There was a problem hiding this comment.
Could you use a smaller reproducer? One, some or all from https://github.com/rust-lang/rust/pull/160295/changes#r3696140723. Thanks!
There was a problem hiding this comment.
Smaller reproducer:
trait Trait<T = ()> {
type Type<'a, 'b>;
}
struct Struct<T: Trait<()>>(T::Type<'static, 'static>);There was a problem hiding this comment.
When I test locally these do not ICE for me. Do you have the backtrace?
There was a problem hiding this comment.
I was able to minimize it to this. I haven't been successful on reproducing the ICE with a struct.
trait Trait<Default = ()> {
type Type<'a, 'b>;
}
type Type<T> = <T as Trait>::Type<'static, 'static>;
Fixes #133637
The
param_atcall expects a index into the full generics list, while index is generated only from the children.I also noticed a call to
skip_norm_wipso I replaced that withskip_normalizationI have one question about adding the regression test, should it live under rustdoc-ui or rustdoc-ui/issue. I will add it later today.
@fmease