2014-12-30 19:03:51 +13:00
|
|
|
// Check that static methods are not object-safe.
|
|
|
|
|
|
|
|
trait Tr {
|
|
|
|
fn foo();
|
2015-02-12 10:29:52 -05:00
|
|
|
fn bar(&self) { }
|
2014-12-30 19:03:51 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
struct St;
|
|
|
|
|
|
|
|
impl Tr for St {
|
|
|
|
fn foo() {}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2019-05-28 14:46:13 -04:00
|
|
|
let _: &dyn Tr = &St; //~ ERROR E0038
|
2015-08-07 13:23:11 -04:00
|
|
|
//~^ ERROR E0038
|
2014-12-30 19:03:51 +13:00
|
|
|
}
|