syntax: Add a hack to support the int-template pattern

This commit is contained in:
Brian Anderson 2012-11-21 15:51:11 -08:00
parent de0268b693
commit 58e26243a7
5 changed files with 74 additions and 9 deletions

View file

@ -0,0 +1,6 @@
// xfail-test not a test. used by mod-merge-hack.rs
mod inst {
pub type T = i32;
pub const bits: uint = 32;
}

View file

@ -0,0 +1,6 @@
// xfail-test not a test. used by mod-merge-hack.rs
use T = inst::T;
pub const bits: uint = inst::bits;
pub pure fn min(x: T, y: T) -> T { if x < y { x } else { y } }

View file

@ -0,0 +1,9 @@
// xfail-pretty
#[path = "mod-merge-hack-template.rs"]
#[merge = "mod-merge-hack-inst.rs"]
mod myint32;
fn main() {
assert myint32::bits == 32;
assert myint32::min(10, 20) == 10;
}