-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
Check proj's parent is trait or not when checking dyn compatibility #151754
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
Merged
+19
−3
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This comment has been minimized.
This comment has been minimized.
Member
|
@bors r+ rollup |
Contributor
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Feb 3, 2026
…yUwU Check proj's parent is trait or not when checking dyn compatibility Fixes rust-lang#151708 When checking dyn compatibility, `proj` here may point to free const whose parent is not trait. Then `TraitRef::from_assoc` will call `generics_of` on the wrong parent. After this change, the following case without `#[type_const]` will still emit ICE same to rust-lang#149066, but different to the ICE reported in rust-lang#151708 ```rust #![feature(min_generic_const_args)] // #[type_const] const N: usize = 2; trait CollectArray { fn inner_array(&self) -> [i32; N]; } ``` r? @BoxyUwU
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Feb 3, 2026
…yUwU Check proj's parent is trait or not when checking dyn compatibility Fixes rust-lang#151708 When checking dyn compatibility, `proj` here may point to free const whose parent is not trait. Then `TraitRef::from_assoc` will call `generics_of` on the wrong parent. After this change, the following case without `#[type_const]` will still emit ICE same to rust-lang#149066, but different to the ICE reported in rust-lang#151708 ```rust #![feature(min_generic_const_args)] // #[type_const] const N: usize = 2; trait CollectArray { fn inner_array(&self) -> [i32; N]; } ``` r? @BoxyUwU
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Feb 3, 2026
…yUwU Check proj's parent is trait or not when checking dyn compatibility Fixes rust-lang#151708 When checking dyn compatibility, `proj` here may point to free const whose parent is not trait. Then `TraitRef::from_assoc` will call `generics_of` on the wrong parent. After this change, the following case without `#[type_const]` will still emit ICE same to rust-lang#149066, but different to the ICE reported in rust-lang#151708 ```rust #![feature(min_generic_const_args)] // #[type_const] const N: usize = 2; trait CollectArray { fn inner_array(&self) -> [i32; N]; } ``` r? @BoxyUwU
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Feb 3, 2026
…yUwU Check proj's parent is trait or not when checking dyn compatibility Fixes rust-lang#151708 When checking dyn compatibility, `proj` here may point to free const whose parent is not trait. Then `TraitRef::from_assoc` will call `generics_of` on the wrong parent. After this change, the following case without `#[type_const]` will still emit ICE same to rust-lang#149066, but different to the ICE reported in rust-lang#151708 ```rust #![feature(min_generic_const_args)] // #[type_const] const N: usize = 2; trait CollectArray { fn inner_array(&self) -> [i32; N]; } ``` r? @BoxyUwU
rust-bors bot
pushed a commit
that referenced
this pull request
Feb 3, 2026
…uwer Rollup of 13 pull requests Successful merges: - #152034 (Show largest job duration changes in hours and minutes in the post-merge report) - #152039 (coverage: Add a test case for a previously-unknown span mismatch) - #152045 (Convert to inline diagnostics in `rustc_infer`) - #149263 (Forbid manual `Unpin` impls for structurally pinned types) - #151754 (Check proj's parent is trait or not when checking dyn compatibility) - #151848 (Port `rustc_mir` to attribute parser) - #151874 (error on unsized AnonConsts) - #151944 (Convert to inline diagnostics in `rustc_attr_parsing`) - #152012 (Use `DEVELOPER_DIR` instead of a custom `xcode-select` script) - #152019 (`NativeLib` cleanups) - #152029 (disable socket tests in Miri) - #152041 (Convert to inline diagnostics in `rustc_query_system`) - #152050 (Try to fix `rustdoc-gui/globals.goml` flakyness) Failed merges: - #152046 (Use glob imports for attribute parsers)
rust-bors bot
pushed a commit
that referenced
this pull request
Feb 3, 2026
…uwer Rollup of 12 pull requests Successful merges: - #152034 (Show largest job duration changes in hours and minutes in the post-merge report) - #152039 (coverage: Add a test case for a previously-unknown span mismatch) - #152045 (Convert to inline diagnostics in `rustc_infer`) - #149263 (Forbid manual `Unpin` impls for structurally pinned types) - #151754 (Check proj's parent is trait or not when checking dyn compatibility) - #151848 (Port `rustc_mir` to attribute parser) - #151874 (error on unsized AnonConsts) - #151944 (Convert to inline diagnostics in `rustc_attr_parsing`) - #152019 (`NativeLib` cleanups) - #152029 (disable socket tests in Miri) - #152041 (Convert to inline diagnostics in `rustc_query_system`) - #152050 (Try to fix `rustdoc-gui/globals.goml` flakyness) Failed merges: - #152046 (Use glob imports for attribute parsers)
rust-bors bot
pushed a commit
that referenced
this pull request
Feb 3, 2026
…uwer Rollup of 12 pull requests Successful merges: - #152034 (Show largest job duration changes in hours and minutes in the post-merge report) - #152039 (coverage: Add a test case for a previously-unknown span mismatch) - #152045 (Convert to inline diagnostics in `rustc_infer`) - #149263 (Forbid manual `Unpin` impls for structurally pinned types) - #151754 (Check proj's parent is trait or not when checking dyn compatibility) - #151848 (Port `rustc_mir` to attribute parser) - #151874 (error on unsized AnonConsts) - #151944 (Convert to inline diagnostics in `rustc_attr_parsing`) - #152019 (`NativeLib` cleanups) - #152029 (disable socket tests in Miri) - #152041 (Convert to inline diagnostics in `rustc_query_system`) - #152050 (Try to fix `rustdoc-gui/globals.goml` flakyness) Failed merges: - #152046 (Use glob imports for attribute parsers)
rust-timer
added a commit
that referenced
this pull request
Feb 3, 2026
Rollup merge of #151754 - mu001999-contrib:fix/151708, r=BoxyUwU Check proj's parent is trait or not when checking dyn compatibility Fixes #151708 When checking dyn compatibility, `proj` here may point to free const whose parent is not trait. Then `TraitRef::from_assoc` will call `generics_of` on the wrong parent. After this change, the following case without `#[type_const]` will still emit ICE same to #149066, but different to the ICE reported in #151708 ```rust #![feature(min_generic_const_args)] // #[type_const] const N: usize = 2; trait CollectArray { fn inner_array(&self) -> [i32; N]; } ``` r? @BoxyUwU
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #151708
When checking dyn compatibility,
projhere may point to free const whose parent is not trait. ThenTraitRef::from_assocwill callgenerics_ofon the wrong parent.After this change, the following case without
#[type_const]will still emit ICE same to #149066, but different to the ICE reported in #151708r? @BoxyUwU