]> git.proxmox.com Git - rustc.git/blame - src/test/ui/traits/coercion-generic-bad.rs
Merge tag 'debian/1.52.1+dfsg1-1_exp2' into proxmox/buster
[rustc.git] / src / test / ui / traits / coercion-generic-bad.rs
CommitLineData
1a4d82fc
JJ
1struct Struct {
2 person: &'static str
223e47cc
LB
3}
4
1a4d82fc
JJ
5trait Trait<T> {
6 fn f(&self, x: T);
223e47cc
LB
7}
8
1a4d82fc
JJ
9impl Trait<&'static str> for Struct {
10 fn f(&self, x: &'static str) {
11 println!("Hello, {}!", x);
223e47cc
LB
12 }
13}
14
223e47cc 15fn 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}