]> git.lizzy.rs Git - rust.git/blob - tests/ui/object-safety/issue-19538.rs
Rollup merge of #106605 - notriddle:notriddle/outdated-rustbook, r=GuillaumeGomez
[rust.git] / tests / ui / object-safety / issue-19538.rs
1 trait Foo {
2     fn foo<T>(&self, val: T);
3 }
4
5 trait Bar: Foo { }
6
7 pub struct Thing;
8
9 impl Foo for Thing {
10     fn foo<T>(&self, val: T) { }
11 }
12
13 impl Bar for Thing { }
14
15 fn main() {
16     let mut thing = Thing;
17     let test: &mut dyn Bar = &mut thing;
18     //~^ ERROR E0038
19     //~| ERROR E0038
20 }