blob: 886e92604a0be9e5bcef83dec3a3fb2339f13103 (
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 type `fn
//~| found type `unsafe fn
}
fn main() {}
|