Skip to content

ICE if fn main() is #[no_mangle]-ed #19495

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

Closed
liigo opened this issue Dec 3, 2014 · 1 comment
Closed

ICE if fn main() is #[no_mangle]-ed #19495

liigo opened this issue Dec 3, 2014 · 1 comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@liigo
Copy link
Contributor

liigo commented Dec 3, 2014

#[no_mangle]
fn main() {
    println!("hello world");
}

when rustc hello.rs, rustc panicked:

rustc: /home/liigo/rust/rust/src/llvm/include/llvm/Support/Casting.h:237: typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = llvm::Function; Y = llvm::Value; typename llvm::cast_retty<X, Y*>::ret_type = llvm::Function*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
[1]    4419 abort      rustc hello.rs
@brson brson added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Dec 3, 2014
@nagisa
Copy link
Member

nagisa commented Apr 13, 2015

This now results in

test.rs:3:1: 5:2 error: entry symbol `main` defined multiple times
test.rs:3 fn main() {
test.rs:4     println!("hello world");
test.rs:5 }
help: did you use #[no_mangle] on `fn main`? Use #[start] instead
error: aborting due to previous error

So this can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

4 participants