summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/object/safety.rs
blob: f43d332d6963707ec570af8cc57f804b663dbf0f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Check that static methods are not object-safe.

trait Tr {
    fn foo();
    fn bar(&self) { }
}

struct St;

impl Tr for St {
    fn foo() {}
}

fn main() {
    let _: &dyn Tr = &St; //~ ERROR E0038
    //~^ ERROR E0038
}