2012-12-10 17:32:48 -08:00
|
|
|
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
2012-05-24 10:23:46 -07:00
|
|
|
// Make sure const bounds work on things, and test that a few types
|
|
|
|
// are const.
|
|
|
|
|
|
|
|
|
2014-03-07 18:57:35 +01:00
|
|
|
fn foo<T: Share>(x: T) -> T { x }
|
2012-05-24 10:23:46 -07:00
|
|
|
|
2013-01-25 22:46:32 -08:00
|
|
|
struct F { field: int }
|
|
|
|
|
2013-02-01 19:43:17 -08:00
|
|
|
pub fn main() {
|
2013-04-18 15:53:29 -07:00
|
|
|
/*foo(1);
|
2014-05-25 03:10:11 -07:00
|
|
|
foo("hi".to_string());
|
2012-06-29 16:26:56 -07:00
|
|
|
foo(~[1, 2, 3]);
|
2013-01-25 22:46:32 -08:00
|
|
|
foo(F{field: 42});
|
2012-05-24 10:23:46 -07:00
|
|
|
foo((1, 2u));
|
2013-04-18 15:53:29 -07:00
|
|
|
foo(@1);*/
|
2014-06-27 12:30:25 -07:00
|
|
|
foo(box 1i);
|
2012-05-24 10:23:46 -07:00
|
|
|
}
|