-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
Fix ICE when an associated type is wrongly marked as final
#152926
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 // 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!
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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...
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No worry, it's fine. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| // This is a regression test for <https://github.com/rust-lang/rust/issues/152797>. | ||
| #![feature(final_associated_functions)] | ||
| #![feature(min_generic_const_args)] | ||
| #![expect(incomplete_features)] | ||
| trait Uwu { | ||
| final type Ovo; | ||
| //~^ error: `final` is only allowed on associated functions in traits | ||
| final type const QwQ: (); | ||
| //~^ error: `final` is only allowed on associated functions in traits | ||
| } | ||
|
|
||
| fn main() {} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| error: `final` is only allowed on associated functions in traits | ||
| --> $DIR/final-on-assoc-type-const.rs:6:5 | ||
| | | ||
| LL | final type Ovo; | ||
| | -----^^^^^^^^^^ | ||
| | | | ||
| | `final` because of this | ||
|
|
||
| error: `final` is only allowed on associated functions in traits | ||
| --> $DIR/final-on-assoc-type-const.rs:8:5 | ||
| | | ||
| LL | final type const QwQ: (); | ||
| | -----^^^^^^^^^^^^^^^^^^^^ | ||
| | | | ||
| | `final` because of this | ||
|
|
||
| error: aborting due to 2 previous errors | ||
|
|
Uh oh!
There was an error while loading. Please reload this page.