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

Multiple extern functions with differing signatures cause LLVM to throw an assertion #7352

Closed
Blei opened this issue Jun 24, 2013 · 3 comments
Labels
A-codegen Area: Code generation

Comments

@Blei
Copy link
Contributor

Blei commented Jun 24, 2013

See the following code:

mod a {
    extern {
        fn my_fn(a: *u8);
    }
}

mod b {
    extern {
        fn my_fn(a: *u16);
    }
}

fn main() { }

Compiling it causes the following error:

Assertion failed: isa<X>(Val) && "cast<Ty>() argument of incompatible type!", file c:/Users/philii/rust/src/llvm/include/llvm/Support/Casting.h, line 231

I am not sure what the correct handling of this case should be. One easy solution would be to disallow multiple declarations of the same extern function in the same crate.

@brson
Copy link
Contributor

brson commented Jul 10, 2013

nominating production ready

@brson
Copy link
Contributor

brson commented Jul 10, 2013

there may be another issue open on this. it's been a known problem for a long time

@brson
Copy link
Contributor

brson commented Jul 10, 2013

Dupe of #1866

@brson brson closed this as completed Jul 10, 2013
flip1995 pushed a commit to flip1995/rust that referenced this issue Jun 17, 2021
Fix metadata code block syntax highlighting

changelog: none

Fixes code fence block in the metadata collector to change ` ``` ` or ` ```ignore` or ` ```rust,ignore` to ` ```rust`. This makes syntax highlighting work more consistently on the website.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation
Projects
None yet
Development

No branches or pull requests

2 participants