summaryrefslogtreecommitdiffstats
path: root/src/test/ui/traits/impl-method-mismatch.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/traits/impl-method-mismatch.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/ui/traits/impl-method-mismatch.rs b/src/test/ui/traits/impl-method-mismatch.rs
new file mode 100644
index 000000000..683b1c1aa
--- /dev/null
+++ b/src/test/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 fn pointer `fn
+ //~| found fn pointer `unsafe fn
+}
+
+fn main() {}