Make some ui/parser tests compile-pass
This commit is contained in:
parent
51f3b6241d
commit
64c0efab85
12 changed files with 11 additions and 68 deletions
|
@ -8,9 +8,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
// compile-pass
|
||||||
// compile-flags: -Z parse-only
|
// compile-flags: -Z parse-only
|
||||||
|
|
||||||
type A = Box<(Fn(D::Error) -> E) + 'static + Send + Sync>; // OK (but see #39318)
|
type A = Box<(Fn(D::Error) -> E) + 'static + Send + Sync>; // OK (but see #39318)
|
||||||
|
|
||||||
FAIL
|
|
||||||
//~^ ERROR
|
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
error: expected one of `!` or `::`, found `<eof>`
|
|
||||||
--> $DIR/bounds-obj-parens.rs:15:1
|
|
||||||
|
|
|
||||||
LL | FAIL
|
|
||||||
| ^^^^ expected one of `!` or `::` here
|
|
||||||
|
|
||||||
error: aborting due to previous error
|
|
||||||
|
|
|
@ -8,11 +8,10 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
// compile-pass
|
||||||
// compile-flags: -Z parse-only
|
// compile-flags: -Z parse-only
|
||||||
|
|
||||||
impl <*const u8>::AssocTy {} // OK
|
impl <*const u8>::AssocTy {} // OK
|
||||||
impl <Type as Trait>::AssocTy {} // OK
|
impl <Type as Trait>::AssocTy {} // OK
|
||||||
impl <'a + Trait>::AssocTy {} // OK
|
impl <'a + Trait>::AssocTy {} // OK
|
||||||
impl <<Type>::AssocTy>::AssocTy {} // OK
|
impl <<Type>::AssocTy>::AssocTy {} // OK
|
||||||
|
|
||||||
FAIL //~ ERROR
|
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
error: expected one of `!` or `::`, found `<eof>`
|
|
||||||
--> $DIR/impl-qpath.rs:18:1
|
|
||||||
|
|
|
||||||
LL | FAIL //~ ERROR
|
|
||||||
| ^^^^ expected one of `!` or `::` here
|
|
||||||
|
|
||||||
error: aborting due to previous error
|
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
// compile-pass
|
||||||
// compile-flags: -Z parse-only -Z continue-parse-after-error
|
// compile-flags: -Z parse-only -Z continue-parse-after-error
|
||||||
|
|
||||||
use std::fmt::Debug;
|
use std::fmt::Debug;
|
||||||
|
@ -15,6 +16,3 @@ use std::fmt::Debug;
|
||||||
fn main() {
|
fn main() {
|
||||||
let x: Box<Debug+> = box 3 as Box<Debug+>; // Trailing `+` is OK
|
let x: Box<Debug+> = box 3 as Box<Debug+>; // Trailing `+` is OK
|
||||||
}
|
}
|
||||||
|
|
||||||
FAIL
|
|
||||||
//~^ ERROR
|
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
error: expected one of `!` or `::`, found `<eof>`
|
|
||||||
--> $DIR/trailing-plus-in-bounds.rs:19:1
|
|
||||||
|
|
|
||||||
LL | FAIL
|
|
||||||
| ^^^^ expected one of `!` or `::` here
|
|
||||||
|
|
||||||
error: aborting due to previous error
|
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
// compile-pass
|
||||||
// compile-flags: -Z parse-only
|
// compile-flags: -Z parse-only
|
||||||
|
|
||||||
fn f<T: (Copy) + (?Sized) + (for<'a> Trait<'a>)>() {}
|
fn f<T: (Copy) + (?Sized) + (for<'a> Trait<'a>)>() {}
|
||||||
|
@ -17,5 +18,3 @@ fn main() {
|
||||||
let _: Box<(?Sized) + (for<'a> Trait<'a>) + (Copy)>;
|
let _: Box<(?Sized) + (for<'a> Trait<'a>) + (Copy)>;
|
||||||
let _: Box<(for<'a> Trait<'a>) + (Copy) + (?Sized)>;
|
let _: Box<(for<'a> Trait<'a>) + (Copy) + (?Sized)>;
|
||||||
}
|
}
|
||||||
|
|
||||||
FAIL //~ ERROR
|
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
error: expected one of `!` or `::`, found `<eof>`
|
|
||||||
--> $DIR/trait-object-trait-parens.rs:21:1
|
|
||||||
|
|
|
||||||
LL | FAIL //~ ERROR
|
|
||||||
| ^^^^ expected one of `!` or `::` here
|
|
||||||
|
|
||||||
error: aborting due to previous error
|
|
||||||
|
|
|
@ -8,13 +8,12 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// compile-flags: -Z parse-only
|
|
||||||
// Fixes issue where `+` in generics weren't parsed if they were part of a `+=`.
|
// 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 Whitespace<T: Clone + = ()> { t: T }
|
||||||
struct TokenSplit<T: Clone += ()> { t: T }
|
struct TokenSplit<T: Clone += ()> { t: T }
|
||||||
|
|
||||||
fn main() {
|
fn main() {}
|
||||||
}
|
|
||||||
|
|
||||||
FAIL //~ ERROR
|
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
error: expected one of `!` or `::`, found `<eof>`
|
|
||||||
--> $DIR/trait-plusequal-splitting.rs:20:1
|
|
||||||
|
|
|
||||||
LL | FAIL //~ ERROR
|
|
||||||
| ^^^^ expected one of `!` or `::` here
|
|
||||||
|
|
||||||
error: aborting due to previous error
|
|
||||||
|
|
|
@ -8,13 +8,11 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
// compile-pass
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let _ = "Foo"_;
|
let _ = "Foo"_;
|
||||||
//~^ WARNING underscore literal suffix is not allowed
|
//~^ WARNING underscore literal suffix is not allowed
|
||||||
//~| WARNING this was previously accepted
|
//~| WARNING this was previously accepted
|
||||||
//~| NOTE issue #42326
|
//~| NOTE issue #42326
|
||||||
}
|
}
|
||||||
|
|
||||||
FAIL
|
|
||||||
//~^ ERROR
|
|
||||||
//~| NOTE
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
warning: underscore literal suffix is not allowed
|
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"_;
|
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!
|
= 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>
|
= 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
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue