summaryrefslogtreecommitdiffstats
path: root/src/test/ui/traits/impl-method-mismatch.rs
blob: 683b1c1aa43e64abe59f8ea257bb7303b780a277 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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 fn pointer `fn
    //~| found fn pointer `unsafe fn
}

fn main() {}