2012-05-24 12:23:46 -05:00
|
|
|
// Make sure const bounds work on things, and test that a few types
|
|
|
|
// are const.
|
|
|
|
|
|
|
|
|
2012-09-07 16:52:28 -05:00
|
|
|
fn foo<T: Copy Const>(x: T) -> T { x }
|
2012-05-24 12:23:46 -05:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
foo(1);
|
2012-07-14 00:57:48 -05:00
|
|
|
foo(~"hi");
|
2012-06-29 18:26:56 -05:00
|
|
|
foo(~[1, 2, 3]);
|
2012-05-24 12:23:46 -05:00
|
|
|
foo({field: 42});
|
|
|
|
foo((1, 2u));
|
2012-05-24 16:24:09 -05:00
|
|
|
foo(@1);
|
|
|
|
foo(~1);
|
2012-05-24 12:23:46 -05:00
|
|
|
}
|