Skip to content

Commit 64c0efa

Browse files
committed
Make some ui/parser tests compile-pass
1 parent 51f3b62 commit 64c0efa

12 files changed

+11
-68
lines changed

src/test/ui/parser/bounds-obj-parens.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// compile-pass
1112
// compile-flags: -Z parse-only
1213

1314
type A = Box<(Fn(D::Error) -> E) + 'static + Send + Sync>; // OK (but see #39318)
14-
15-
FAIL
16-
//~^ ERROR

src/test/ui/parser/bounds-obj-parens.stderr

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/test/ui/parser/impl-qpath.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// compile-pass
1112
// compile-flags: -Z parse-only
1213

1314
impl <*const u8>::AssocTy {} // OK
1415
impl <Type as Trait>::AssocTy {} // OK
1516
impl <'a + Trait>::AssocTy {} // OK
1617
impl <<Type>::AssocTy>::AssocTy {} // OK
17-
18-
FAIL //~ ERROR

src/test/ui/parser/impl-qpath.stderr

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/test/ui/parser/trailing-plus-in-bounds.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// compile-pass
1112
// compile-flags: -Z parse-only -Z continue-parse-after-error
1213

1314
use std::fmt::Debug;
1415

1516
fn main() {
1617
let x: Box<Debug+> = box 3 as Box<Debug+>; // Trailing `+` is OK
1718
}
18-
19-
FAIL
20-
//~^ ERROR

src/test/ui/parser/trailing-plus-in-bounds.stderr

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/test/ui/parser/trait-object-trait-parens.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// compile-pass
1112
// compile-flags: -Z parse-only
1213

1314
fn f<T: (Copy) + (?Sized) + (for<'a> Trait<'a>)>() {}
@@ -17,5 +18,3 @@ fn main() {
1718
let _: Box<(?Sized) + (for<'a> Trait<'a>) + (Copy)>;
1819
let _: Box<(for<'a> Trait<'a>) + (Copy) + (?Sized)>;
1920
}
20-
21-
FAIL //~ ERROR

src/test/ui/parser/trait-object-trait-parens.stderr

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/test/ui/parser/trait-plusequal-splitting.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// compile-flags: -Z parse-only
1211
// Fixes issue where `+` in generics weren't parsed if they were part of a `+=`.
1312

13+
// compile-pass
14+
// compile-flags: -Z parse-only
15+
1416
struct Whitespace<T: Clone + = ()> { t: T }
1517
struct TokenSplit<T: Clone += ()> { t: T }
1618

17-
fn main() {
18-
}
19-
20-
FAIL //~ ERROR
19+
fn main() {}

src/test/ui/parser/trait-plusequal-splitting.stderr

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/test/ui/parser/underscore-suffix-for-string.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// compile-pass
12+
1113
fn main() {
1214
let _ = "Foo"_;
1315
//~^ WARNING underscore literal suffix is not allowed
1416
//~| WARNING this was previously accepted
1517
//~| NOTE issue #42326
1618
}
17-
18-
FAIL
19-
//~^ ERROR
20-
//~| NOTE
Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
11
warning: underscore literal suffix is not allowed
2-
--> $DIR/underscore-suffix-for-string.rs:12:18
2+
--> $DIR/underscore-suffix-for-string.rs:14:18
33
|
44
LL | let _ = "Foo"_;
55
| ^
66
|
77
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
88
= note: for more information, see issue #42326 <https://github.com/rust-lang/rust/issues/42326>
99

10-
error: expected one of `!` or `::`, found `<eof>`
11-
--> $DIR/underscore-suffix-for-string.rs:18:1
12-
|
13-
LL | FAIL
14-
| ^^^^ expected one of `!` or `::` here
15-
16-
error: aborting due to previous error
17-

0 commit comments

Comments
 (0)