- Notifications
You must be signed in to change notification settings - Fork 14k
Open
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.Category: This is a bug.F-explicit_tail_calls`#![feature(explicit_tail_calls)]``#![feature(explicit_tail_calls)]`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.
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
Metadata
Metadata
Assignees
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.Category: This is a bug.F-explicit_tail_calls`#![feature(explicit_tail_calls)]``#![feature(explicit_tail_calls)]`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.