-
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 "Unexpected free regions in MIR" with asm_const, missing constant, async, and lifetime parameter #117877
Labels
A-inline-assembly
Area: Inline assembly (`asm!(…)`)
C-bug
Category: This is a bug.
F-asm
`#![feature(asm)]` (not `llvm_asm`)
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
requires-debug-assertions
This issue requires a build of rustc or tooling with debug-assertions in some way
S-bug-has-test
Status: This bug is tracked inside the repo by a `known-bug` test.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
Also ICEs with |
Seems to be fixed on the latest nightly. |
you're probably missing debug assertions? |
@rustbot label: +I-ICE +T-compiler +C-bug +S-bug-has-test +requires-debug-assertions |
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Feb 28, 2025
Handle asm const similar to inline const Previously, asm consts are handled similar to anon consts rather than inline consts. Anon consts are not good at dealing with lifetimes, because `type_of` has lifetimes erased already. Inline consts can deal with lifetimes because they live in an outer typeck context. And since `global_asm!` lacks an outer typeck context, we have implemented asm consts with anon consts while they're in fact more similar to inline consts. This was changed in rust-lang#137180, and this means that handling asm consts as inline consts are possible. While as `@compiler-errors` pointed out, `const` currently can't be used with any types with lifetime, this is about to change if rust-lang#128464 is implemented. This PR is a preparatory PR for that feature. As an unintentional side effect, fix rust-lang#117877. cc `@Amanieu` r? `@compiler-errors`
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Feb 28, 2025
Handle asm const similar to inline const Previously, asm consts are handled similar to anon consts rather than inline consts. Anon consts are not good at dealing with lifetimes, because `type_of` has lifetimes erased already. Inline consts can deal with lifetimes because they live in an outer typeck context. And since `global_asm!` lacks an outer typeck context, we have implemented asm consts with anon consts while they're in fact more similar to inline consts. This was changed in rust-lang#137180, and this means that handling asm consts as inline consts are possible. While as ``@compiler-errors`` pointed out, `const` currently can't be used with any types with lifetime, this is about to change if rust-lang#128464 is implemented. This PR is a preparatory PR for that feature. As an unintentional side effect, fix rust-lang#117877. cc ``@Amanieu`` r? ``@compiler-errors``
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Mar 1, 2025
Rollup merge of rust-lang#137686 - nbdd0121:asm_const, r=compiler-errors Handle asm const similar to inline const Previously, asm consts are handled similar to anon consts rather than inline consts. Anon consts are not good at dealing with lifetimes, because `type_of` has lifetimes erased already. Inline consts can deal with lifetimes because they live in an outer typeck context. And since `global_asm!` lacks an outer typeck context, we have implemented asm consts with anon consts while they're in fact more similar to inline consts. This was changed in rust-lang#137180, and this means that handling asm consts as inline consts are possible. While as `@compiler-errors` pointed out, `const` currently can't be used with any types with lifetime, this is about to change if rust-lang#128464 is implemented. This PR is a preparatory PR for that feature. As an unintentional side effect, fix rust-lang#117877. cc `@Amanieu` r? `@compiler-errors`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-inline-assembly
Area: Inline assembly (`asm!(…)`)
C-bug
Category: This is a bug.
F-asm
`#![feature(asm)]` (not `llvm_asm`)
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
requires-debug-assertions
This issue requires a build of rustc or tooling with debug-assertions in some way
S-bug-has-test
Status: This bug is tracked inside the repo by a `known-bug` test.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Found with a modified fuzz-rustc
Code
Requires rustc built with debug assertions enabled
Requires
--edition=2021
for asyncError output
error[E0425]: cannot find value
N
in this scopethread 'rustc' panicked at compiler/rustc_mir_build/src/build/mod.rs:96:5:
Unexpected free regions in MIR
Full output including backtrace
Version
stage1 built from 891c6ee on x86_64-apple-darwin
@rustbot label +F-asm +requires-debug-assertions
The text was updated successfully, but these errors were encountered: