]> git.lizzy.rs Git - rust.git/blob - src/test/ui/object-safety/issue-19538.rs
Merge commit 'd3a2366ee877075c59b38bd8ced55f224fc7ef51' into sync_cg_clif-2022-07-26
[rust.git] / src / test / 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 }