-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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: sty: called Option::unwrap()
on a None
value
#137896
Labels
C-bug
Category: This is a bug.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
bisects to #129514 |
struct A<const X: usize> {
x: Vec<Self> = Vec::new(),
} |
Less dependent on libstd:
|
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Mar 4, 2025
…lt-generic, r=BoxyUwU Allow struct field default values to reference struct's generics Right now, the default field value feature (rust-lang#132162) lowers anon consts whose types may reference ADT params that the const doesn't inherit. This PR fixes this, so that these defaults can reference ADTs' generics, and sets the `generics_of` parenting up correctly. There doesn't seem to be a good reason not to support this, since the anon const has a well-defined type from the field, and the anon const doesn't interact with the type system like generic parameter defaults do. r? `@boxyuwu` or reassign I could also make this into an error if this seems problematic (https://github.com/rust-lang/rust/compare/master...compiler-errors:rust:default-field-value-implicit-param?expand=1)...... but I'd rather make this work and register an open question on the tracking issue about validating that this is well-vetted. Fixes rust-lang#137896
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Mar 4, 2025
…lt-generic, r=BoxyUwU Allow struct field default values to reference struct's generics Right now, the default field value feature (rust-lang#132162) lowers anon consts whose types may reference ADT params that the const doesn't inherit. This PR fixes this, so that these defaults can reference ADTs' generics, and sets the `generics_of` parenting up correctly. There doesn't seem to be a good reason not to support this, since the anon const has a well-defined type from the field, and the anon const doesn't interact with the type system like generic parameter defaults do. r? ``@boxyuwu`` or reassign I could also make this into an error if this seems problematic (https://github.com/rust-lang/rust/compare/master...compiler-errors:rust:default-field-value-implicit-param?expand=1)...... but I'd rather make this work and register an open question on the tracking issue about validating that this is well-vetted. Fixes rust-lang#137896
tgross35
added a commit
to tgross35/rust
that referenced
this issue
Mar 4, 2025
…lt-generic, r=BoxyUwU Allow struct field default values to reference struct's generics Right now, the default field value feature (rust-lang#132162) lowers anon consts whose types may reference ADT params that the const doesn't inherit. This PR fixes this, so that these defaults can reference ADTs' generics, and sets the `generics_of` parenting up correctly. There doesn't seem to be a good reason not to support this, since the anon const has a well-defined type from the field, and the anon const doesn't interact with the type system like generic parameter defaults do. r? ```@boxyuwu``` or reassign I could also make this into an error if this seems problematic (https://github.com/rust-lang/rust/compare/master...compiler-errors:rust:default-field-value-implicit-param?expand=1)...... but I'd rather make this work and register an open question on the tracking issue about validating that this is well-vetted. Fixes rust-lang#137896
workingjubilee
added a commit
to workingjubilee/rustc
that referenced
this issue
Mar 4, 2025
…lt-generic, r=BoxyUwU Allow struct field default values to reference struct's generics Right now, the default field value feature (rust-lang#132162) lowers anon consts whose types may reference ADT params that the const doesn't inherit. This PR fixes this, so that these defaults can reference ADTs' generics, and sets the `generics_of` parenting up correctly. There doesn't seem to be a good reason not to support this, since the anon const has a well-defined type from the field, and the anon const doesn't interact with the type system like generic parameter defaults do. r? ````@boxyuwu```` or reassign I could also make this into an error if this seems problematic (https://github.com/rust-lang/rust/compare/master...compiler-errors:rust:default-field-value-implicit-param?expand=1)...... but I'd rather make this work and register an open question on the tracking issue about validating that this is well-vetted. Fixes rust-lang#137896
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Mar 5, 2025
Rollup merge of rust-lang#137913 - compiler-errors:struct-field-default-generic, r=BoxyUwU Allow struct field default values to reference struct's generics Right now, the default field value feature (rust-lang#132162) lowers anon consts whose types may reference ADT params that the const doesn't inherit. This PR fixes this, so that these defaults can reference ADTs' generics, and sets the `generics_of` parenting up correctly. There doesn't seem to be a good reason not to support this, since the anon const has a well-defined type from the field, and the anon const doesn't interact with the type system like generic parameter defaults do. r? `````@boxyuwu````` or reassign I could also make this into an error if this seems problematic (https://github.com/rust-lang/rust/compare/master...compiler-errors:rust:default-field-value-implicit-param?expand=1)...... but I'd rather make this work and register an open question on the tracking issue about validating that this is well-vetted. Fixes rust-lang#137896
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-bug
Category: This is a bug.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
snippet:
Version information
Possibly related line of code:
rust/compiler/rustc_middle/src/ty/sty.rs
Lines 356 to 368 in 7c4a55c
Command:
/home/matthias/.rustup/toolchains/master/bin/rustc -Zincremental-verify-ich=yes -Cincremental=<dir> -Cdebuginfo=2 -Clink-dead-code=true -Zvalidate-mir --edition=2024
Program output
The text was updated successfully, but these errors were encountered: