mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
14 lines
327 B
Rust
14 lines
327 B
Rust
// 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 }
|
|
//~^ ERROR method `len` has an incompatible type for trait
|
|
//~| expected signature `unsafe fn(&_) -> _`
|
|
//~| found signature `fn(&_) -> _`
|
|
}
|
|
|
|
fn main() { }
|