rust/tests/ui/deriving/issue-19358.rs

24 lines
321 B
Rust
Raw Normal View History

//@ run-pass
#![allow(dead_code)]
trait Trait { fn dummy(&self) { } }
2015-01-28 13:34:18 +00:00
#[derive(Debug)]
struct Foo<T: Trait> {
foo: T,
}
2015-01-28 13:34:18 +00:00
#[derive(Debug)]
struct Bar<T> where T: Trait {
bar: T,
}
impl Trait for isize {}
fn main() {
2015-01-25 21:05:03 +00:00
let a = Foo { foo: 12 };
let b = Bar { bar: 12 };
println!("{:?} {:?}", a, b);
}