-
Notifications
You must be signed in to change notification settings - Fork 13.3k
ICE: expected bits of u8, got Ty(10_u32,)
#123092
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Labels
A-MIR
Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html
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
Regression in #120550, but I guess it is already known. |
#120550 only exposed it more easily, the ICE can also be triggered on stable by invoking the function in an array length: trait Range {
const FIRST: u8;
const LAST: u8;
}
struct TwoDigits;
impl Range for TwoDigits {
const FIRST: = 10;
const LAST: u8 = 99;
}
const fn digits(x: u8) -> usize {
match x {
TwoDigits::FIRST..=TwoDigits::LAST => 0,
}
}
const FOOMP: [(); {
digits(42)
}] = []; |
trait Range {
const FIRST: u8;
const LAST: u8;
}
struct TwoDigits;
impl Range for TwoDigits {
const FIRST: = 10;
const LAST: u8 = 99;
}
const FOOMP: [(); {
TwoDigits::FIRST as usize
}] = []; has been ICEing with different messages since 1.23 (edit: but isn't ICEing anymore, edit: Further bisection can be done, but is probably not useful. I'll just fix the bug 😆 |
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Mar 27, 2024
…iler-errors Load missing type of impl associated constant from trait definition fixes rust-lang#123092 Also does some cleanups I discovered while analyzing this issue
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Mar 28, 2024
Rollup merge of rust-lang#123130 - oli-obk:missing_type_taint, r=compiler-errors Load missing type of impl associated constant from trait definition fixes rust-lang#123092 Also does some cleanups I discovered while analyzing this issue
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Labels
A-MIR
Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html
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.
Code
(reduced)
Note: type notation at
const FIRST:
in TwoDigits is omitted. I guess that causes ICEOriginal Code
Meta
rustc --version --verbose
:Command
rustc
, no other optionsError output
Backtrace
Related Issues
generic_const_exprs
ICE with nested generic params #118244 and ICE withgeneric_const_exprs
:expected bits of usize, got (Sub: 2_usize, 1_usize): usize
#116637fn eval_bits
incompiler/rustc_middle/src/ty/consts.rs
, and this ICE occured atfn eval_bits
incompiler/rustc_middle/src/mir/consts.rs
.compiler/rustc_middle/src/ty/consts.rs
(ICE-loc link for #118244),compiler/rustc_middle/src/mir/consts.rs
(ICE-loc link for this issue)The text was updated successfully, but these errors were encountered: