I tried this code:
struct Struct;
fn foo<T: ?Sized>(t: &T) -> usize {
become bar(t);
}
#[track_caller]
fn bar<T: ?Sized>(_: &T) -> usize {
456
}
fn main() {
assert_eq!(foo(&Struct), 456);
}
I expected to see: Not sure actually.
Instead, LLVM's opt --passes=verify fails b/c we're performing a tail call with an incompatible signature.
Meta
rustc --version --verbose:
whatever is nightly on august 12, 2025
Not really an ICE per se, but a llvm bug. It doesn't show up on nightly b/c llvm is not built with debug assertions, I think, but it does show up when you pass the generated llvm to opt. I did this in alive2.
I think we need to rework how tail calls handle both pre-mono and post-mono #[track_caller] :3
I tried this code:
I expected to see: Not sure actually.
Instead, LLVM's
opt --passes=verifyfails b/c we're performing a tail call with an incompatible signature.Meta
rustc --version --verbose:Not really an ICE per se, but a llvm bug. It doesn't show up on nightly b/c llvm is not built with debug assertions, I think, but it does show up when you pass the generated llvm to
opt. I did this in alive2.I think we need to rework how tail calls handle both pre-mono and post-mono
#[track_caller]:3