Open jruderman opened 10 months ago
Found with a modified fuzz-rustc
#![feature(asm_const)] use std::arch::asm; async unsafe fn foo<'a>() { asm!("/* {0} */", const N); } fn main() {}
Requires rustc built with debug assertions enabled
Requires --edition=2021 for async
--edition=2021
error[E0425]: cannot find value N in this scope
N
thread 'rustc' panicked at compiler/rustc_mir_build/src/build/mod.rs:96:5: Unexpected free regions in MIR
stage1 built from 891c6eebe697a7da6e38214e6acebb883b557d4b on x86_64-apple-darwin
@rustbot label +F-asm +requires-debug-assertions
Also ICEs with sym in place of const.
sym
const
Seems to be fixed on the latest nightly.
nightly
you're probably missing debug assertions?
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
``` error[E0425]: cannot find value `N` in this scope --> a1.rs:6:29 | 6 | asm!("/* {0} */", const N); | ^ not found in this scope | help: you might be missing a const parameter | 5 | async unsafe fn foo<'a, const N: /* Type */>() { | +++++++++++++++++++++ thread 'rustc' panicked at compiler/rustc_mir_build/src/build/mod.rs:96:5: Unexpected free regions in MIR: Body { basic_blocks: BasicBlocks { basic_blocks: [BasicBlockData { statements: [StorageLive(_3), _3 = const ()], terminator: Some(Terminator { source_info: SourceInfo { span: a1.rs:6:5: 6:31 (#0), scope: scope[0] }, kind: asm!("/* {0} */", const const _, options((empty))) -> [return: bb1, unwind unreachable] }), is_cleanup: false }, BasicBlockData { statements: [StorageDead(_3), _0 = const ()], terminator: Some(Terminator { source_info: SourceInfo { span: a1.rs:7:1: 7:2 (#99), scope: scope[0] }, kind: drop(_1) -> [return: bb2, unwind: bb3] }), is_cleanup: false }, BasicBlockData { statements: [], terminator: Some(Terminator { source_info: SourceInfo { span: a1.rs:7:2: 7:2 (#0), scope: scope[0] }, kind: return }), is_cleanup: false }, BasicBlockData { statements: [], terminator: Some(Terminator { source_info: SourceInfo { span: a1.rs:5:27: 7:2 (#0), scope: scope[0] }, kind: resume }), is_cleanup: true }], cache: Cache { predecessors: OnceLock(Version
stage1 built from 891c6eebe697a7da6e38214e6acebb883b557d4b on x86_64-apple-darwin
@rustbot label +F-asm +requires-debug-assertions