Skip to content

Commit

Permalink
Make some ui/parser tests compile-pass
Browse files Browse the repository at this point in the history
  • Loading branch information
petrochenkov committed Oct 21, 2018
1 parent 51f3b62 commit 64c0efa
Show file tree
Hide file tree
Showing 12 changed files with 11 additions and 68 deletions.
4 changes: 1 addition & 3 deletions src/test/ui/parser/bounds-obj-parens.rs
Expand Up @@ -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
8 changes: 0 additions & 8 deletions src/test/ui/parser/bounds-obj-parens.stderr

This file was deleted.

3 changes: 1 addition & 2 deletions src/test/ui/parser/impl-qpath.rs
Expand Up @@ -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 <Type as Trait>::AssocTy {} // OK
impl <'a + Trait>::AssocTy {} // OK
impl <<Type>::AssocTy>::AssocTy {} // OK

FAIL //~ ERROR
8 changes: 0 additions & 8 deletions src/test/ui/parser/impl-qpath.stderr

This file was deleted.

4 changes: 1 addition & 3 deletions src/test/ui/parser/trailing-plus-in-bounds.rs
Expand Up @@ -8,13 +8,11 @@
// 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;

fn main() {
let x: Box<Debug+> = box 3 as Box<Debug+>; // Trailing `+` is OK
}

FAIL
//~^ ERROR
8 changes: 0 additions & 8 deletions src/test/ui/parser/trailing-plus-in-bounds.stderr

This file was deleted.

3 changes: 1 addition & 2 deletions src/test/ui/parser/trait-object-trait-parens.rs
Expand Up @@ -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<T: (Copy) + (?Sized) + (for<'a> Trait<'a>)>() {}
Expand All @@ -17,5 +18,3 @@ fn main() {
let _: Box<(?Sized) + (for<'a> Trait<'a>) + (Copy)>;
let _: Box<(for<'a> Trait<'a>) + (Copy) + (?Sized)>;
}

FAIL //~ ERROR
8 changes: 0 additions & 8 deletions src/test/ui/parser/trait-object-trait-parens.stderr

This file was deleted.

9 changes: 4 additions & 5 deletions src/test/ui/parser/trait-plusequal-splitting.rs
Expand Up @@ -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: Clone + = ()> { t: T }
struct TokenSplit<T: Clone += ()> { t: T }

fn main() {
}

FAIL //~ ERROR
fn main() {}
8 changes: 0 additions & 8 deletions src/test/ui/parser/trait-plusequal-splitting.stderr

This file was deleted.

6 changes: 2 additions & 4 deletions src/test/ui/parser/underscore-suffix-for-string.rs
Expand Up @@ -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
10 changes: 1 addition & 9 deletions src/test/ui/parser/underscore-suffix-for-string.stderr
@@ -1,17 +1,9 @@
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"_;
| ^
|
= 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 <https://github.com/rust-lang/rust/issues/42326>

error: expected one of `!` or `::`, found `<eof>`
--> $DIR/underscore-suffix-for-string.rs:18:1
|
LL | FAIL
| ^^^^ expected one of `!` or `::` here

error: aborting due to previous error

0 comments on commit 64c0efa

Please sign in to comment.