Open
Description
Code
#[derive(Default)]
struct Thing(Box<Thing>);
Thing::default() // unconditional recursion leading to a stack overflow
Current output
N/A
Desired output
Rustc should print the unconditional recursion lint and maybe recommend a rewrite in some way?
Rationale and extra context
In this case I meant to write Option<Box<...>>
Other cases
Rust Version
rustc 1.89.0-nightly (1677d46cb 2025-06-10)
binary: rustc
commit-hash: 1677d46cb128cc8f285dbd32b0dc4d7a46437050
commit-date: 2025-06-10
host: x86_64-unknown-linux-gnu
release: 1.89.0-nightly
LLVM version: 20.1.5