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