]> git.lizzy.rs Git - rust.git/commitdiff
improve error note
authorAxary <bastian_kauschke@hotmail.de>
Tue, 20 Nov 2018 13:43:16 +0000 (14:43 +0100)
committerAxary <bastian_kauschke@hotmail.de>
Tue, 20 Nov 2018 13:43:16 +0000 (14:43 +0100)
src/libsyntax/parse/parser.rs
src/test/ui/invalid-self-argument/bare-fn-start.rs
src/test/ui/invalid-self-argument/bare-fn-start.stderr
src/test/ui/invalid-self-argument/bare-fn.rs
src/test/ui/invalid-self-argument/bare-fn.stderr
src/test/ui/invalid-self-argument/trait-fn.rs
src/test/ui/invalid-self-argument/trait-fn.stderr

index 18929af4718fe0d8f4029ce3f43fb01b9a5906d6..e4a4c1f5a7ccb8b356d7fa561f1eb0d55636e5e6 100644 (file)
@@ -1828,7 +1828,7 @@ fn parse_arg_general(&mut self, require_name: bool) -> PResult<'a, Arg> {
             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);
         }
 
index a84fe55502dc14e4e86e0719051f575d46416a49..741ba5f41ce16b9caf72e7b40a58bf226f86f64d 100644 (file)
@@ -1,5 +1,5 @@
 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() { }
index d0eca1a9e5ce17ceb12c88eef88c3a1d6be8933f..6a878b619d813651d91fa60bb63c34c1481ce960 100644 (file)
@@ -2,7 +2,7 @@ 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
+   |       ^^^^ `self` is only valid as the first argument of an associated function
 
 error: aborting due to previous error
 
index 27e56a537139f933e009e14034438730fbecff28..704fa996ca631a73fe1b3333ce1eae9406cbac02 100644 (file)
@@ -1,5 +1,5 @@
 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() { }
index bd6c598c88a0bcceea7376d6d707f430fc35f236..b13f746a4ec584a5bc3e2b62bc0de418247a8bbb 100644 (file)
@@ -2,7 +2,7 @@ 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
+   |                     ^^^^ `self` is only valid as the first argument of an associated function
 
 error: aborting due to previous error
 
index e2107e4d8676dc4ebc3d5be6aebe19e641b4c3a3..31e867bc7641f4f263374b28e4814a5a39c6b4ef 100644 (file)
@@ -3,7 +3,7 @@ struct Foo {}
 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) {}
 }
index d056e53b95c72ddaf97c71ef92ccdfe2ac486ea1..b3c2cc5b5ebe0874e1f222f695c4b3f0733f5c89 100644 (file)
@@ -2,7 +2,7 @@ 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
+   |                    ^^^^ `self` is only valid as the first argument of an associated function
 
 error: aborting due to previous error