2015-03-17 15:22:11 -04:00
|
|
|
// Check that safe fns are not a subtype of unsafe fns.
|
|
|
|
|
|
|
|
|
|
trait Foo {
|
|
|
|
|
unsafe fn len(&self) -> u32;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl Foo for u32 {
|
|
|
|
|
fn len(&self) -> u32 { *self }
|
2015-07-18 21:14:36 -04:00
|
|
|
//~^ ERROR method `len` has an incompatible type for trait
|
2016-07-18 23:13:34 +03:00
|
|
|
//~| expected type `unsafe fn(&u32) -> u32`
|
|
|
|
|
//~| found type `fn(&u32) -> u32`
|
2015-03-17 15:22:11 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn main() { }
|