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

rustc crash when #[no_mangle] function is declared multiple times with different signatures. #24583

Closed
pnkfelix opened this issue Apr 19, 2015 · 4 comments

Comments

@pnkfelix
Copy link
Member

(imported from improperly closed bug #18358)

#![allow(dead_code)]

pub mod x {
    #[no_mangle]
    pub fn f() { }
}

pub mod y {
    #[no_mangle]
    pub fn f(_: i32) { }
}

fn main() { }

playpen

This crashes with:

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 (core dumped)
playpen: application terminated with error code 134
Program ended.

(I don't know what it does if one compiles about LLVM assertions turned on.)

@nagisa
Copy link
Member

nagisa commented Apr 19, 2015

This doesn’t crash anymore.

test.rs:10:5: 10:25 error: symbol `f` is already defined
test.rs:10     pub fn f(_: i32) { }
               ^~~~~~~~~~~~~~~~~~~~

@pnkfelix
Copy link
Member Author

@nagisa it currently crashes in the playpen, set to "Nightly" ... are you saying its been fixed since the last nightly, but the PR didn't reference this ticket?

@nagisa
Copy link
Member

nagisa commented Apr 19, 2015

@pnkfelix cases like these are errors (or ICEs, like in #24561) since #23011 has landed.

I think playpen’s nightly might be outdated.

@alexcrichton
Copy link
Member

I think @nagisa is right, I get an error on the most recent nightly, co closing. I'll investigate what's up with playpen.

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

3 participants