Skip to content

Abort in rustc on valid code #21767

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
jleahy opened this issue Jan 30, 2015 · 3 comments
Closed

Abort in rustc on valid code #21767

jleahy opened this issue Jan 30, 2015 · 3 comments

Comments

@jleahy
Copy link

jleahy commented Jan 30, 2015

This is using "rustc 1.0.0-nightly (458a6a2 2015-01-25 21:20:37 +0000)".

Code:

#![start]
#[no_mangle]
fn main() {}

Command line:

rustc test.rs

Error:

test.rs:1:1: 1:10 warning: unused attribute, #[warn(unused_attributes)] on by default
test.rs:1 #![start]
          ^~~~~~~~~
rustc: /home/rustbuild/src/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
@jleahy jleahy changed the title Abort in rustc on invalid code Abort in rustc on valid code Jan 30, 2015
@klutzy
Copy link
Contributor

klutzy commented Jan 30, 2015

Sub-issue of #10883. (There's internal main function which calls main function provided by user, so #[no_mangle] causes name clash.)

@jleahy
Copy link
Author

jleahy commented Jan 30, 2015

Aha, I should have tried removing the "#![start]" to minimize it further.

@nagisa
Copy link
Member

nagisa commented Jan 30, 2015

Duplicate of #19495

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants