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

no_std, #[start]: rustc core dump when defining extern main symbol with wrong type signature #31096

Closed
carlpaten opened this issue Jan 21, 2016 · 5 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@carlpaten
Copy link

Minimal test case

carl@crust:~/repro$ rustc test.rs
test.rs:6:5: 6:15 warning: foreign function is never used: `main`, #[warn(dead_code)] on by default
test.rs:6     fn main();
              ^~~~~~~~~~
rustc: /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/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.
Aborted (core dumped)
@durka
Copy link
Contributor

durka commented Jan 21, 2016

cc #9307

@nagisa
Copy link
Member

nagisa commented Jan 21, 2016

Yes, a duplicate of the issue linked above.

@nagisa nagisa closed this as completed Jan 21, 2016
@nagisa
Copy link
Member

nagisa commented Jan 21, 2016

Or rather, I’ll keep this open, since it seems to refer to the #[start] attribute and not a language item.

@nagisa nagisa reopened this Jan 21, 2016
@nagisa nagisa added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Jan 21, 2016
@Mark-Simulacrum
Copy link
Member

Can someone provide a minimal test case for this issue? The one linked in the original comment no longer exists; the linked issue does still assert, though.

@nagisa
Copy link
Member

nagisa commented Apr 16, 2017

From comments it sounds like it was something like

#![feature(start)]

#[start]
fn main() {}

or

extern {
    fn main();
}
fn main(){}

Both of these do not ICE anymore.

Either way, since we do not have the exact reproducer and it was indicated that the issue is kinda similar to the other linked issue, I’m inclined to close.

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