Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LLVM assert with owned closure returning closed-over value, "argument of incompatible type" #20240

Closed
bstrie opened this issue Dec 26, 2014 · 2 comments
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@bstrie
Copy link
Contributor

bstrie commented Dec 26, 2014

Test case:

fn main() {
    let x = 2i;
    let _y = move || x;
}

Output:

rustc: /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/llvm/include/llvm/Support/Casting.h:237: typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = llvm::PointerType; Y = llvm::Type; typename llvm::cast_retty<X, Y*>::ret_type = llvm::PointerType*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
Aborted
@bstrie bstrie added I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. labels Dec 26, 2014
@huonw huonw added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Dec 26, 2014
@japaric
Copy link
Member

japaric commented Dec 26, 2014

I think this is a duplicate of #19141, #20193 and #20228. See this #20193 (comment) for rationale.

As a workaround use move |:| instead of move ||.

@bstrie
Copy link
Contributor Author

bstrie commented Dec 26, 2014

I'd say this is a dupe of #19141, yep. I'll close this one. Given that they're giving different error messages I'd say #20193 and #20228 are probably worth keeping open for the time being even though they're all likely caused by the same thing.

@bstrie bstrie closed this as completed Dec 26, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

3 participants