rust/src/test/run-pass/module-polymorphism.rc

43 lines
692 B
Plaintext
Raw Normal View History

#[path = "module-polymorphism-files"]
2012-07-10 17:52:05 -05:00
mod my_float {
// 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 {
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 {
import inst::T;
#[path = "inst_f32.rs"]
mod inst;
#[path = "template.rs"]
mod template;
}