diff options
Diffstat (limited to 'src/test/ui/generic-associated-types/parse')
14 files changed, 0 insertions, 330 deletions
diff --git a/src/test/ui/generic-associated-types/parse/in-trait-impl.rs b/src/test/ui/generic-associated-types/parse/in-trait-impl.rs deleted file mode 100644 index 767098835..000000000 --- a/src/test/ui/generic-associated-types/parse/in-trait-impl.rs +++ /dev/null @@ -1,8 +0,0 @@ -// check-pass -// compile-flags: -Z parse-only - -impl<T> Baz for T where T: Foo { - type Quux<'a> = <T as Foo>::Bar<'a, 'static>; -} - -fn main() {} diff --git a/src/test/ui/generic-associated-types/parse/in-trait.rs b/src/test/ui/generic-associated-types/parse/in-trait.rs deleted file mode 100644 index 6628aac37..000000000 --- a/src/test/ui/generic-associated-types/parse/in-trait.rs +++ /dev/null @@ -1,22 +0,0 @@ -// check-pass -// compile-flags: -Z parse-only - -use std::ops::Deref; -use std::fmt::Debug; - -trait Foo { - type Bar<'a>; - type Bar<'a, 'b>; - type Bar<'a, 'b,>; - type Bar<'a, 'b, T>; - type Bar<'a, 'b, T, U>; - type Bar<'a, 'b, T, U,>; - type Bar<'a, 'b, T: Debug, U,>; - type Bar<'a, 'b, T: Debug, U,>: Debug; - type Bar<'a, 'b, T: Debug, U,>: Deref<Target = T> + Into<U>; - type Bar<'a, 'b, T: Debug, U,> where T: Deref<Target = U>, U: Into<T>; - type Bar<'a, 'b, T: Debug, U,>: Deref<Target = T> + Into<U> - where T: Deref<Target = U>, U: Into<T>; -} - -fn main() {} diff --git a/src/test/ui/generic-associated-types/parse/trait-path-expected-token.rs b/src/test/ui/generic-associated-types/parse/trait-path-expected-token.rs deleted file mode 100644 index cbb051892..000000000 --- a/src/test/ui/generic-associated-types/parse/trait-path-expected-token.rs +++ /dev/null @@ -1,8 +0,0 @@ -trait X { - type Y<'a>; -} - -fn f1<'a>(arg : Box<dyn X<Y = B = &'a ()>>) {} - //~^ ERROR: expected one of `!`, `(`, `+`, `,`, `::`, `<`, or `>`, found `=` - -fn main() {} diff --git a/src/test/ui/generic-associated-types/parse/trait-path-expected-token.stderr b/src/test/ui/generic-associated-types/parse/trait-path-expected-token.stderr deleted file mode 100644 index 53d5f9de6..000000000 --- a/src/test/ui/generic-associated-types/parse/trait-path-expected-token.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: expected one of `!`, `(`, `+`, `,`, `::`, `<`, or `>`, found `=` - --> $DIR/trait-path-expected-token.rs:5:33 - | -LL | fn f1<'a>(arg : Box<dyn X<Y = B = &'a ()>>) {} - | - ^ expected one of 7 possible tokens - | | - | maybe try to close unmatched angle bracket - -error: aborting due to previous error - diff --git a/src/test/ui/generic-associated-types/parse/trait-path-expressions.rs b/src/test/ui/generic-associated-types/parse/trait-path-expressions.rs deleted file mode 100644 index 9183ec497..000000000 --- a/src/test/ui/generic-associated-types/parse/trait-path-expressions.rs +++ /dev/null @@ -1,20 +0,0 @@ -mod error1 { - trait X { - type Y<'a>; - } - - fn f1<'a>(arg : Box<dyn X< 1 = 32 >>) {} - //~^ ERROR: expected expression, found `)` -} - -mod error2 { - - trait X { - type Y<'a>; - } - - fn f2<'a>(arg : Box<dyn X< { 1 } = 32 >>) {} - //~^ ERROR: expected one of -} - -fn main() {} diff --git a/src/test/ui/generic-associated-types/parse/trait-path-expressions.stderr b/src/test/ui/generic-associated-types/parse/trait-path-expressions.stderr deleted file mode 100644 index cf2b1763f..000000000 --- a/src/test/ui/generic-associated-types/parse/trait-path-expressions.stderr +++ /dev/null @@ -1,23 +0,0 @@ -error: expected expression, found `)` - --> $DIR/trait-path-expressions.rs:6:39 - | -LL | fn f1<'a>(arg : Box<dyn X< 1 = 32 >>) {} - | - ^ expected expression - | | - | while parsing a const generic argument starting here - -error: expected one of `,`, `:`, or `>`, found `=` - --> $DIR/trait-path-expressions.rs:16:36 - | -LL | fn f2<'a>(arg : Box<dyn X< { 1 } = 32 >>) {} - | - ^ expected one of `,`, `:`, or `>` - | | - | maybe try to close unmatched angle bracket - | -help: you might have meant to end the type parameters here - | -LL | fn f2<'a>(arg : Box<dyn X< { 1 }> = 32 >>) {} - | + - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/generic-associated-types/parse/trait-path-missing-gen_arg.rs b/src/test/ui/generic-associated-types/parse/trait-path-missing-gen_arg.rs deleted file mode 100644 index ecabf8943..000000000 --- a/src/test/ui/generic-associated-types/parse/trait-path-missing-gen_arg.rs +++ /dev/null @@ -1,18 +0,0 @@ -trait X { - type Y<'a>; -} - -const _: () = { - fn f1<'a>(arg : Box<dyn X< : 32 >>) {} - //~^ ERROR: expected one of `>`, a const expression, lifetime, or type, found `:` - //~| ERROR: expected parameter name, found `>` - //~| ERROR: expected one of `!`, `)`, `+`, `,`, or `::`, found `>` - //~| ERROR: constant provided when a type was expected -}; - -const _: () = { - fn f1<'a>(arg : Box<dyn X< = 32 >>) {} - //~^ ERROR: expected one of `>`, a const expression, lifetime, or type, found `=` -}; - -fn main() {} diff --git a/src/test/ui/generic-associated-types/parse/trait-path-missing-gen_arg.stderr b/src/test/ui/generic-associated-types/parse/trait-path-missing-gen_arg.stderr deleted file mode 100644 index 10ceccedc..000000000 --- a/src/test/ui/generic-associated-types/parse/trait-path-missing-gen_arg.stderr +++ /dev/null @@ -1,43 +0,0 @@ -error: expected one of `>`, a const expression, lifetime, or type, found `:` - --> $DIR/trait-path-missing-gen_arg.rs:6:30 - | -LL | fn f1<'a>(arg : Box<dyn X< : 32 >>) {} - | ^ expected one of `>`, a const expression, lifetime, or type - | -help: expressions must be enclosed in braces to be used as const generic arguments - | -LL | fn f1<'a>(arg : Box<{ dyn X< : 32 } >>) {} - | + + - -error: expected parameter name, found `>` - --> $DIR/trait-path-missing-gen_arg.rs:6:36 - | -LL | fn f1<'a>(arg : Box<dyn X< : 32 >>) {} - | ^ expected parameter name - -error: expected one of `!`, `)`, `+`, `,`, or `::`, found `>` - --> $DIR/trait-path-missing-gen_arg.rs:6:36 - | -LL | fn f1<'a>(arg : Box<dyn X< : 32 >>) {} - | ^ - | | - | expected one of `!`, `)`, `+`, `,`, or `::` - | help: missing `,` - -error: expected one of `>`, a const expression, lifetime, or type, found `=` - --> $DIR/trait-path-missing-gen_arg.rs:14:30 - | -LL | fn f1<'a>(arg : Box<dyn X< = 32 >>) {} - | - ^ expected one of `>`, a const expression, lifetime, or type - | | - | maybe try to close unmatched angle bracket - -error[E0747]: constant provided when a type was expected - --> $DIR/trait-path-missing-gen_arg.rs:6:23 - | -LL | fn f1<'a>(arg : Box<dyn X< : 32 >>) {} - | ^^^^^^^^^^^ - -error: aborting due to 5 previous errors - -For more information about this error, try `rustc --explain E0747`. diff --git a/src/test/ui/generic-associated-types/parse/trait-path-segments.rs b/src/test/ui/generic-associated-types/parse/trait-path-segments.rs deleted file mode 100644 index 458e203eb..000000000 --- a/src/test/ui/generic-associated-types/parse/trait-path-segments.rs +++ /dev/null @@ -1,32 +0,0 @@ -const _: () = { - trait X { - type Y<'a>; - } - - fn f1<'a>(arg : Box<dyn X<X::Y = u32>>) {} - //~^ ERROR: expected one of - }; - -const _: () = { - trait X { - type Y<'a>; - } - - trait Z {} - - impl<T : X<<Self as X>::Y<'a> = &'a u32>> Z for T {} - //~^ ERROR: expected one of -}; - -const _: () = { - trait X { - type Y<'a>; - } - - trait Z {} - - impl<T : X<X::Y<'a> = &'a u32>> Z for T {} - //~^ ERROR: expected one of -}; - -fn main() {} diff --git a/src/test/ui/generic-associated-types/parse/trait-path-segments.stderr b/src/test/ui/generic-associated-types/parse/trait-path-segments.stderr deleted file mode 100644 index 8bc737d67..000000000 --- a/src/test/ui/generic-associated-types/parse/trait-path-segments.stderr +++ /dev/null @@ -1,41 +0,0 @@ -error: expected one of `!`, `(`, `+`, `,`, `::`, `:`, `<`, or `>`, found `=` - --> $DIR/trait-path-segments.rs:6:36 - | -LL | fn f1<'a>(arg : Box<dyn X<X::Y = u32>>) {} - | - ^ expected one of 8 possible tokens - | | - | maybe try to close unmatched angle bracket - | -help: you might have meant to end the type parameters here - | -LL | fn f1<'a>(arg : Box<dyn X<X::Y> = u32>>) {} - | + - -error: expected one of `,`, `::`, `:`, or `>`, found `=` - --> $DIR/trait-path-segments.rs:17:35 - | -LL | impl<T : X<<Self as X>::Y<'a> = &'a u32>> Z for T {} - | - ^ expected one of `,`, `::`, `:`, or `>` - | | - | maybe try to close unmatched angle bracket - | -help: you might have meant to end the type parameters here - | -LL | impl<T : X<<Self as X>::Y<'a>> = &'a u32>> Z for T {} - | + - -error: expected one of `!`, `+`, `,`, `::`, `:`, or `>`, found `=` - --> $DIR/trait-path-segments.rs:28:25 - | -LL | impl<T : X<X::Y<'a> = &'a u32>> Z for T {} - | - ^ expected one of `!`, `+`, `,`, `::`, `:`, or `>` - | | - | maybe try to close unmatched angle bracket - | -help: you might have meant to end the type parameters here - | -LL | impl<T : X<X::Y<'a>> = &'a u32>> Z for T {} - | + - -error: aborting due to 3 previous errors - diff --git a/src/test/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.rs b/src/test/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.rs deleted file mode 100644 index 1622b92aa..000000000 --- a/src/test/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.rs +++ /dev/null @@ -1,11 +0,0 @@ -trait X { - type Y<'a>; -} - -const _: () = { - fn f2<'a>(arg : Box<dyn X<Y<1> = &'a ()>>) {} - //~^ ERROR this associated type takes 1 lifetime argument but 0 lifetime arguments - //~| ERROR this associated type takes 0 generic arguments but 1 generic argument -}; - -fn main() {} diff --git a/src/test/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.stderr b/src/test/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.stderr deleted file mode 100644 index 0a09ec5dc..000000000 --- a/src/test/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.stderr +++ /dev/null @@ -1,33 +0,0 @@ -error[E0107]: this associated type takes 1 lifetime argument but 0 lifetime arguments were supplied - --> $DIR/trait-path-type-error-once-implemented.rs:6:29 - | -LL | fn f2<'a>(arg : Box<dyn X<Y<1> = &'a ()>>) {} - | ^ expected 1 lifetime argument - | -note: associated type defined here, with 1 lifetime parameter: `'a` - --> $DIR/trait-path-type-error-once-implemented.rs:2:10 - | -LL | type Y<'a>; - | ^ -- -help: add missing lifetime argument - | -LL | fn f2<'a>(arg : Box<dyn X<Y<'_, 1> = &'a ()>>) {} - | +++ - -error[E0107]: this associated type takes 0 generic arguments but 1 generic argument was supplied - --> $DIR/trait-path-type-error-once-implemented.rs:6:29 - | -LL | fn f2<'a>(arg : Box<dyn X<Y<1> = &'a ()>>) {} - | ^--- help: remove these generics - | | - | expected 0 generic arguments - | -note: associated type defined here, with 0 generic parameters - --> $DIR/trait-path-type-error-once-implemented.rs:2:10 - | -LL | type Y<'a>; - | ^ - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0107`. diff --git a/src/test/ui/generic-associated-types/parse/trait-path-types.rs b/src/test/ui/generic-associated-types/parse/trait-path-types.rs deleted file mode 100644 index 74a00342f..000000000 --- a/src/test/ui/generic-associated-types/parse/trait-path-types.rs +++ /dev/null @@ -1,20 +0,0 @@ -trait X { - type Y<'a>; -} - -const _: () = { - fn f<'a>(arg : Box<dyn X< [u8; 1] = u32>>) {} - //~^ ERROR: expected one of -}; - -const _: () = { - fn f1<'a>(arg : Box<dyn X<(Y<'a>) = &'a ()>>) {} - //~^ ERROR: expected one of -}; - -const _: () = { - fn f1<'a>(arg : Box<dyn X< 'a = u32 >>) {} - //~^ ERROR: expected one of -}; - -fn main() {} diff --git a/src/test/ui/generic-associated-types/parse/trait-path-types.stderr b/src/test/ui/generic-associated-types/parse/trait-path-types.stderr deleted file mode 100644 index 8f7a73c95..000000000 --- a/src/test/ui/generic-associated-types/parse/trait-path-types.stderr +++ /dev/null @@ -1,41 +0,0 @@ -error: expected one of `,`, `:`, or `>`, found `=` - --> $DIR/trait-path-types.rs:6:37 - | -LL | fn f<'a>(arg : Box<dyn X< [u8; 1] = u32>>) {} - | - ^ expected one of `,`, `:`, or `>` - | | - | maybe try to close unmatched angle bracket - | -help: you might have meant to end the type parameters here - | -LL | fn f<'a>(arg : Box<dyn X< [u8; 1]> = u32>>) {} - | + - -error: expected one of `,`, `:`, or `>`, found `=` - --> $DIR/trait-path-types.rs:11:37 - | -LL | fn f1<'a>(arg : Box<dyn X<(Y<'a>) = &'a ()>>) {} - | - ^ expected one of `,`, `:`, or `>` - | | - | maybe try to close unmatched angle bracket - | -help: you might have meant to end the type parameters here - | -LL | fn f1<'a>(arg : Box<dyn X<(Y<'a>)> = &'a ()>>) {} - | + - -error: expected one of `,`, `:`, or `>`, found `=` - --> $DIR/trait-path-types.rs:16:33 - | -LL | fn f1<'a>(arg : Box<dyn X< 'a = u32 >>) {} - | -- ^ expected one of `,`, `:`, or `>` - | | - | maybe try to close unmatched angle bracket - | -help: you might have meant to end the type parameters here - | -LL | fn f1<'a>(arg : Box<dyn X< 'a> = u32 >>) {} - | + - -error: aborting due to 3 previous errors - |