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

Panic in mun build in certain situations with external functions #222

Closed
Imberflur opened this issue Jun 12, 2020 · 3 comments
Closed

Panic in mun build in certain situations with external functions #222

Imberflur opened this issue Jun 12, 2020 · 3 comments

Comments

@Imberflur
Copy link

> mun build test.mun
mun: /usr/lib/libtinfo.so.5: no version information available (required by mun)
thread 'main' panicked at 'missing function value for hir function: 'foo'', <::std::macros::panic macros>:5:6

Looks like this panic

If either of the commented lines are used the panic does not occur.

extern fn foo();
extern fn bar();

pub fn two() {
    bar();
    //foo(); // works with this
    one(); // no effect with or without this
}

//pub fn fn_one() { // works with this
fn one() {
    bar();
    foo();
}

could be related to #221?

@baszalmstra
Copy link
Collaborator

baszalmstra commented Jun 12, 2020

I just added your example as a test case:

#[test]
fn issue_222() {
    test_snapshot(r#"
    extern fn foo();
    extern fn bar();

    pub fn two() {
        bar();
        //foo(); // works with this
        one(); // no effect with or without this
    }

    //pub fn fn_one() { // works with this
    fn one() {
        bar();
        foo();
    }
    "#)
}

in crates/mun_codegen/src/test.rs. I can verify that the fix in #221 fixes this issue. It fails on master.

@baszalmstra
Copy link
Collaborator

I can confirm that #221 fixed the issue. We'll backport this to v0.2 and publish a new version.

@baszalmstra
Copy link
Collaborator

#221 fixed this issue, it has also been backported to the release/v0.2 branch.

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

2 participants