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