summary refs log tree commit diff
path: root/src/test/run-pass/const-bound.rs
blob: 36ca25cd1bb1d7079605775f1acd978829fd3598 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// 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");
    foo(~[1, 2, 3]);
    foo({field: 42});
    foo((1, 2u));
    foo(@1);
    foo(~1);
}