Fix cross-crate inlining of static functions
This commit is contained in:
parent
5bf9e6f58b
commit
4f3cc01487
3 changed files with 36 additions and 9 deletions
14
src/test/auxiliary/static_fn_inline_xc_aux.rs
Normal file
14
src/test/auxiliary/static_fn_inline_xc_aux.rs
Normal 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; }
|
||||
}
|
||||
}
|
||||
|
||||
9
src/test/run-pass/static-fn-inline-xc.rs
Normal file
9
src/test/run-pass/static-fn-inline-xc.rs
Normal 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);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue