Closed
Description
In the latest master the following code
fn foo() -> bool { false }
fn main() {
return;
!foo();
}
produces
rustc: /build/rust-git/src/rust/src/llvm/include/llvm/Support/Casting.h:231: typename llvm::enable_if<llvm::is_same<Y, typename llvm::simplify_type<From>::SimpleType>, typename llvm::cast_retty<X, Y*>::ret_type>::type llvm::cast(Y*) [with X = llvm::SequentialType; Y = llvm::Type; typename llvm::enable_if<llvm::is_same<Y, typename llvm::simplify_type<From>::SimpleType>, typename llvm::cast_retty<X, Y*>::ret_type>::type = llvm::SequentialType*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
The failure still happens if you replace foo()
by any expression which returns bool
. But as soon as you remove the !
it compiles just fine.
Metadata
Metadata
Assignees
Labels
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.