]> git.lizzy.rs Git - rust.git/blob - src/test/ui/traits/object/safety.rs
Rollup merge of #99742 - sigaloid:master, r=thomcc
[rust.git] / src / test / ui / traits / object / safety.rs
1 // Check that static methods are not object-safe.
2
3 trait Tr {
4     fn foo();
5     fn bar(&self) { }
6 }
7
8 struct St;
9
10 impl Tr for St {
11     fn foo() {}
12 }
13
14 fn main() {
15     let _: &dyn Tr = &St; //~ ERROR E0038
16     //~^ ERROR E0038
17 }