let mut err = self.struct_span_err(self.prev_span,
"unexpected `self` argument in function");
err.span_label(self.prev_span,
- "`self` is only valid as the first argument of a trait function");
+ "`self` is only valid as the first argument of an associated function");
return Err(err);
}
fn a(&self) { }
//~^ ERROR unexpected `self` argument in function
-//~| NOTE `self` is only valid as the first argument of a trait function
+//~| NOTE `self` is only valid as the first argument of an associated function
fn main() { }
--> $DIR/bare-fn-start.rs:1:7
|
LL | fn a(&self) { }
- | ^^^^ `self` is only valid as the first argument of a trait function
+ | ^^^^ `self` is only valid as the first argument of an associated function
error: aborting due to previous error
fn b(foo: u32, &mut self) { }
//~^ ERROR unexpected `self` argument in function
-//~| NOTE `self` is only valid as the first argument of a trait function
+//~| NOTE `self` is only valid as the first argument of an associated function
fn main() { }
--> $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
+ | ^^^^ `self` is only valid as the first argument of an associated function
error: aborting due to previous error
impl Foo {
fn c(foo: u32, self) {}
//~^ ERROR unexpected `self` argument in function
- //~| NOTE `self` is only valid as the first argument of a trait function
+ //~| NOTE `self` is only valid as the first argument of an associated function
fn good(&mut self, foo: u32) {}
}
--> $DIR/trait-fn.rs:4:20
|
LL | fn c(foo: u32, self) {}
- | ^^^^ `self` is only valid as the first argument of a trait function
+ | ^^^^ `self` is only valid as the first argument of an associated function
error: aborting due to previous error