diff options
Diffstat (limited to 'tests/ui/invalid-self-argument/trait-fn.rs')
-rw-r--r-- | tests/ui/invalid-self-argument/trait-fn.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/invalid-self-argument/trait-fn.rs b/tests/ui/invalid-self-argument/trait-fn.rs new file mode 100644 index 000000000..5ccea5895 --- /dev/null +++ b/tests/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() { } |