Skip to content

ICE with reexported methods and external crates #2872

@brson

Description

@brson

Crate the first

#[link(name = "crate_method_reexport_grrrrrrr2")];

export rust;

import name_pool::methods;

mod name_pool {
    import libc::c_char;

    type name_pool = @{
        mut strbufs: ~[str]
    };

    fn name_pool() -> name_pool {
        @{mut strbufs: ~[]}
    }

    impl methods for name_pool {
        fn add(-s: str) -> *c_char {
            let c_str = str::as_c_str(s, |bytes| bytes);
            self.strbufs += ~[s]; // in theory, this should *move* the str in here..
            ret c_str; // ...and so this ptr ought to be valid.
        }
    }
}

mod rust {

    export rt;
    export methods;

    type rt = @();

    impl methods for rt {
        fn cx() {
        }
    }
}

Crate the second

// aux-build:crate-method-reexport-grrrrrrr2.rs

use crate_method_reexport_grrrrrrr2;

fn main() {
    import crate_method_reexport_grrrrrrr2::rust::methods;
    let x = @();
    x.cx();
}

This runs into missing metadata, presumably because name_pool::methods isn't reachable.

Metadata

Metadata

Assignees

Labels

A-linkageArea: linking into static, shared libraries and binariesI-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions