mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 18:53:39 +00:00
14 lines
335 B
Rust
14 lines
335 B
Rust
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() {}
|