summaryrefslogtreecommitdiffstats
path: root/src/test/ui/invalid-self-argument/trait-fn.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/invalid-self-argument/trait-fn.rs')
-rw-r--r--src/test/ui/invalid-self-argument/trait-fn.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/ui/invalid-self-argument/trait-fn.rs b/src/test/ui/invalid-self-argument/trait-fn.rs
new file mode 100644
index 000000000..5ccea5895
--- /dev/null
+++ b/src/test/ui/invalid-self-argument/trait-fn.rs
@@ -0,0 +1,11 @@
+struct Foo {}
+
+impl Foo {
+ fn c(foo: u32, self) {}
+ //~^ ERROR unexpected `self` parameter in function
+ //~| NOTE must be the first parameter of an associated function
+
+ fn good(&mut self, foo: u32) {}
+}
+
+fn main() { }