]> git.lizzy.rs Git - rust.git/blob - tests/ui/issues/issue-18959.rs
Auto merge of #107044 - cuviper:more-llvm-ci, r=Mark-Simulacrum
[rust.git] / tests / 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 }