mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 10:45:18 +00:00
24 lines
321 B
Rust
24 lines
321 B
Rust
//@ run-pass
|
|
|
|
#![allow(dead_code)]
|
|
|
|
trait Trait { fn dummy(&self) { } }
|
|
|
|
#[derive(Debug)]
|
|
struct Foo<T: Trait> {
|
|
foo: T,
|
|
}
|
|
|
|
#[derive(Debug)]
|
|
struct Bar<T> where T: Trait {
|
|
bar: T,
|
|
}
|
|
|
|
impl Trait for isize {}
|
|
|
|
fn main() {
|
|
let a = Foo { foo: 12 };
|
|
let b = Bar { bar: 12 };
|
|
println!("{:?} {:?}", a, b);
|
|
}
|