]> git.lizzy.rs Git - rust.git/commitdiff
fix tidy (remove whitespace)
authorAxary <bastian_kauschke@hotmail.de>
Fri, 16 Nov 2018 18:35:13 +0000 (19:35 +0100)
committerAxary <bastian_kauschke@hotmail.de>
Fri, 16 Nov 2018 18:35:13 +0000 (19:35 +0100)
src/libsyntax/parse/parser.rs
src/test/ui/invalid-self-argument/bare-fn-start.stderr [new file with mode: 0644]
src/test/ui/invalid-self-argument/bare-fn.stderr [new file with mode: 0644]
src/test/ui/invalid-self-argument/trait-fn.stderr [new file with mode: 0644]

index a4b01f485d38b8235546f1cc56b03f9ea062d8cb..18929af4718fe0d8f4029ce3f43fb01b9a5906d6 100644 (file)
@@ -5394,7 +5394,7 @@ fn parse_where_clause(&mut self) -> PResult<'a, WhereClause> {
     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>> =
diff --git a/src/test/ui/invalid-self-argument/bare-fn-start.stderr b/src/test/ui/invalid-self-argument/bare-fn-start.stderr
new file mode 100644 (file)
index 0000000..d0eca1a
--- /dev/null
@@ -0,0 +1,8 @@
+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
+
diff --git a/src/test/ui/invalid-self-argument/bare-fn.stderr b/src/test/ui/invalid-self-argument/bare-fn.stderr
new file mode 100644 (file)
index 0000000..bd6c598
--- /dev/null
@@ -0,0 +1,8 @@
+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
+
diff --git a/src/test/ui/invalid-self-argument/trait-fn.stderr b/src/test/ui/invalid-self-argument/trait-fn.stderr
new file mode 100644 (file)
index 0000000..d056e53
--- /dev/null
@@ -0,0 +1,8 @@
+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
+