fn parse_fn_args(&mut self, named_args: bool, allow_variadic: bool)
-> PResult<'a, (Vec<Arg> , bool)> {
self.expect(&token::OpenDelim(token::Paren))?;
-
+
let sp = self.span;
let mut variadic = false;
let args: Vec<Option<Arg>> =
--- /dev/null
+error: unexpected `self` argument in function
+ --> $DIR/bare-fn-start.rs:1:7
+ |
+LL | fn a(&self) { }
+ | ^^^^ `self` is only valid as the first argument of a trait function
+
+error: aborting due to previous error
+
--- /dev/null
+error: unexpected `self` argument in function
+ --> $DIR/bare-fn.rs:1:21
+ |
+LL | fn b(foo: u32, &mut self) { }
+ | ^^^^ `self` is only valid as the first argument of a trait function
+
+error: aborting due to previous error
+
--- /dev/null
+error: unexpected `self` argument in function
+ --> $DIR/trait-fn.rs:4:20
+ |
+LL | fn c(foo: u32, self) {}
+ | ^^^^ `self` is only valid as the first argument of a trait function
+
+error: aborting due to previous error
+