about summary refs log tree commit diff
path: root/tests/ui/traits/impl-method-mismatch.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/traits/impl-method-mismatch.rs')
-rw-r--r--tests/ui/traits/impl-method-mismatch.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ui/traits/impl-method-mismatch.rs b/tests/ui/traits/impl-method-mismatch.rs
new file mode 100644
index 00000000000..62580755c81
--- /dev/null
+++ b/tests/ui/traits/impl-method-mismatch.rs
@@ -0,0 +1,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 signature `fn
+    //~| found signature `unsafe fn
+}
+
+fn main() {}