2012-04-14 01:27:03 -05:00
|
|
|
#[path = "module-polymorphism-files"]
|
2012-07-10 17:52:05 -05:00
|
|
|
mod my_float {
|
2012-04-14 01:27:03 -05:00
|
|
|
|
|
|
|
// The type of the float
|
|
|
|
import inst::T;
|
|
|
|
|
|
|
|
// Define T as float
|
|
|
|
#[path = "inst_float.rs"]
|
|
|
|
mod inst;
|
|
|
|
|
|
|
|
// Add in the implementation from a single source file
|
|
|
|
#[path = "template.rs"]
|
|
|
|
mod template;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#[path = "module-polymorphism-files"]
|
2012-07-10 17:52:05 -05:00
|
|
|
mod my_f64 {
|
2012-04-14 01:27:03 -05:00
|
|
|
|
|
|
|
import inst::T;
|
|
|
|
|
|
|
|
// Define T as f64
|
|
|
|
#[path = "inst_f64.rs"]
|
|
|
|
mod inst;
|
|
|
|
|
|
|
|
// Use the implementation for the same source file!
|
|
|
|
#[path = "template.rs"]
|
|
|
|
mod template;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#[path = "module-polymorphism-files"]
|
2012-07-10 17:52:05 -05:00
|
|
|
mod my_f32 {
|
2012-04-14 01:27:03 -05:00
|
|
|
import inst::T;
|
|
|
|
|
|
|
|
#[path = "inst_f32.rs"]
|
|
|
|
mod inst;
|
|
|
|
|
|
|
|
#[path = "template.rs"]
|
|
|
|
mod template;
|
|
|
|
|
2012-07-06 13:35:46 -05:00
|
|
|
}
|