From 64c0efab85ba0fa131a33e4d5bd8189fa1159a75 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Sun, 21 Oct 2018 00:02:06 +0300 Subject: [PATCH] Make some ui/parser tests compile-pass --- src/test/ui/parser/bounds-obj-parens.rs | 4 +--- src/test/ui/parser/bounds-obj-parens.stderr | 8 -------- src/test/ui/parser/impl-qpath.rs | 3 +-- src/test/ui/parser/impl-qpath.stderr | 8 -------- src/test/ui/parser/trailing-plus-in-bounds.rs | 4 +--- src/test/ui/parser/trailing-plus-in-bounds.stderr | 8 -------- src/test/ui/parser/trait-object-trait-parens.rs | 3 +-- src/test/ui/parser/trait-object-trait-parens.stderr | 8 -------- src/test/ui/parser/trait-plusequal-splitting.rs | 9 ++++----- src/test/ui/parser/trait-plusequal-splitting.stderr | 8 -------- src/test/ui/parser/underscore-suffix-for-string.rs | 6 ++---- src/test/ui/parser/underscore-suffix-for-string.stderr | 10 +--------- 12 files changed, 11 insertions(+), 68 deletions(-) delete mode 100644 src/test/ui/parser/bounds-obj-parens.stderr delete mode 100644 src/test/ui/parser/impl-qpath.stderr delete mode 100644 src/test/ui/parser/trailing-plus-in-bounds.stderr delete mode 100644 src/test/ui/parser/trait-object-trait-parens.stderr delete mode 100644 src/test/ui/parser/trait-plusequal-splitting.stderr diff --git a/src/test/ui/parser/bounds-obj-parens.rs b/src/test/ui/parser/bounds-obj-parens.rs index 9617df8fa21a..7b47bbd951ed 100644 --- a/src/test/ui/parser/bounds-obj-parens.rs +++ b/src/test/ui/parser/bounds-obj-parens.rs @@ -8,9 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// compile-pass // 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 deleted file mode 100644 index 67dcbc454194..000000000000 --- a/src/test/ui/parser/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/parser/impl-qpath.rs b/src/test/ui/parser/impl-qpath.rs index 48dd888b2e53..5dced73c90d4 100644 --- a/src/test/ui/parser/impl-qpath.rs +++ b/src/test/ui/parser/impl-qpath.rs @@ -8,11 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// compile-pass // compile-flags: -Z parse-only impl <*const u8>::AssocTy {} // OK impl ::AssocTy {} // OK impl <'a + Trait>::AssocTy {} // OK impl <::AssocTy>::AssocTy {} // OK - -FAIL //~ ERROR diff --git a/src/test/ui/parser/impl-qpath.stderr b/src/test/ui/parser/impl-qpath.stderr deleted file mode 100644 index 38a28f9001da..000000000000 --- a/src/test/ui/parser/impl-qpath.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: expected one of `!` or `::`, found `` - --> $DIR/impl-qpath.rs:18:1 - | -LL | FAIL //~ ERROR - | ^^^^ expected one of `!` or `::` here - -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 index 72cae6abc2db..b0dda815f830 100644 --- a/src/test/ui/parser/trailing-plus-in-bounds.rs +++ b/src/test/ui/parser/trailing-plus-in-bounds.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// compile-pass // compile-flags: -Z parse-only -Z continue-parse-after-error use std::fmt::Debug; @@ -15,6 +16,3 @@ 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 deleted file mode 100644 index 1719b1d5e08a..000000000000 --- a/src/test/ui/parser/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 - diff --git a/src/test/ui/parser/trait-object-trait-parens.rs b/src/test/ui/parser/trait-object-trait-parens.rs index dc44f4f3fb13..1feb0c84532a 100644 --- a/src/test/ui/parser/trait-object-trait-parens.rs +++ b/src/test/ui/parser/trait-object-trait-parens.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// compile-pass // compile-flags: -Z parse-only fn f Trait<'a>)>() {} @@ -17,5 +18,3 @@ fn main() { let _: Box<(?Sized) + (for<'a> Trait<'a>) + (Copy)>; let _: Box<(for<'a> Trait<'a>) + (Copy) + (?Sized)>; } - -FAIL //~ ERROR diff --git a/src/test/ui/parser/trait-object-trait-parens.stderr b/src/test/ui/parser/trait-object-trait-parens.stderr deleted file mode 100644 index 27f13d77876b..000000000000 --- a/src/test/ui/parser/trait-object-trait-parens.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: expected one of `!` or `::`, found `` - --> $DIR/trait-object-trait-parens.rs:21:1 - | -LL | FAIL //~ ERROR - | ^^^^ expected one of `!` or `::` here - -error: aborting due to previous error - diff --git a/src/test/ui/parser/trait-plusequal-splitting.rs b/src/test/ui/parser/trait-plusequal-splitting.rs index cbb955fe61d0..32174d6254a9 100644 --- a/src/test/ui/parser/trait-plusequal-splitting.rs +++ b/src/test/ui/parser/trait-plusequal-splitting.rs @@ -8,13 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// compile-flags: -Z parse-only // Fixes issue where `+` in generics weren't parsed if they were part of a `+=`. +// compile-pass +// compile-flags: -Z parse-only + struct Whitespace { t: T } struct TokenSplit { t: T } -fn main() { -} - -FAIL //~ ERROR +fn main() {} diff --git a/src/test/ui/parser/trait-plusequal-splitting.stderr b/src/test/ui/parser/trait-plusequal-splitting.stderr deleted file mode 100644 index 266473ed222a..000000000000 --- a/src/test/ui/parser/trait-plusequal-splitting.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: expected one of `!` or `::`, found `` - --> $DIR/trait-plusequal-splitting.rs:20:1 - | -LL | FAIL //~ ERROR - | ^^^^ expected one of `!` or `::` here - -error: aborting due to previous error - diff --git a/src/test/ui/parser/underscore-suffix-for-string.rs b/src/test/ui/parser/underscore-suffix-for-string.rs index 05de5f8e1941..6917134c5f7e 100644 --- a/src/test/ui/parser/underscore-suffix-for-string.rs +++ b/src/test/ui/parser/underscore-suffix-for-string.rs @@ -8,13 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// compile-pass + fn main() { let _ = "Foo"_; //~^ WARNING underscore literal suffix is not allowed //~| WARNING this was previously accepted //~| NOTE issue #42326 } - -FAIL -//~^ ERROR -//~| NOTE diff --git a/src/test/ui/parser/underscore-suffix-for-string.stderr b/src/test/ui/parser/underscore-suffix-for-string.stderr index b20fd2990217..5455588cf17a 100644 --- a/src/test/ui/parser/underscore-suffix-for-string.stderr +++ b/src/test/ui/parser/underscore-suffix-for-string.stderr @@ -1,5 +1,5 @@ warning: underscore literal suffix is not allowed - --> $DIR/underscore-suffix-for-string.rs:12:18 + --> $DIR/underscore-suffix-for-string.rs:14:18 | LL | let _ = "Foo"_; | ^ @@ -7,11 +7,3 @@ LL | let _ = "Foo"_; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #42326 -error: expected one of `!` or `::`, found `` - --> $DIR/underscore-suffix-for-string.rs:18:1 - | -LL | FAIL - | ^^^^ expected one of `!` or `::` here - -error: aborting due to previous error -