-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Fix ICE: Don't try to evaluate type_consts when eagerly collecting items #151441
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| //@ check-pass | ||
|
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. can you add a multi-crate test such as: // crate a
#[type_const]
pub const FOO: usize = 1;
// crate b
fn main() {
println!("{}", a::FOO);
}
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. though that might ICE until #151260 is merged? unsure what the overlap here is
Contributor
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. I did not really see any overlap, you might want to ask @reddevilmidzy about that, but yea such a test would currently ICE. Might be better to make that part of #151260? |
||
| //@compile-flags: -Clink-dead-code=true | ||
| // link-dead-code tries to eagerly monomorphize and collect items | ||
| // This lead to collector.rs to try and evaluate a type_const | ||
| // which will fail since they do not have bodies. | ||
| #![expect(incomplete_features)] | ||
| #![feature(min_generic_const_args)] | ||
|
|
||
| #[type_const] | ||
| const TYPE_CONST: usize = 0; | ||
| fn main() {} | ||
Uh oh!
There was an error while loading. Please reload this page.