Open
Description
I tried this code:
#[inline(never)]
#[no_mangle]
const fn deep(n: usize) {
match n {
0 => (),
_ => deep(n - 1),
}
}
#[inline(always)]
const fn inf() -> ! {
inf()
}
fn main() {
deep(usize::MAX);
println!("✅");
inf();
}
I expected to see this happen: prints "✅"
fast and successfully, then hangs in an infinite loop.
Instead, this happened: prints "✅"
fast and panics with stderr
:
Compiling playground v0.0.1 (/playground)
Finished `release` profile [optimized] target(s) in 0.38s
Running `target/release/playground`
thread 'main' has overflowed its stack
fatal runtime error: stack overflow
It seems commenting-out the attributes is no-op here.
Meta
rustc --version --verbose
:
1.80.0-nightly
(2024-05-28 da159eb331b27df52818)
Backtrace
<no diff>
Apologies in advance, if this issue is a dupe. I tried my best to find similar ones