2018-08-30 07:18:55 -05:00
|
|
|
// run-pass
|
2021-05-21 12:35:49 -05:00
|
|
|
|
|
|
|
#![allow(dead_code)]
|
|
|
|
|
2015-02-12 09:29:52 -06:00
|
|
|
trait Trait { fn dummy(&self) { } }
|
2014-12-13 23:35:35 -06:00
|
|
|
|
2015-01-28 07:34:18 -06:00
|
|
|
#[derive(Debug)]
|
2014-12-13 23:35:35 -06:00
|
|
|
struct Foo<T: Trait> {
|
|
|
|
foo: T,
|
|
|
|
}
|
|
|
|
|
2015-01-28 07:34:18 -06:00
|
|
|
#[derive(Debug)]
|
2014-12-13 23:35:35 -06:00
|
|
|
struct Bar<T> where T: Trait {
|
|
|
|
bar: T,
|
|
|
|
}
|
|
|
|
|
2015-03-25 19:06:52 -05:00
|
|
|
impl Trait for isize {}
|
2014-12-13 23:35:35 -06:00
|
|
|
|
|
|
|
fn main() {
|
2015-01-25 15:05:03 -06:00
|
|
|
let a = Foo { foo: 12 };
|
|
|
|
let b = Bar { bar: 12 };
|
2014-12-20 02:09:35 -06:00
|
|
|
println!("{:?} {:?}", a, b);
|
2014-12-13 23:35:35 -06:00
|
|
|
}
|