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