rust/src/test/run-pass/module-polymorphism2.rc
2012-07-23 10:45:58 -07:00

58 lines
1.0 KiB
Plaintext

#[path = "module-polymorphism2-files"]
mod mystd {
#[path = "float-template"]
mod float {
// The type of the float
import inst::T;
// Unfortunate
import template::*;
export plus;
// 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 = "float-template"]
mod f64 {
import inst::T;
// Unfortunate
import template::*;
export plus;
// Define T as f64
#[path = "inst_f64.rs"]
mod inst;
// Use the implementation for the same source file!
#[path = "template.rs"]
mod template;
}
#[path = "float-template"]
mod f32 {
import inst::T;
// Unfortunate
import template::*;
export plus;
#[path = "inst_f32.rs"]
mod inst;
#[path = "template.rs"]
mod template;
}
}