Skip to content

Commit 88d6094

Browse files
committed
improve error note
1 parent 5bfdcc1 commit 88d6094

File tree

7 files changed

+7
-7
lines changed

7 files changed

+7
-7
lines changed

src/libsyntax/parse/parser.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1828,7 +1828,7 @@ impl<'a> Parser<'a> {
18281828
let mut err = self.struct_span_err(self.prev_span,
18291829
"unexpected `self` argument in function");
18301830
err.span_label(self.prev_span,
1831-
"`self` is only valid as the first argument of a trait function");
1831+
"`self` is only valid as the first argument of an associated function");
18321832
return Err(err);
18331833
}
18341834

Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
fn a(&self) { }
22
//~^ ERROR unexpected `self` argument in function
3-
//~| NOTE `self` is only valid as the first argument of a trait function
3+
//~| NOTE `self` is only valid as the first argument of an associated function
44

55
fn main() { }

src/test/ui/invalid-self-argument/bare-fn-start.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error: unexpected `self` argument in function
22
--> $DIR/bare-fn-start.rs:1:7
33
|
44
LL | fn a(&self) { }
5-
| ^^^^ `self` is only valid as the first argument of a trait function
5+
| ^^^^ `self` is only valid as the first argument of an associated function
66

77
error: aborting due to previous error
88

Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
fn b(foo: u32, &mut self) { }
22
//~^ ERROR unexpected `self` argument in function
3-
//~| NOTE `self` is only valid as the first argument of a trait function
3+
//~| NOTE `self` is only valid as the first argument of an associated function
44

55
fn main() { }

src/test/ui/invalid-self-argument/bare-fn.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error: unexpected `self` argument in function
22
--> $DIR/bare-fn.rs:1:21
33
|
44
LL | fn b(foo: u32, &mut self) { }
5-
| ^^^^ `self` is only valid as the first argument of a trait function
5+
| ^^^^ `self` is only valid as the first argument of an associated function
66

77
error: aborting due to previous error
88

src/test/ui/invalid-self-argument/trait-fn.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ struct Foo {}
33
impl Foo {
44
fn c(foo: u32, self) {}
55
//~^ ERROR unexpected `self` argument in function
6-
//~| NOTE `self` is only valid as the first argument of a trait function
6+
//~| NOTE `self` is only valid as the first argument of an associated function
77

88
fn good(&mut self, foo: u32) {}
99
}

src/test/ui/invalid-self-argument/trait-fn.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error: unexpected `self` argument in function
22
--> $DIR/trait-fn.rs:4:20
33
|
44
LL | fn c(foo: u32, self) {}
5-
| ^^^^ `self` is only valid as the first argument of a trait function
5+
| ^^^^ `self` is only valid as the first argument of an associated function
66

77
error: aborting due to previous error
88

0 commit comments

Comments
 (0)