]>
Commit | Line | Data |
---|---|---|
1a4d82fc JJ |
1 | struct Struct { |
2 | person: &'static str | |
223e47cc LB |
3 | } |
4 | ||
1a4d82fc JJ |
5 | trait Trait<T> { |
6 | fn f(&self, x: T); | |
223e47cc LB |
7 | } |
8 | ||
1a4d82fc JJ |
9 | impl Trait<&'static str> for Struct { |
10 | fn f(&self, x: &'static str) { | |
11 | println!("Hello, {}!", x); | |
223e47cc LB |
12 | } |
13 | } | |
14 | ||
223e47cc | 15 | fn main() { |
dc9dc135 | 16 | let s: Box<dyn Trait<isize>> = Box::new(Struct { person: "Fred" }); |
54a0048b | 17 | //~^ ERROR `Struct: Trait<isize>` is not satisfied |
1a4d82fc | 18 | s.f(1); |
223e47cc | 19 | } |