diff options
| author | Axary <bastian_kauschke@hotmail.de> | 2018-11-16 19:35:13 +0100 |
|---|---|---|
| committer | Axary <bastian_kauschke@hotmail.de> | 2018-11-16 19:35:13 +0100 |
| commit | 2be930bd03d3c9b9230ae3b9cc8fc30b83378900 (patch) | |
| tree | 0960bfdfd061292aca353a330d7c8a83ff2dc144 | |
| parent | fe23ffbda01d2033c98ec6cec7f51cb08f625ec9 (diff) | |
| download | rust-2be930bd03d3c9b9230ae3b9cc8fc30b83378900.tar.gz rust-2be930bd03d3c9b9230ae3b9cc8fc30b83378900.zip | |
fix tidy (remove whitespace)
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/invalid-self-argument/bare-fn-start.stderr | 8 | ||||
| -rw-r--r-- | src/test/ui/invalid-self-argument/bare-fn.stderr | 8 | ||||
| -rw-r--r-- | src/test/ui/invalid-self-argument/trait-fn.stderr | 8 |
4 files changed, 25 insertions, 1 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index a4b01f485d3..18929af4718 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -5394,7 +5394,7 @@ impl<'a> Parser<'a> { 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 index 00000000000..d0eca1a9e5c --- /dev/null +++ b/src/test/ui/invalid-self-argument/bare-fn-start.stderr @@ -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 index 00000000000..bd6c598c88a --- /dev/null +++ b/src/test/ui/invalid-self-argument/bare-fn.stderr @@ -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 index 00000000000..d056e53b95c --- /dev/null +++ b/src/test/ui/invalid-self-argument/trait-fn.stderr @@ -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 + |
