Repository navigation
ICE: sty: None #138361
Description
Activity
- addedC-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
on Mar 11, 2025 - addedneeds-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triagingThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
on Mar 11, 2025 mvce probably
fn a() { [0; loop{}]; std::mem::transmute(4) } fn main() {}
bisects to nightly-2024-02-23
bisecting between nightly-2024-02-22 and nightly-2024-02-23
bisection reports: 46f4983 is the first bad commit
cc @nnethercote
git bisect start # status: waiting for both good and bad commits # good: [3406ada96f8e16e49e947a91db3eba0db45245fa] Auto merge of #117658 - RalfJung:ptr-dangling, r=m-ou-se git bisect good 3406ada96f8e16e49e947a91db3eba0db45245fa # status: waiting for bad commit, 1 good commit known # bad: [397937d812852f9bbeb671005cb399dbcb357cde] Auto merge of #119989 - lcnr:sub_relations-bye-bye, r=compiler-errors git bisect bad 397937d812852f9bbeb671005cb399dbcb357cde # bad: [52dba5ffe73c25951fd6ae38bf20513002dd7874] Auto merge of #121225 - RalfJung:simd-extract-insert-const-idx, r=oli-obk,Amanieu git bisect bad 52dba5ffe73c25951fd6ae38bf20513002dd7874 # bad: [64dbc3f38f3ec80ad6c9246a2342810abd4c6daa] Rollup merge of #121392 - bjorn3:unify_dylib_loading, r=petrochenkov git bisect bad 64dbc3f38f3ec80ad6c9246a2342810abd4c6daa # bad: [5c89029585db9e7963cc67360213830703091f4d] Rollup merge of #121206 - nnethercote:top-level-error-handling, r=oli-obk git bisect bad 5c89029585db9e7963cc67360213830703091f4d # bad: [72b172bdf631483d0f802c54c8dc8246f6b4e00e] Overhaul the handling of errors at the top-level. git bisect bad 72b172bdf631483d0f802c54c8dc8246f6b4e00e # good: [203b4332bb3da3af092344b3459416aeab4c90ef] Remove dead `expect_error_or_delayed_bug` method. git bisect good 203b4332bb3da3af092344b3459416aeab4c90ef # bad: [46f49833566381887ba74e3f756271a6e8723636] Adjust the `has_errors*` methods. git bisect bad 46f49833566381887ba74e3f756271a6e8723636 # good: [9919c3dab3e4eabe466612de5f6c472e3e27ceb6] Remove `EarlyDiagCtxt::abort_if_errors`. git bisect good 9919c3dab3e4eabe466612de5f6c472e3e27ceb6 # first bad commit: [46f49833566381887ba74e3f756271a6e8723636] Adjust the `has_errors*` methods.Interestingly the panic I'm getting is different:
thread 'rustc' panicked at compiler/rustc_middle/src/ty/sty.rs:1293:32: range end index 18446744073709551615 out of range for slice of length 0It seems that in both cases, what happens is that an
FnSig/Tyswith zero length gets created and then accessed,I think what's going on here is that the "constant evaluation is taking a long time" lint is getting triggered, aborts the typechecking of the function, and then the transmute lint trips over that – and because the former is a lint, it isn't enough for the lint passes to decide "this thing is broken enough that we shouldn't try to lint it"?
Not sure where is the code that actually implements this, though, and no idea why @nnethercote's commit would change this behavior.
Okay, before the offending commit, an actual typechecking error gets emitted in addition to the
long_running_const_evallint.error: constant evaluation is taking a long time --> ice138361.rs:2:7 | 2 | [0; loop{}]; | ^^^^^^ | = note: this lint makes sure the compiler doesn't get stuck due to infinite loops in const eval. If your compilation actually takes a long time, you can safely allow the lint. help: the constant being evaluated --> ice138361.rs:2:7 | 2 | [0; loop{}]; | ^^^^^^ = note: `#[deny(long_running_const_eval)]` on by default error[E0282]: type annotations needed --> ice138361.rs:2:3 | 2 | [0; loop{}]; | ^^^^^^^^^^^ cannot infer type for array `[{integer}; {const error}]`@rustbot claim
@rustbot unclaim
cough
@rustbot release-assignment
- removedneeds-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triagingThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
on Apr 10, 2025 - addedS-bug-has-testStatus: This bug is tracked inside the repo by a `known-bug` test.Status: This bug is tracked inside the repo by a `known-bug` test.
on May 2, 2025 @rustbot claim
- added 2 commits that reference this issue
on Sep 22, 2026 - added 3 commits that reference this issue
on Sep 22, 2026 - added a commit that references this issue
on Sep 22, 2026
snippet:
Version information
Possibly related line of code:
rust/compiler/rustc_middle/src/ty/sty.rs
Lines 2072 to 2084 in ebf0cf7
Command:
/home/matthias/.rustup/toolchains/master/bin/rustcProgram output