Skip to content

Comments

Fix ICE when an associated type is wrongly marked as final#152926

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
makai410:final-on-assoc-type
Feb 22, 2026
Merged

Fix ICE when an associated type is wrongly marked as final#152926
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
makai410:final-on-assoc-type

Conversation

@makai410
Copy link
Member

@makai410 makai410 commented Feb 20, 2026

Fixes: #152797.

cc @mu001999 .

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 20, 2026
@rustbot

This comment was marked as outdated.

@fmease fmease assigned fmease and unassigned chenyukang Feb 20, 2026
@fmease fmease added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 20, 2026
@makai410 makai410 force-pushed the final-on-assoc-type branch 2 times, most recently from 80b7c7e to 812e16e Compare February 21, 2026 13:15
@makai410
Copy link
Member Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 21, 2026
Copy link
Member

@fmease fmease Feb 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also add a (type-leve) assoc const case? They also ICEs on nightly (with no default value for trait assoc const in compiler/rustc_hir_analysis/src/collect.rs) & should be fixed by this PR. Maybe tests/ui/traits/final/final-on-assoc-type-const.rs (sic!) containing:

// See also <https://github.com/rust-lang/rust/issues/152797>..
#![feature(final_associated_functions, min_generic_const_items)]
#![expect(incomplete_features)]

trait Uwu {
    final type const OVO: ();
    //~^ error: `final` is only allowed on associated functions in traits
}

fn main() {}

Much appreciated!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops I just combined the two tests :(( I've already force pushed 3 times so if that doesn't matter too much I'd prefer to leave it as is...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worry, it's fine.

@fmease
Copy link
Member

fmease commented Feb 21, 2026

Some small nits then I'll approve & put it into the queue. Thanks for working on this!

@fmease fmease added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 21, 2026
@makai410 makai410 force-pushed the final-on-assoc-type branch 2 times, most recently from e0e54d9 to 89715df Compare February 22, 2026 15:53
Co-authored-by: León Orell Valerian Liehr <me@fmease.dev>
@makai410 makai410 force-pushed the final-on-assoc-type branch from 89715df to bde075b Compare February 22, 2026 15:55
Copy link
Member

@fmease fmease left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for applying my suggestions. @bors r+ rollup

View changes since this review

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worry, it's fine.

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 22, 2026

📌 Commit bde075b has been approved by fmease

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 22, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 22, 2026
…ease

Fix ICE when an associated type is wrongly marked as `final`

Fixes: rust-lang#152797.

cc @mu001999 .
rust-bors bot pushed a commit that referenced this pull request Feb 22, 2026
…uwer

Rollup of 3 pull requests

Successful merges:

 - #152385 (Feature gate for defaulted associated type_consts with associated_type_defaults )
 - #152921 (Add build.rustdoc option to bootstrap config)
 - #152926 (Fix ICE when an associated type is wrongly marked as `final`)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 22, 2026
…ease

Fix ICE when an associated type is wrongly marked as `final`

Fixes: rust-lang#152797.

cc @mu001999 .
rust-bors bot pushed a commit that referenced this pull request Feb 22, 2026
…uwer

Rollup of 8 pull requests

Successful merges:

 - #149366 (GVN: consider constants of primitive types as deterministic)
 - #152779 (Clarify aspects of query macros)
 - #152958 (`rustc_queries` simplifications)
 - #152385 (Feature gate for defaulted associated type_consts with associated_type_defaults )
 - #152708 (Build: Add `stdenv.cc.cc.lib` to Nix dependencies)
 - #152921 (Add build.rustdoc option to bootstrap config)
 - #152926 (Fix ICE when an associated type is wrongly marked as `final`)
 - #152927 (Index expressions rendered the index: subexpression as the id, instea…)
rust-bors bot pushed a commit that referenced this pull request Feb 22, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - #152779 (Clarify aspects of query macros)
 - #152958 (`rustc_queries` simplifications)
 - #152385 (Feature gate for defaulted associated type_consts with associated_type_defaults )
 - #152708 (Build: Add `stdenv.cc.cc.lib` to Nix dependencies)
 - #152921 (Add build.rustdoc option to bootstrap config)
 - #152926 (Fix ICE when an associated type is wrongly marked as `final`)
 - #152927 (Index expressions rendered the index: subexpression as the id, instea…)
@rust-bors rust-bors bot merged commit 6aad104 into rust-lang:main Feb 22, 2026
11 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Feb 22, 2026
rust-timer added a commit that referenced this pull request Feb 22, 2026
Rollup merge of #152926 - makai410:final-on-assoc-type, r=fmease

Fix ICE when an associated type is wrongly marked as `final`

Fixes: #152797.

cc @mu001999 .
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ICE]: cannot call check_type_bounds on item: TraitItem(TraitItem

5 participants