rust/tests/ui/traits/impl-method-mismatch.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
335 B
Rust
Raw Permalink Normal View History

trait Mumbo {
fn jumbo(&self, x: &usize) -> usize;
}
impl Mumbo for usize {
// Cannot have a larger effect than the trait:
unsafe fn jumbo(&self, x: &usize) { *self + *x; }
//~^ ERROR method `jumbo` has an incompatible type for trait
//~| expected signature `fn
//~| found signature `unsafe fn
}
fn main() {}