From 51f3b6241df34249c7a8100a5dde75e6ab95533d Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Sat, 20 Oct 2018 23:53:16 +0300 Subject: Move more parsing tests to ui/parser --- src/test/ui/did_you_mean/match-refactor-to-expr.rs | 22 ------------ .../ui/did_you_mean/match-refactor-to-expr.stderr | 13 -------- src/test/ui/issue-10636-1.rs | 20 ----------- src/test/ui/issue-10636-1.stderr | 11 ------ src/test/ui/issue-2354.rs | 26 --------------- src/test/ui/issue-2354.stderr | 16 --------- src/test/ui/parser/bounds-obj-parens.rs | 16 +++++++++ src/test/ui/parser/bounds-obj-parens.stderr | 8 +++++ src/test/ui/parser/impl-parsing.rs | 21 ++++++++++++ src/test/ui/parser/impl-parsing.stderr | 32 ++++++++++++++++++ src/test/ui/parser/issue-10636-1.rs | 20 +++++++++++ src/test/ui/parser/issue-10636-1.stderr | 11 ++++++ src/test/ui/parser/issue-10636-2.rs | 21 ++++++++++++ src/test/ui/parser/issue-10636-2.stderr | 25 ++++++++++++++ src/test/ui/parser/issue-15980.rs | 29 ++++++++++++++++ src/test/ui/parser/issue-15980.stderr | 27 +++++++++++++++ src/test/ui/parser/issue-2354.rs | 26 +++++++++++++++ src/test/ui/parser/issue-2354.stderr | 16 +++++++++ src/test/ui/parser/issue-41155.rs | 15 +++++++++ src/test/ui/parser/issue-41155.stderr | 17 ++++++++++ src/test/ui/parser/macro-incomplete-parse.rs | 39 ++++++++++++++++++++++ src/test/ui/parser/macro-incomplete-parse.stderr | 35 +++++++++++++++++++ src/test/ui/parser/match-refactor-to-expr.rs | 22 ++++++++++++ src/test/ui/parser/match-refactor-to-expr.stderr | 13 ++++++++ src/test/ui/parser/raw/raw-literal-keywords.rs | 23 +++++++++++++ src/test/ui/parser/raw/raw-literal-keywords.stderr | 20 +++++++++++ src/test/ui/parser/raw/raw-literal-self.rs | 15 +++++++++ src/test/ui/parser/raw/raw-literal-self.stderr | 8 +++++ src/test/ui/parser/raw/raw-literal-underscore.rs | 15 +++++++++ .../ui/parser/raw/raw-literal-underscore.stderr | 8 +++++ src/test/ui/parser/raw/raw_string.rs | 14 ++++++++ src/test/ui/parser/raw/raw_string.stderr | 10 ++++++ src/test/ui/parser/trailing-plus-in-bounds.rs | 20 +++++++++++ src/test/ui/parser/trailing-plus-in-bounds.stderr | 8 +++++ src/test/ui/raw/raw-literal-keywords.rs | 23 ------------- src/test/ui/raw/raw-literal-keywords.stderr | 20 ----------- src/test/ui/raw/raw-literal-self.rs | 15 --------- src/test/ui/raw/raw-literal-self.stderr | 8 ----- src/test/ui/raw/raw-literal-underscore.rs | 15 --------- src/test/ui/raw/raw-literal-underscore.stderr | 8 ----- src/test/ui/raw/raw_string.rs | 14 -------- src/test/ui/raw/raw_string.stderr | 10 ------ src/test/ui/span/impl-parsing.rs | 21 ------------ src/test/ui/span/impl-parsing.stderr | 32 ------------------ src/test/ui/token/bounds-obj-parens.rs | 16 --------- src/test/ui/token/bounds-obj-parens.stderr | 8 ----- src/test/ui/token/issue-10636-2.rs | 21 ------------ src/test/ui/token/issue-10636-2.stderr | 25 -------------- src/test/ui/token/issue-15980.rs | 29 ---------------- src/test/ui/token/issue-15980.stderr | 27 --------------- src/test/ui/token/issue-41155.rs | 15 --------- src/test/ui/token/issue-41155.stderr | 17 ---------- src/test/ui/token/macro-incomplete-parse.rs | 39 ---------------------- src/test/ui/token/macro-incomplete-parse.stderr | 35 ------------------- src/test/ui/token/trailing-plus-in-bounds.rs | 20 ----------- src/test/ui/token/trailing-plus-in-bounds.stderr | 8 ----- 56 files changed, 534 insertions(+), 534 deletions(-) delete mode 100644 src/test/ui/did_you_mean/match-refactor-to-expr.rs delete mode 100644 src/test/ui/did_you_mean/match-refactor-to-expr.stderr delete mode 100644 src/test/ui/issue-10636-1.rs delete mode 100644 src/test/ui/issue-10636-1.stderr delete mode 100644 src/test/ui/issue-2354.rs delete mode 100644 src/test/ui/issue-2354.stderr create mode 100644 src/test/ui/parser/bounds-obj-parens.rs create mode 100644 src/test/ui/parser/bounds-obj-parens.stderr create mode 100644 src/test/ui/parser/impl-parsing.rs create mode 100644 src/test/ui/parser/impl-parsing.stderr create mode 100644 src/test/ui/parser/issue-10636-1.rs create mode 100644 src/test/ui/parser/issue-10636-1.stderr create mode 100644 src/test/ui/parser/issue-10636-2.rs create mode 100644 src/test/ui/parser/issue-10636-2.stderr create mode 100644 src/test/ui/parser/issue-15980.rs create mode 100644 src/test/ui/parser/issue-15980.stderr create mode 100644 src/test/ui/parser/issue-2354.rs create mode 100644 src/test/ui/parser/issue-2354.stderr create mode 100644 src/test/ui/parser/issue-41155.rs create mode 100644 src/test/ui/parser/issue-41155.stderr create mode 100644 src/test/ui/parser/macro-incomplete-parse.rs create mode 100644 src/test/ui/parser/macro-incomplete-parse.stderr create mode 100644 src/test/ui/parser/match-refactor-to-expr.rs create mode 100644 src/test/ui/parser/match-refactor-to-expr.stderr create mode 100644 src/test/ui/parser/raw/raw-literal-keywords.rs create mode 100644 src/test/ui/parser/raw/raw-literal-keywords.stderr create mode 100644 src/test/ui/parser/raw/raw-literal-self.rs create mode 100644 src/test/ui/parser/raw/raw-literal-self.stderr create mode 100644 src/test/ui/parser/raw/raw-literal-underscore.rs create mode 100644 src/test/ui/parser/raw/raw-literal-underscore.stderr create mode 100644 src/test/ui/parser/raw/raw_string.rs create mode 100644 src/test/ui/parser/raw/raw_string.stderr create mode 100644 src/test/ui/parser/trailing-plus-in-bounds.rs create mode 100644 src/test/ui/parser/trailing-plus-in-bounds.stderr delete mode 100644 src/test/ui/raw/raw-literal-keywords.rs delete mode 100644 src/test/ui/raw/raw-literal-keywords.stderr delete mode 100644 src/test/ui/raw/raw-literal-self.rs delete mode 100644 src/test/ui/raw/raw-literal-self.stderr delete mode 100644 src/test/ui/raw/raw-literal-underscore.rs delete mode 100644 src/test/ui/raw/raw-literal-underscore.stderr delete mode 100644 src/test/ui/raw/raw_string.rs delete mode 100644 src/test/ui/raw/raw_string.stderr delete mode 100644 src/test/ui/span/impl-parsing.rs delete mode 100644 src/test/ui/span/impl-parsing.stderr delete mode 100644 src/test/ui/token/bounds-obj-parens.rs delete mode 100644 src/test/ui/token/bounds-obj-parens.stderr delete mode 100644 src/test/ui/token/issue-10636-2.rs delete mode 100644 src/test/ui/token/issue-10636-2.stderr delete mode 100644 src/test/ui/token/issue-15980.rs delete mode 100644 src/test/ui/token/issue-15980.stderr delete mode 100644 src/test/ui/token/issue-41155.rs delete mode 100644 src/test/ui/token/issue-41155.stderr delete mode 100644 src/test/ui/token/macro-incomplete-parse.rs delete mode 100644 src/test/ui/token/macro-incomplete-parse.stderr delete mode 100644 src/test/ui/token/trailing-plus-in-bounds.rs delete mode 100644 src/test/ui/token/trailing-plus-in-bounds.stderr (limited to 'src/test') diff --git a/src/test/ui/did_you_mean/match-refactor-to-expr.rs b/src/test/ui/did_you_mean/match-refactor-to-expr.rs deleted file mode 100644 index 3c88608697a..00000000000 --- a/src/test/ui/did_you_mean/match-refactor-to-expr.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// compile-flags: -Z parse-only - -fn main() { - let foo = - match - Some(4).unwrap_or_else(5) - //~^ NOTE expected one of `.`, `?`, `{`, or an operator here - ; //~ NOTE unexpected token - //~^ ERROR expected one of `.`, `?`, `{`, or an operator, found `;` - - println!("{}", foo) -} diff --git a/src/test/ui/did_you_mean/match-refactor-to-expr.stderr b/src/test/ui/did_you_mean/match-refactor-to-expr.stderr deleted file mode 100644 index ecca781684c..00000000000 --- a/src/test/ui/did_you_mean/match-refactor-to-expr.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error: expected one of `.`, `?`, `{`, or an operator, found `;` - --> $DIR/match-refactor-to-expr.rs:18:9 - | -LL | match - | ----- help: try removing this `match` -LL | Some(4).unwrap_or_else(5) - | - expected one of `.`, `?`, `{`, or an operator here -LL | //~^ NOTE expected one of `.`, `?`, `{`, or an operator here -LL | ; //~ NOTE unexpected token - | ^ unexpected token - -error: aborting due to previous error - diff --git a/src/test/ui/issue-10636-1.rs b/src/test/ui/issue-10636-1.rs deleted file mode 100644 index 375b951ee15..00000000000 --- a/src/test/ui/issue-10636-1.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// compile-flags: -Z parse-only - -struct Obj { - //~^ NOTE: un-closed delimiter - member: usize -) -//~^ ERROR incorrect close delimiter -//~| NOTE incorrect close delimiter - -fn main() {} diff --git a/src/test/ui/issue-10636-1.stderr b/src/test/ui/issue-10636-1.stderr deleted file mode 100644 index 49b6d08aff5..00000000000 --- a/src/test/ui/issue-10636-1.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: incorrect close delimiter: `)` - --> $DIR/issue-10636-1.rs:16:1 - | -LL | struct Obj { - | - un-closed delimiter -... -LL | ) - | ^ incorrect close delimiter - -error: aborting due to previous error - diff --git a/src/test/ui/issue-2354.rs b/src/test/ui/issue-2354.rs deleted file mode 100644 index 35fddcb0de4..00000000000 --- a/src/test/ui/issue-2354.rs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// compile-flags: -Z parse-only - -fn foo() { //~ NOTE un-closed delimiter - match Some(x) { - //~^ NOTE this delimiter might not be properly closed... - Some(y) => { panic!(); } - None => { panic!(); } -} -//~^ NOTE ...as it matches this but it has different indentation - -fn bar() { - let mut i = 0; - while (i < 1000) {} -} - -fn main() {} //~ ERROR this file contains an un-closed delimiter diff --git a/src/test/ui/issue-2354.stderr b/src/test/ui/issue-2354.stderr deleted file mode 100644 index 9cf569b685b..00000000000 --- a/src/test/ui/issue-2354.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error: this file contains an un-closed delimiter - --> $DIR/issue-2354.rs:26:66 - | -LL | fn foo() { //~ NOTE un-closed delimiter - | - un-closed delimiter -LL | match Some(x) { - | - this delimiter might not be properly closed... -... -LL | } - | - ...as it matches this but it has different indentation -... -LL | fn main() {} //~ ERROR this file contains an un-closed delimiter - | ^ - -error: aborting due to previous error - diff --git a/src/test/ui/parser/bounds-obj-parens.rs b/src/test/ui/parser/bounds-obj-parens.rs new file mode 100644 index 00000000000..9617df8fa21 --- /dev/null +++ b/src/test/ui/parser/bounds-obj-parens.rs @@ -0,0 +1,16 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// compile-flags: -Z parse-only + +type A = Box<(Fn(D::Error) -> E) + 'static + Send + Sync>; // OK (but see #39318) + +FAIL +//~^ ERROR diff --git a/src/test/ui/parser/bounds-obj-parens.stderr b/src/test/ui/parser/bounds-obj-parens.stderr new file mode 100644 index 00000000000..67dcbc45419 --- /dev/null +++ b/src/test/ui/parser/bounds-obj-parens.stderr @@ -0,0 +1,8 @@ +error: expected one of `!` or `::`, found `` + --> $DIR/bounds-obj-parens.rs:15:1 + | +LL | FAIL + | ^^^^ expected one of `!` or `::` here + +error: aborting due to previous error + diff --git a/src/test/ui/parser/impl-parsing.rs b/src/test/ui/parser/impl-parsing.rs new file mode 100644 index 00000000000..064e3c3ac48 --- /dev/null +++ b/src/test/ui/parser/impl-parsing.rs @@ -0,0 +1,21 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// compile-flags: -Z parse-only -Z continue-parse-after-error + +impl ! {} // OK +impl ! where u8: Copy {} // OK + +impl Trait Type {} //~ ERROR missing `for` in a trait impl +impl Trait .. {} //~ ERROR missing `for` in a trait impl +impl ?Sized for Type {} //~ ERROR expected a trait, found type +impl ?Sized for .. {} //~ ERROR expected a trait, found type + +default unsafe FAIL //~ ERROR expected `impl`, found `FAIL` diff --git a/src/test/ui/parser/impl-parsing.stderr b/src/test/ui/parser/impl-parsing.stderr new file mode 100644 index 00000000000..3cfcf7b7683 --- /dev/null +++ b/src/test/ui/parser/impl-parsing.stderr @@ -0,0 +1,32 @@ +error: missing `for` in a trait impl + --> $DIR/impl-parsing.rs:16:11 + | +LL | impl Trait Type {} //~ ERROR missing `for` in a trait impl + | ^ + +error: missing `for` in a trait impl + --> $DIR/impl-parsing.rs:17:11 + | +LL | impl Trait .. {} //~ ERROR missing `for` in a trait impl + | ^ + +error: expected a trait, found type + --> $DIR/impl-parsing.rs:18:6 + | +LL | impl ?Sized for Type {} //~ ERROR expected a trait, found type + | ^^^^^^ + +error: expected a trait, found type + --> $DIR/impl-parsing.rs:19:6 + | +LL | impl ?Sized for .. {} //~ ERROR expected a trait, found type + | ^^^^^^ + +error: expected `impl`, found `FAIL` + --> $DIR/impl-parsing.rs:21:16 + | +LL | default unsafe FAIL //~ ERROR expected `impl`, found `FAIL` + | ^^^^ expected `impl` here + +error: aborting due to 5 previous errors + diff --git a/src/test/ui/parser/issue-10636-1.rs b/src/test/ui/parser/issue-10636-1.rs new file mode 100644 index 00000000000..375b951ee15 --- /dev/null +++ b/src/test/ui/parser/issue-10636-1.rs @@ -0,0 +1,20 @@ +// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// compile-flags: -Z parse-only + +struct Obj { + //~^ NOTE: un-closed delimiter + member: usize +) +//~^ ERROR incorrect close delimiter +//~| NOTE incorrect close delimiter + +fn main() {} diff --git a/src/test/ui/parser/issue-10636-1.stderr b/src/test/ui/parser/issue-10636-1.stderr new file mode 100644 index 00000000000..49b6d08aff5 --- /dev/null +++ b/src/test/ui/parser/issue-10636-1.stderr @@ -0,0 +1,11 @@ +error: incorrect close delimiter: `)` + --> $DIR/issue-10636-1.rs:16:1 + | +LL | struct Obj { + | - un-closed delimiter +... +LL | ) + | ^ incorrect close delimiter + +error: aborting due to previous error + diff --git a/src/test/ui/parser/issue-10636-2.rs b/src/test/ui/parser/issue-10636-2.rs new file mode 100644 index 00000000000..71180375440 --- /dev/null +++ b/src/test/ui/parser/issue-10636-2.rs @@ -0,0 +1,21 @@ +// Copyright 2013-2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// FIXME(31528) we emit a bunch of silly errors here due to continuing past the +// first one. This would be easy-ish to address by better recovery in tokenisation. + +pub fn trace_option(option: Option) { + option.map(|some| 42; + //~^ ERROR: expected one of + +} //~ ERROR: incorrect close delimiter +//~^ ERROR: expected expression, found `)` + +fn main() {} diff --git a/src/test/ui/parser/issue-10636-2.stderr b/src/test/ui/parser/issue-10636-2.stderr new file mode 100644 index 00000000000..9800b0c5e3f --- /dev/null +++ b/src/test/ui/parser/issue-10636-2.stderr @@ -0,0 +1,25 @@ +error: incorrect close delimiter: `}` + --> $DIR/issue-10636-2.rs:18:1 + | +LL | pub fn trace_option(option: Option) { + | - close delimiter possibly meant for this +LL | option.map(|some| 42; + | - un-closed delimiter +... +LL | } //~ ERROR: incorrect close delimiter + | ^ incorrect close delimiter + +error: expected one of `)`, `,`, `.`, `?`, or an operator, found `;` + --> $DIR/issue-10636-2.rs:15:25 + | +LL | option.map(|some| 42; + | ^ expected one of `)`, `,`, `.`, `?`, or an operator here + +error: expected expression, found `)` + --> $DIR/issue-10636-2.rs:18:1 + | +LL | } //~ ERROR: incorrect close delimiter + | ^ expected expression + +error: aborting due to 3 previous errors + diff --git a/src/test/ui/parser/issue-15980.rs b/src/test/ui/parser/issue-15980.rs new file mode 100644 index 00000000000..e1b134c8203 --- /dev/null +++ b/src/test/ui/parser/issue-15980.rs @@ -0,0 +1,29 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use std::io; + +fn main(){ + let x: io::IoResult<()> = Ok(()); + //~^ ERROR cannot find type `IoResult` in module `io` + //~| NOTE did you mean `Result`? + match x { + Err(ref e) if e.kind == io::EndOfFile { + //~^ NOTE while parsing this struct + return + //~^ ERROR expected identifier, found keyword `return` + //~| NOTE expected identifier, found keyword + } + //~^ NOTE expected one of `.`, `=>`, `?`, or an operator here + _ => {} + //~^ ERROR expected one of `.`, `=>`, `?`, or an operator, found `_` + //~| NOTE unexpected token + } +} diff --git a/src/test/ui/parser/issue-15980.stderr b/src/test/ui/parser/issue-15980.stderr new file mode 100644 index 00000000000..d52368bf96a --- /dev/null +++ b/src/test/ui/parser/issue-15980.stderr @@ -0,0 +1,27 @@ +error: expected identifier, found keyword `return` + --> $DIR/issue-15980.rs:20:13 + | +LL | Err(ref e) if e.kind == io::EndOfFile { + | ------------- while parsing this struct +LL | //~^ NOTE while parsing this struct +LL | return + | ^^^^^^ expected identifier, found keyword + +error: expected one of `.`, `=>`, `?`, or an operator, found `_` + --> $DIR/issue-15980.rs:25:9 + | +LL | } + | - expected one of `.`, `=>`, `?`, or an operator here +LL | //~^ NOTE expected one of `.`, `=>`, `?`, or an operator here +LL | _ => {} + | ^ unexpected token + +error[E0412]: cannot find type `IoResult` in module `io` + --> $DIR/issue-15980.rs:14:16 + | +LL | let x: io::IoResult<()> = Ok(()); + | ^^^^^^^^ did you mean `Result`? + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0412`. diff --git a/src/test/ui/parser/issue-2354.rs b/src/test/ui/parser/issue-2354.rs new file mode 100644 index 00000000000..35fddcb0de4 --- /dev/null +++ b/src/test/ui/parser/issue-2354.rs @@ -0,0 +1,26 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// compile-flags: -Z parse-only + +fn foo() { //~ NOTE un-closed delimiter + match Some(x) { + //~^ NOTE this delimiter might not be properly closed... + Some(y) => { panic!(); } + None => { panic!(); } +} +//~^ NOTE ...as it matches this but it has different indentation + +fn bar() { + let mut i = 0; + while (i < 1000) {} +} + +fn main() {} //~ ERROR this file contains an un-closed delimiter diff --git a/src/test/ui/parser/issue-2354.stderr b/src/test/ui/parser/issue-2354.stderr new file mode 100644 index 00000000000..9cf569b685b --- /dev/null +++ b/src/test/ui/parser/issue-2354.stderr @@ -0,0 +1,16 @@ +error: this file contains an un-closed delimiter + --> $DIR/issue-2354.rs:26:66 + | +LL | fn foo() { //~ NOTE un-closed delimiter + | - un-closed delimiter +LL | match Some(x) { + | - this delimiter might not be properly closed... +... +LL | } + | - ...as it matches this but it has different indentation +... +LL | fn main() {} //~ ERROR this file contains an un-closed delimiter + | ^ + +error: aborting due to previous error + diff --git a/src/test/ui/parser/issue-41155.rs b/src/test/ui/parser/issue-41155.rs new file mode 100644 index 00000000000..7bd8506af90 --- /dev/null +++ b/src/test/ui/parser/issue-41155.rs @@ -0,0 +1,15 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +impl S { //~ ERROR cannot find type + pub +} //~ ERROR expected one of + +fn main() {} diff --git a/src/test/ui/parser/issue-41155.stderr b/src/test/ui/parser/issue-41155.stderr new file mode 100644 index 00000000000..5c1aae29c2f --- /dev/null +++ b/src/test/ui/parser/issue-41155.stderr @@ -0,0 +1,17 @@ +error: expected one of `(`, `async`, `const`, `default`, `existential`, `extern`, `fn`, `type`, or `unsafe`, found `}` + --> $DIR/issue-41155.rs:13:1 + | +LL | pub + | - expected one of 9 possible tokens here +LL | } //~ ERROR expected one of + | ^ unexpected token + +error[E0412]: cannot find type `S` in this scope + --> $DIR/issue-41155.rs:11:6 + | +LL | impl S { //~ ERROR cannot find type + | ^ not found in this scope + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0412`. diff --git a/src/test/ui/parser/macro-incomplete-parse.rs b/src/test/ui/parser/macro-incomplete-parse.rs new file mode 100644 index 00000000000..9b8fdaf9a25 --- /dev/null +++ b/src/test/ui/parser/macro-incomplete-parse.rs @@ -0,0 +1,39 @@ +// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// compile-flags: -Z continue-parse-after-error + +macro_rules! ignored_item { + () => { + fn foo() {} + fn bar() {} + , //~ ERROR macro expansion ignores token `,` + } +} + +macro_rules! ignored_expr { + () => ( 1, //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `,` + + 2 ) +} + +macro_rules! ignored_pat { + () => ( 1, 2 ) //~ ERROR macro expansion ignores token `,` +} + +ignored_item!(); + +fn main() { + ignored_expr!(); + match 1 { + ignored_pat!() => (), + _ => (), + } +} diff --git a/src/test/ui/parser/macro-incomplete-parse.stderr b/src/test/ui/parser/macro-incomplete-parse.stderr new file mode 100644 index 00000000000..198730dc07a --- /dev/null +++ b/src/test/ui/parser/macro-incomplete-parse.stderr @@ -0,0 +1,35 @@ +error: macro expansion ignores token `,` and any following + --> $DIR/macro-incomplete-parse.rs:17:9 + | +LL | , //~ ERROR macro expansion ignores token `,` + | ^ + | +note: caused by the macro expansion here; the usage of `ignored_item!` is likely invalid in item context + --> $DIR/macro-incomplete-parse.rs:31:1 + | +LL | ignored_item!(); + | ^^^^^^^^^^^^^^^^ + +error: expected one of `.`, `;`, `?`, `}`, or an operator, found `,` + --> $DIR/macro-incomplete-parse.rs:22:14 + | +LL | () => ( 1, //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `,` + | ^ expected one of `.`, `;`, `?`, `}`, or an operator here +... +LL | ignored_expr!(); + | ---------------- in this macro invocation + +error: macro expansion ignores token `,` and any following + --> $DIR/macro-incomplete-parse.rs:28:14 + | +LL | () => ( 1, 2 ) //~ ERROR macro expansion ignores token `,` + | ^ + | +note: caused by the macro expansion here; the usage of `ignored_pat!` is likely invalid in pattern context + --> $DIR/macro-incomplete-parse.rs:36:9 + | +LL | ignored_pat!() => (), + | ^^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors + diff --git a/src/test/ui/parser/match-refactor-to-expr.rs b/src/test/ui/parser/match-refactor-to-expr.rs new file mode 100644 index 00000000000..3c88608697a --- /dev/null +++ b/src/test/ui/parser/match-refactor-to-expr.rs @@ -0,0 +1,22 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// compile-flags: -Z parse-only + +fn main() { + let foo = + match + Some(4).unwrap_or_else(5) + //~^ NOTE expected one of `.`, `?`, `{`, or an operator here + ; //~ NOTE unexpected token + //~^ ERROR expected one of `.`, `?`, `{`, or an operator, found `;` + + println!("{}", foo) +} diff --git a/src/test/ui/parser/match-refactor-to-expr.stderr b/src/test/ui/parser/match-refactor-to-expr.stderr new file mode 100644 index 00000000000..ecca781684c --- /dev/null +++ b/src/test/ui/parser/match-refactor-to-expr.stderr @@ -0,0 +1,13 @@ +error: expected one of `.`, `?`, `{`, or an operator, found `;` + --> $DIR/match-refactor-to-expr.rs:18:9 + | +LL | match + | ----- help: try removing this `match` +LL | Some(4).unwrap_or_else(5) + | - expected one of `.`, `?`, `{`, or an operator here +LL | //~^ NOTE expected one of `.`, `?`, `{`, or an operator here +LL | ; //~ NOTE unexpected token + | ^ unexpected token + +error: aborting due to previous error + diff --git a/src/test/ui/parser/raw/raw-literal-keywords.rs b/src/test/ui/parser/raw/raw-literal-keywords.rs new file mode 100644 index 00000000000..f1bfbc95eb3 --- /dev/null +++ b/src/test/ui/parser/raw/raw-literal-keywords.rs @@ -0,0 +1,23 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// compile-flags: -Z parse-only + +fn test_if() { + r#if true { } //~ ERROR found `true` +} + +fn test_struct() { + r#struct Test; //~ ERROR found `Test` +} + +fn test_union() { + r#union Test; //~ ERROR found `Test` +} diff --git a/src/test/ui/parser/raw/raw-literal-keywords.stderr b/src/test/ui/parser/raw/raw-literal-keywords.stderr new file mode 100644 index 00000000000..8a6b91b4b4b --- /dev/null +++ b/src/test/ui/parser/raw/raw-literal-keywords.stderr @@ -0,0 +1,20 @@ +error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `true` + --> $DIR/raw-literal-keywords.rs:14:10 + | +LL | r#if true { } //~ ERROR found `true` + | ^^^^ expected one of 8 possible tokens here + +error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `Test` + --> $DIR/raw-literal-keywords.rs:18:14 + | +LL | r#struct Test; //~ ERROR found `Test` + | ^^^^ expected one of 8 possible tokens here + +error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `Test` + --> $DIR/raw-literal-keywords.rs:22:13 + | +LL | r#union Test; //~ ERROR found `Test` + | ^^^^ expected one of 8 possible tokens here + +error: aborting due to 3 previous errors + diff --git a/src/test/ui/parser/raw/raw-literal-self.rs b/src/test/ui/parser/raw/raw-literal-self.rs new file mode 100644 index 00000000000..17496d767b6 --- /dev/null +++ b/src/test/ui/parser/raw/raw-literal-self.rs @@ -0,0 +1,15 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// compile-flags: -Z parse-only + +fn self_test(r#self: u32) { + //~^ ERROR `r#self` is not currently supported. +} diff --git a/src/test/ui/parser/raw/raw-literal-self.stderr b/src/test/ui/parser/raw/raw-literal-self.stderr new file mode 100644 index 00000000000..f4b75937247 --- /dev/null +++ b/src/test/ui/parser/raw/raw-literal-self.stderr @@ -0,0 +1,8 @@ +error: `r#self` is not currently supported. + --> $DIR/raw-literal-self.rs:13:14 + | +LL | fn self_test(r#self: u32) { + | ^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/parser/raw/raw-literal-underscore.rs b/src/test/ui/parser/raw/raw-literal-underscore.rs new file mode 100644 index 00000000000..ec33e486195 --- /dev/null +++ b/src/test/ui/parser/raw/raw-literal-underscore.rs @@ -0,0 +1,15 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// compile-flags: -Z parse-only + +fn underscore_test(r#_: u32) { + //~^ ERROR `r#_` is not currently supported. +} diff --git a/src/test/ui/parser/raw/raw-literal-underscore.stderr b/src/test/ui/parser/raw/raw-literal-underscore.stderr new file mode 100644 index 00000000000..8072eee4f06 --- /dev/null +++ b/src/test/ui/parser/raw/raw-literal-underscore.stderr @@ -0,0 +1,8 @@ +error: `r#_` is not currently supported. + --> $DIR/raw-literal-underscore.rs:13:20 + | +LL | fn underscore_test(r#_: u32) { + | ^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/parser/raw/raw_string.rs b/src/test/ui/parser/raw/raw_string.rs new file mode 100644 index 00000000000..f1eb91d44fd --- /dev/null +++ b/src/test/ui/parser/raw/raw_string.rs @@ -0,0 +1,14 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + let x = r##"lol"#; + //~^ ERROR unterminated raw string +} diff --git a/src/test/ui/parser/raw/raw_string.stderr b/src/test/ui/parser/raw/raw_string.stderr new file mode 100644 index 00000000000..ddf1cfe406f --- /dev/null +++ b/src/test/ui/parser/raw/raw_string.stderr @@ -0,0 +1,10 @@ +error: unterminated raw string + --> $DIR/raw_string.rs:12:13 + | +LL | let x = r##"lol"#; + | ^ unterminated raw string + | + = note: this raw string should be terminated with `"##` + +error: aborting due to previous error + diff --git a/src/test/ui/parser/trailing-plus-in-bounds.rs b/src/test/ui/parser/trailing-plus-in-bounds.rs new file mode 100644 index 00000000000..72cae6abc2d --- /dev/null +++ b/src/test/ui/parser/trailing-plus-in-bounds.rs @@ -0,0 +1,20 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// compile-flags: -Z parse-only -Z continue-parse-after-error + +use std::fmt::Debug; + +fn main() { + let x: Box = box 3 as Box; // Trailing `+` is OK +} + +FAIL +//~^ ERROR diff --git a/src/test/ui/parser/trailing-plus-in-bounds.stderr b/src/test/ui/parser/trailing-plus-in-bounds.stderr new file mode 100644 index 00000000000..1719b1d5e08 --- /dev/null +++ b/src/test/ui/parser/trailing-plus-in-bounds.stderr @@ -0,0 +1,8 @@ +error: expected one of `!` or `::`, found `` + --> $DIR/trailing-plus-in-bounds.rs:19:1 + | +LL | FAIL + | ^^^^ expected one of `!` or `::` here + +error: aborting due to previous error + diff --git a/src/test/ui/raw/raw-literal-keywords.rs b/src/test/ui/raw/raw-literal-keywords.rs deleted file mode 100644 index f1bfbc95eb3..00000000000 --- a/src/test/ui/raw/raw-literal-keywords.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2018 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// compile-flags: -Z parse-only - -fn test_if() { - r#if true { } //~ ERROR found `true` -} - -fn test_struct() { - r#struct Test; //~ ERROR found `Test` -} - -fn test_union() { - r#union Test; //~ ERROR found `Test` -} diff --git a/src/test/ui/raw/raw-literal-keywords.stderr b/src/test/ui/raw/raw-literal-keywords.stderr deleted file mode 100644 index 8a6b91b4b4b..00000000000 --- a/src/test/ui/raw/raw-literal-keywords.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `true` - --> $DIR/raw-literal-keywords.rs:14:10 - | -LL | r#if true { } //~ ERROR found `true` - | ^^^^ expected one of 8 possible tokens here - -error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `Test` - --> $DIR/raw-literal-keywords.rs:18:14 - | -LL | r#struct Test; //~ ERROR found `Test` - | ^^^^ expected one of 8 possible tokens here - -error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `Test` - --> $DIR/raw-literal-keywords.rs:22:13 - | -LL | r#union Test; //~ ERROR found `Test` - | ^^^^ expected one of 8 possible tokens here - -error: aborting due to 3 previous errors - diff --git a/src/test/ui/raw/raw-literal-self.rs b/src/test/ui/raw/raw-literal-self.rs deleted file mode 100644 index 17496d767b6..00000000000 --- a/src/test/ui/raw/raw-literal-self.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2018 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// compile-flags: -Z parse-only - -fn self_test(r#self: u32) { - //~^ ERROR `r#self` is not currently supported. -} diff --git a/src/test/ui/raw/raw-literal-self.stderr b/src/test/ui/raw/raw-literal-self.stderr deleted file mode 100644 index f4b75937247..00000000000 --- a/src/test/ui/raw/raw-literal-self.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: `r#self` is not currently supported. - --> $DIR/raw-literal-self.rs:13:14 - | -LL | fn self_test(r#self: u32) { - | ^^^^^^ - -error: aborting due to previous error - diff --git a/src/test/ui/raw/raw-literal-underscore.rs b/src/test/ui/raw/raw-literal-underscore.rs deleted file mode 100644 index ec33e486195..00000000000 --- a/src/test/ui/raw/raw-literal-underscore.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2018 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// compile-flags: -Z parse-only - -fn underscore_test(r#_: u32) { - //~^ ERROR `r#_` is not currently supported. -} diff --git a/src/test/ui/raw/raw-literal-underscore.stderr b/src/test/ui/raw/raw-literal-underscore.stderr deleted file mode 100644 index 8072eee4f06..00000000000 --- a/src/test/ui/raw/raw-literal-underscore.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: `r#_` is not currently supported. - --> $DIR/raw-literal-underscore.rs:13:20 - | -LL | fn underscore_test(r#_: u32) { - | ^^^ - -error: aborting due to previous error - diff --git a/src/test/ui/raw/raw_string.rs b/src/test/ui/raw/raw_string.rs deleted file mode 100644 index f1eb91d44fd..00000000000 --- a/src/test/ui/raw/raw_string.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2018 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - let x = r##"lol"#; - //~^ ERROR unterminated raw string -} diff --git a/src/test/ui/raw/raw_string.stderr b/src/test/ui/raw/raw_string.stderr deleted file mode 100644 index ddf1cfe406f..00000000000 --- a/src/test/ui/raw/raw_string.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: unterminated raw string - --> $DIR/raw_string.rs:12:13 - | -LL | let x = r##"lol"#; - | ^ unterminated raw string - | - = note: this raw string should be terminated with `"##` - -error: aborting due to previous error - diff --git a/src/test/ui/span/impl-parsing.rs b/src/test/ui/span/impl-parsing.rs deleted file mode 100644 index 064e3c3ac48..00000000000 --- a/src/test/ui/span/impl-parsing.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// compile-flags: -Z parse-only -Z continue-parse-after-error - -impl ! {} // OK -impl ! where u8: Copy {} // OK - -impl Trait Type {} //~ ERROR missing `for` in a trait impl -impl Trait .. {} //~ ERROR missing `for` in a trait impl -impl ?Sized for Type {} //~ ERROR expected a trait, found type -impl ?Sized for .. {} //~ ERROR expected a trait, found type - -default unsafe FAIL //~ ERROR expected `impl`, found `FAIL` diff --git a/src/test/ui/span/impl-parsing.stderr b/src/test/ui/span/impl-parsing.stderr deleted file mode 100644 index 3cfcf7b7683..00000000000 --- a/src/test/ui/span/impl-parsing.stderr +++ /dev/null @@ -1,32 +0,0 @@ -error: missing `for` in a trait impl - --> $DIR/impl-parsing.rs:16:11 - | -LL | impl Trait Type {} //~ ERROR missing `for` in a trait impl - | ^ - -error: missing `for` in a trait impl - --> $DIR/impl-parsing.rs:17:11 - | -LL | impl Trait .. {} //~ ERROR missing `for` in a trait impl - | ^ - -error: expected a trait, found type - --> $DIR/impl-parsing.rs:18:6 - | -LL | impl ?Sized for Type {} //~ ERROR expected a trait, found type - | ^^^^^^ - -error: expected a trait, found type - --> $DIR/impl-parsing.rs:19:6 - | -LL | impl ?Sized for .. {} //~ ERROR expected a trait, found type - | ^^^^^^ - -error: expected `impl`, found `FAIL` - --> $DIR/impl-parsing.rs:21:16 - | -LL | default unsafe FAIL //~ ERROR expected `impl`, found `FAIL` - | ^^^^ expected `impl` here - -error: aborting due to 5 previous errors - diff --git a/src/test/ui/token/bounds-obj-parens.rs b/src/test/ui/token/bounds-obj-parens.rs deleted file mode 100644 index 9617df8fa21..00000000000 --- a/src/test/ui/token/bounds-obj-parens.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// compile-flags: -Z parse-only - -type A = Box<(Fn(D::Error) -> E) + 'static + Send + Sync>; // OK (but see #39318) - -FAIL -//~^ ERROR diff --git a/src/test/ui/token/bounds-obj-parens.stderr b/src/test/ui/token/bounds-obj-parens.stderr deleted file mode 100644 index 67dcbc45419..00000000000 --- a/src/test/ui/token/bounds-obj-parens.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: expected one of `!` or `::`, found `` - --> $DIR/bounds-obj-parens.rs:15:1 - | -LL | FAIL - | ^^^^ expected one of `!` or `::` here - -error: aborting due to previous error - diff --git a/src/test/ui/token/issue-10636-2.rs b/src/test/ui/token/issue-10636-2.rs deleted file mode 100644 index 71180375440..00000000000 --- a/src/test/ui/token/issue-10636-2.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2013-2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// FIXME(31528) we emit a bunch of silly errors here due to continuing past the -// first one. This would be easy-ish to address by better recovery in tokenisation. - -pub fn trace_option(option: Option) { - option.map(|some| 42; - //~^ ERROR: expected one of - -} //~ ERROR: incorrect close delimiter -//~^ ERROR: expected expression, found `)` - -fn main() {} diff --git a/src/test/ui/token/issue-10636-2.stderr b/src/test/ui/token/issue-10636-2.stderr deleted file mode 100644 index 9800b0c5e3f..00000000000 --- a/src/test/ui/token/issue-10636-2.stderr +++ /dev/null @@ -1,25 +0,0 @@ -error: incorrect close delimiter: `}` - --> $DIR/issue-10636-2.rs:18:1 - | -LL | pub fn trace_option(option: Option) { - | - close delimiter possibly meant for this -LL | option.map(|some| 42; - | - un-closed delimiter -... -LL | } //~ ERROR: incorrect close delimiter - | ^ incorrect close delimiter - -error: expected one of `)`, `,`, `.`, `?`, or an operator, found `;` - --> $DIR/issue-10636-2.rs:15:25 - | -LL | option.map(|some| 42; - | ^ expected one of `)`, `,`, `.`, `?`, or an operator here - -error: expected expression, found `)` - --> $DIR/issue-10636-2.rs:18:1 - | -LL | } //~ ERROR: incorrect close delimiter - | ^ expected expression - -error: aborting due to 3 previous errors - diff --git a/src/test/ui/token/issue-15980.rs b/src/test/ui/token/issue-15980.rs deleted file mode 100644 index e1b134c8203..00000000000 --- a/src/test/ui/token/issue-15980.rs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2018 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use std::io; - -fn main(){ - let x: io::IoResult<()> = Ok(()); - //~^ ERROR cannot find type `IoResult` in module `io` - //~| NOTE did you mean `Result`? - match x { - Err(ref e) if e.kind == io::EndOfFile { - //~^ NOTE while parsing this struct - return - //~^ ERROR expected identifier, found keyword `return` - //~| NOTE expected identifier, found keyword - } - //~^ NOTE expected one of `.`, `=>`, `?`, or an operator here - _ => {} - //~^ ERROR expected one of `.`, `=>`, `?`, or an operator, found `_` - //~| NOTE unexpected token - } -} diff --git a/src/test/ui/token/issue-15980.stderr b/src/test/ui/token/issue-15980.stderr deleted file mode 100644 index d52368bf96a..00000000000 --- a/src/test/ui/token/issue-15980.stderr +++ /dev/null @@ -1,27 +0,0 @@ -error: expected identifier, found keyword `return` - --> $DIR/issue-15980.rs:20:13 - | -LL | Err(ref e) if e.kind == io::EndOfFile { - | ------------- while parsing this struct -LL | //~^ NOTE while parsing this struct -LL | return - | ^^^^^^ expected identifier, found keyword - -error: expected one of `.`, `=>`, `?`, or an operator, found `_` - --> $DIR/issue-15980.rs:25:9 - | -LL | } - | - expected one of `.`, `=>`, `?`, or an operator here -LL | //~^ NOTE expected one of `.`, `=>`, `?`, or an operator here -LL | _ => {} - | ^ unexpected token - -error[E0412]: cannot find type `IoResult` in module `io` - --> $DIR/issue-15980.rs:14:16 - | -LL | let x: io::IoResult<()> = Ok(()); - | ^^^^^^^^ did you mean `Result`? - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0412`. diff --git a/src/test/ui/token/issue-41155.rs b/src/test/ui/token/issue-41155.rs deleted file mode 100644 index 7bd8506af90..00000000000 --- a/src/test/ui/token/issue-41155.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -impl S { //~ ERROR cannot find type - pub -} //~ ERROR expected one of - -fn main() {} diff --git a/src/test/ui/token/issue-41155.stderr b/src/test/ui/token/issue-41155.stderr deleted file mode 100644 index 5c1aae29c2f..00000000000 --- a/src/test/ui/token/issue-41155.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error: expected one of `(`, `async`, `const`, `default`, `existential`, `extern`, `fn`, `type`, or `unsafe`, found `}` - --> $DIR/issue-41155.rs:13:1 - | -LL | pub - | - expected one of 9 possible tokens here -LL | } //~ ERROR expected one of - | ^ unexpected token - -error[E0412]: cannot find type `S` in this scope - --> $DIR/issue-41155.rs:11:6 - | -LL | impl S { //~ ERROR cannot find type - | ^ not found in this scope - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0412`. diff --git a/src/test/ui/token/macro-incomplete-parse.rs b/src/test/ui/token/macro-incomplete-parse.rs deleted file mode 100644 index 9b8fdaf9a25..00000000000 --- a/src/test/ui/token/macro-incomplete-parse.rs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// compile-flags: -Z continue-parse-after-error - -macro_rules! ignored_item { - () => { - fn foo() {} - fn bar() {} - , //~ ERROR macro expansion ignores token `,` - } -} - -macro_rules! ignored_expr { - () => ( 1, //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `,` - - 2 ) -} - -macro_rules! ignored_pat { - () => ( 1, 2 ) //~ ERROR macro expansion ignores token `,` -} - -ignored_item!(); - -fn main() { - ignored_expr!(); - match 1 { - ignored_pat!() => (), - _ => (), - } -} diff --git a/src/test/ui/token/macro-incomplete-parse.stderr b/src/test/ui/token/macro-incomplete-parse.stderr deleted file mode 100644 index 198730dc07a..00000000000 --- a/src/test/ui/token/macro-incomplete-parse.stderr +++ /dev/null @@ -1,35 +0,0 @@ -error: macro expansion ignores token `,` and any following - --> $DIR/macro-incomplete-parse.rs:17:9 - | -LL | , //~ ERROR macro expansion ignores token `,` - | ^ - | -note: caused by the macro expansion here; the usage of `ignored_item!` is likely invalid in item context - --> $DIR/macro-incomplete-parse.rs:31:1 - | -LL | ignored_item!(); - | ^^^^^^^^^^^^^^^^ - -error: expected one of `.`, `;`, `?`, `}`, or an operator, found `,` - --> $DIR/macro-incomplete-parse.rs:22:14 - | -LL | () => ( 1, //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `,` - | ^ expected one of `.`, `;`, `?`, `}`, or an operator here -... -LL | ignored_expr!(); - | ---------------- in this macro invocation - -error: macro expansion ignores token `,` and any following - --> $DIR/macro-incomplete-parse.rs:28:14 - | -LL | () => ( 1, 2 ) //~ ERROR macro expansion ignores token `,` - | ^ - | -note: caused by the macro expansion here; the usage of `ignored_pat!` is likely invalid in pattern context - --> $DIR/macro-incomplete-parse.rs:36:9 - | -LL | ignored_pat!() => (), - | ^^^^^^^^^^^^^^ - -error: aborting due to 3 previous errors - diff --git a/src/test/ui/token/trailing-plus-in-bounds.rs b/src/test/ui/token/trailing-plus-in-bounds.rs deleted file mode 100644 index 72cae6abc2d..00000000000 --- a/src/test/ui/token/trailing-plus-in-bounds.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// compile-flags: -Z parse-only -Z continue-parse-after-error - -use std::fmt::Debug; - -fn main() { - let x: Box = box 3 as Box; // Trailing `+` is OK -} - -FAIL -//~^ ERROR diff --git a/src/test/ui/token/trailing-plus-in-bounds.stderr b/src/test/ui/token/trailing-plus-in-bounds.stderr deleted file mode 100644 index 1719b1d5e08..00000000000 --- a/src/test/ui/token/trailing-plus-in-bounds.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: expected one of `!` or `::`, found `` - --> $DIR/trailing-plus-in-bounds.rs:19:1 - | -LL | FAIL - | ^^^^ expected one of `!` or `::` here - -error: aborting due to previous error - -- cgit 1.4.1-3-g733a5