]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-18959.rs
Merge commit '61667dedf55e3e5aa584f7ae2bd0471336b92ce9' into sync_cg_clif-2021-09-19
[rust.git] / src / test / ui / issues / issue-18959.rs
1 pub trait Foo { fn foo<T>(&self, ext_thing: &T); }
2 pub trait Bar: Foo { }
3 impl<T: Foo> Bar for T { }
4
5 pub struct Thing;
6 impl Foo for Thing {
7     fn foo<T>(&self, _: &T) {}
8 }
9
10 #[inline(never)]
11 fn foo(b: &dyn Bar) {
12     //~^ ERROR E0038
13     b.foo(&0)
14 }
15
16 fn main() {
17     let mut thing = Thing;
18     let test: &dyn Bar = &mut thing;
19     foo(test);
20 }