Fix cross-crate inlining of static functions

This commit is contained in:
Brian Anderson 2012-12-02 15:45:20 -08:00
parent 5bf9e6f58b
commit 4f3cc01487
3 changed files with 36 additions and 9 deletions

View file

@ -0,0 +1,14 @@
pub mod num {
pub trait Num2 {
static pure fn from_int2(n: int) -> self;
}
}
pub mod float {
impl float: num::Num2 {
#[inline]
static pure fn from_int2(n: int) -> float { return n as float; }
}
}

View file

@ -0,0 +1,9 @@
// aux-build:static_fn_inline_xc_aux.rs
extern mod mycore(name ="static_fn_inline_xc_aux");
use mycore::num;
fn main() {
let _1:float = num::from_int2(1i);
}