-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
ICE: rustdoc: Could not find associated const on trait
#106079
Comments
Regression in cce9e72 |
Triage: This is no longer ICE since nightly-2023-01-21, marking as E-needs-test. |
Tried to add a test. But it seems it had time to regress again. #107000
This ICE happens without the const block. Maybe the regression is just about that it is now walking const blocks but the actual ICE is something else. |
The code without the const block. trait X {
type Y<'a>;
}
fn f2<'a>(arg : Box<dyn X<Y<1> = &'a ()>>) {} Has been causing ICE in rustdoc rendering (clean) since GATs rustdoc rendering was introduced in #94009 |
…eck_before_clean, r=GuillaumeGomez rustdoc: run more HIR validation to mirror rustc # Explanation While investigating these issues: rust-lang#107093, rust-lang#106079 I thought it maybe would be useful to test running `rustdoc` on all rust files under `tests/ui` grepping for files that causes any ICEs. And these are the files I found would cause ICEs. ``` // These are handled by this fix. tests/ui/late-bound-lifetimes/mismatched_arg_count.rs tests/ui/associated-consts/issue-102335-const.rs tests/ui/const-generics/generic_const_exprs/issue-102768.rs tests/ui/const-generics/const-arg-type-arg-misordered.rs tests/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.rs tests/ui/typeck/issue-88643.rs tests/ui/typeck/issue-75889.rs tests/ui/typeck/issue-83621-placeholder-static-in-extern.rs // These are not they will still produce a ICE after this change tests/ui/limits/issue-56762.rs tests/ui/union/projection-as-union-type-error-2.rs tests/ui/union/projection-as-union-type-error.rs ``` I reduces the issues handled by this PR down to the tests added in the PR. That includes the linked issues. But the 3 files that are not handled I will leave for a future PR. This PR adds the `type_collecting` step from `hir_analysis::check_crate` to the rustdoc typechecks. It had the following comment on it. ``` // this ensures that later parts of type checking can assume that items // have valid types and not error ``` Adding the check report the same errors as rustc does for these input. And not ICE when the lint checker walks the HIR or when in the `rustdoc::clean` pass. This PR updates the expected errors of some existing rustdoc-ui tests (some now report less errors). These new reported errors does mirror the errors reported by rustc. # Performance It does more checking so it will probably regress. We should run ``@bors` try `@rust-timer` queue` and see. # Discussion Maybe instead of calling a subset of the checks in `hir_analysis::check_crate` and having comments that say they should be kept in sync. We could instead call `check_crate` directly and pass in some flag. Maybe `check_toplevel_signatures_only` or something like that. That flag would have to skip most of the checks in that function tough.
This issue was fixed by #108576 which contains a regression test for it (tests/rustdoc-ui/invalid_const_in_lifetime_position.rs). This issue should be closed. @rustbot label -E-needs-test |
Closing as fixed by #108576 |
Code
./src/test/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.rs
Meta
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: