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