Skip to content

Unify E0109, E0110 and E0111 #59321

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 23, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update tests
  • Loading branch information
varkor committed Mar 20, 2019
commit aff175b328d8d35969e5a76aa0fff4d6c4a5d262
36 changes: 18 additions & 18 deletions src/test/ui/enum-variant-generic-args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@ impl<T> Enum<T> {
Self::TSVariant(());
//~^ ERROR mismatched types [E0308]
Self::TSVariant::<()>(());
//~^ ERROR type arguments are not allowed on this entity [E0109]
//~^ ERROR type arguments are not allowed for this type [E0109]
Self::<()>::TSVariant(());
//~^ ERROR type arguments are not allowed on this entity [E0109]
//~^ ERROR type arguments are not allowed for this type [E0109]
//~^^ ERROR mismatched types [E0308]
Self::<()>::TSVariant::<()>(());
//~^ ERROR type arguments are not allowed on this entity [E0109]
//~^^ ERROR type arguments are not allowed on this entity [E0109]
//~^ ERROR type arguments are not allowed for this type [E0109]
//~^^ ERROR type arguments are not allowed for this type [E0109]
}

fn s_variant() {
Self::SVariant { v: () };
//~^ ERROR mismatched types [E0308]
Self::SVariant::<()> { v: () };
//~^ ERROR type arguments are not allowed on this entity [E0109]
//~^ ERROR type arguments are not allowed for this type [E0109]
//~^^ ERROR mismatched types [E0308]
Self::<()>::SVariant { v: () };
//~^ ERROR type arguments are not allowed on this entity [E0109]
//~^ ERROR type arguments are not allowed for this type [E0109]
//~^^ ERROR mismatched types [E0308]
Self::<()>::SVariant::<()> { v: () };
//~^ ERROR type arguments are not allowed on this entity [E0109]
//~^^ ERROR type arguments are not allowed on this entity [E0109]
//~^ ERROR type arguments are not allowed for this type [E0109]
//~^^ ERROR type arguments are not allowed for this type [E0109]
//~^^^ ERROR mismatched types [E0308]
}
}
Expand All @@ -38,36 +38,36 @@ fn main() {
// Tuple struct variant

Enum::<()>::TSVariant::<()>(());
//~^ ERROR type arguments are not allowed on this entity [E0109]
//~^ ERROR type arguments are not allowed for this type [E0109]

Alias::TSVariant::<()>(());
//~^ ERROR type arguments are not allowed on this entity [E0109]
//~^ ERROR type arguments are not allowed for this type [E0109]
Alias::<()>::TSVariant::<()>(());
//~^ ERROR type arguments are not allowed on this entity [E0109]
//~^ ERROR type arguments are not allowed for this type [E0109]

AliasFixed::TSVariant::<()>(());
//~^ ERROR type arguments are not allowed on this entity [E0109]
//~^ ERROR type arguments are not allowed for this type [E0109]
AliasFixed::<()>::TSVariant(());
//~^ ERROR wrong number of type arguments: expected 0, found 1 [E0107]
AliasFixed::<()>::TSVariant::<()>(());
//~^ ERROR type arguments are not allowed on this entity [E0109]
//~^ ERROR type arguments are not allowed for this type [E0109]
//~^^ ERROR wrong number of type arguments: expected 0, found 1 [E0107]

// Struct variant

Enum::<()>::SVariant::<()> { v: () };
//~^ ERROR type arguments are not allowed on this entity [E0109]
//~^ ERROR type arguments are not allowed for this type [E0109]

Alias::SVariant::<()> { v: () };
//~^ ERROR type arguments are not allowed on this entity [E0109]
//~^ ERROR type arguments are not allowed for this type [E0109]
Alias::<()>::SVariant::<()> { v: () };
//~^ ERROR type arguments are not allowed on this entity [E0109]
//~^ ERROR type arguments are not allowed for this type [E0109]

AliasFixed::SVariant::<()> { v: () };
//~^ ERROR type arguments are not allowed on this entity [E0109]
//~^ ERROR type arguments are not allowed for this type [E0109]
AliasFixed::<()>::SVariant { v: () };
//~^ ERROR wrong number of type arguments: expected 0, found 1 [E0107]
AliasFixed::<()>::SVariant::<()> { v: () };
//~^ ERROR type arguments are not allowed on this entity [E0109]
//~^ ERROR type arguments are not allowed for this type [E0109]
//~^^ ERROR wrong number of type arguments: expected 0, found 1 [E0107]
}
36 changes: 18 additions & 18 deletions src/test/ui/enum-variant-generic-args.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ LL | Self::TSVariant(());
= note: expected type `T`
found type `()`

error[E0109]: type arguments are not allowed on this entity
error[E0109]: type arguments are not allowed for this type
--> $DIR/enum-variant-generic-args.rs:11:27
|
LL | Self::TSVariant::<()>(());
| ^^ type argument not allowed

error[E0109]: type arguments are not allowed on this entity
error[E0109]: type arguments are not allowed for this type
--> $DIR/enum-variant-generic-args.rs:13:16
|
LL | Self::<()>::TSVariant(());
Expand All @@ -28,13 +28,13 @@ LL | Self::<()>::TSVariant(());
= note: expected type `T`
found type `()`

error[E0109]: type arguments are not allowed on this entity
error[E0109]: type arguments are not allowed for this type
--> $DIR/enum-variant-generic-args.rs:16:16
|
LL | Self::<()>::TSVariant::<()>(());
| ^^ type argument not allowed

error[E0109]: type arguments are not allowed on this entity
error[E0109]: type arguments are not allowed for this type
--> $DIR/enum-variant-generic-args.rs:16:33
|
LL | Self::<()>::TSVariant::<()>(());
Expand All @@ -49,7 +49,7 @@ LL | Self::SVariant { v: () };
= note: expected type `T`
found type `()`

error[E0109]: type arguments are not allowed on this entity
error[E0109]: type arguments are not allowed for this type
--> $DIR/enum-variant-generic-args.rs:24:26
|
LL | Self::SVariant::<()> { v: () };
Expand All @@ -64,7 +64,7 @@ LL | Self::SVariant::<()> { v: () };
= note: expected type `T`
found type `()`

error[E0109]: type arguments are not allowed on this entity
error[E0109]: type arguments are not allowed for this type
--> $DIR/enum-variant-generic-args.rs:27:16
|
LL | Self::<()>::SVariant { v: () };
Expand All @@ -79,13 +79,13 @@ LL | Self::<()>::SVariant { v: () };
= note: expected type `T`
found type `()`

error[E0109]: type arguments are not allowed on this entity
error[E0109]: type arguments are not allowed for this type
--> $DIR/enum-variant-generic-args.rs:30:16
|
LL | Self::<()>::SVariant::<()> { v: () };
| ^^ type argument not allowed

error[E0109]: type arguments are not allowed on this entity
error[E0109]: type arguments are not allowed for this type
--> $DIR/enum-variant-generic-args.rs:30:32
|
LL | Self::<()>::SVariant::<()> { v: () };
Expand All @@ -100,25 +100,25 @@ LL | Self::<()>::SVariant::<()> { v: () };
= note: expected type `T`
found type `()`

error[E0109]: type arguments are not allowed on this entity
error[E0109]: type arguments are not allowed for this type
--> $DIR/enum-variant-generic-args.rs:40:29
|
LL | Enum::<()>::TSVariant::<()>(());
| ^^ type argument not allowed

error[E0109]: type arguments are not allowed on this entity
error[E0109]: type arguments are not allowed for this type
--> $DIR/enum-variant-generic-args.rs:43:24
|
LL | Alias::TSVariant::<()>(());
| ^^ type argument not allowed

error[E0109]: type arguments are not allowed on this entity
error[E0109]: type arguments are not allowed for this type
--> $DIR/enum-variant-generic-args.rs:45:30
|
LL | Alias::<()>::TSVariant::<()>(());
| ^^ type argument not allowed

error[E0109]: type arguments are not allowed on this entity
error[E0109]: type arguments are not allowed for this type
--> $DIR/enum-variant-generic-args.rs:48:29
|
LL | AliasFixed::TSVariant::<()>(());
Expand All @@ -136,31 +136,31 @@ error[E0107]: wrong number of type arguments: expected 0, found 1
LL | AliasFixed::<()>::TSVariant::<()>(());
| ^^ unexpected type argument

error[E0109]: type arguments are not allowed on this entity
error[E0109]: type arguments are not allowed for this type
--> $DIR/enum-variant-generic-args.rs:52:35
|
LL | AliasFixed::<()>::TSVariant::<()>(());
| ^^ type argument not allowed

error[E0109]: type arguments are not allowed on this entity
error[E0109]: type arguments are not allowed for this type
--> $DIR/enum-variant-generic-args.rs:58:28
|
LL | Enum::<()>::SVariant::<()> { v: () };
| ^^ type argument not allowed

error[E0109]: type arguments are not allowed on this entity
error[E0109]: type arguments are not allowed for this type
--> $DIR/enum-variant-generic-args.rs:61:23
|
LL | Alias::SVariant::<()> { v: () };
| ^^ type argument not allowed

error[E0109]: type arguments are not allowed on this entity
error[E0109]: type arguments are not allowed for this type
--> $DIR/enum-variant-generic-args.rs:63:29
|
LL | Alias::<()>::SVariant::<()> { v: () };
| ^^ type argument not allowed

error[E0109]: type arguments are not allowed on this entity
error[E0109]: type arguments are not allowed for this type
--> $DIR/enum-variant-generic-args.rs:66:28
|
LL | AliasFixed::SVariant::<()> { v: () };
Expand All @@ -178,7 +178,7 @@ error[E0107]: wrong number of type arguments: expected 0, found 1
LL | AliasFixed::<()>::SVariant::<()> { v: () };
| ^^ unexpected type argument

error[E0109]: type arguments are not allowed on this entity
error[E0109]: type arguments are not allowed for this type
--> $DIR/enum-variant-generic-args.rs:70:34
|
LL | AliasFixed::<()>::SVariant::<()> { v: () };
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/error-codes/E0109.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error[E0109]: type arguments are not allowed on this entity
error[E0109]: type arguments are not allowed for this type
--> $DIR/E0109.rs:1:14
|
LL | type X = u32<i32>;
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/error-codes/E0110.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
type X = u32<'static>; //~ ERROR E0110
type X = u32<'static>; //~ ERROR E0109

fn main() {}
4 changes: 2 additions & 2 deletions src/test/ui/error-codes/E0110.stderr
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
error[E0110]: lifetime arguments are not allowed on this entity
error[E0109]: lifetime arguments are not allowed for this type
--> $DIR/E0110.rs:1:14
|
LL | type X = u32<'static>;
| ^^^^^^^ lifetime argument not allowed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0110`.
For more information about this error, try `rustc --explain E0109`.
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-22706.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
fn is_copy<T: ::std::marker<i32>::Copy>() {}
//~^ ERROR type arguments are not allowed on this entity [E0109]
//~^ ERROR type arguments are not allowed for this type [E0109]
fn main() {}
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-22706.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error[E0109]: type arguments are not allowed on this entity
error[E0109]: type arguments are not allowed for this type
--> $DIR/issue-22706.rs:1:29
|
LL | fn is_copy<T: ::std::marker<i32>::Copy>() {}
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/mod-subitem-as-enum-variant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ mod Mod {
fn main() {
Mod::FakeVariant::<i32>(0);
Mod::<i32>::FakeVariant(0);
//~^ ERROR type arguments are not allowed on this entity [E0109]
//~^ ERROR type arguments are not allowed for this type [E0109]
}
2 changes: 1 addition & 1 deletion src/test/ui/mod-subitem-as-enum-variant.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error[E0109]: type arguments are not allowed on this entity
error[E0109]: type arguments are not allowed for this type
--> $DIR/mod-subitem-as-enum-variant.rs:8:11
|
LL | Mod::<i32>::FakeVariant(0);
Expand Down
44 changes: 22 additions & 22 deletions src/test/ui/prim-with-args.rs
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
fn main() {

let x: isize<isize>; //~ ERROR type arguments are not allowed on this entity
let x: i8<isize>; //~ ERROR type arguments are not allowed on this entity
let x: i16<isize>; //~ ERROR type arguments are not allowed on this entity
let x: i32<isize>; //~ ERROR type arguments are not allowed on this entity
let x: i64<isize>; //~ ERROR type arguments are not allowed on this entity
let x: usize<isize>; //~ ERROR type arguments are not allowed on this entity
let x: u8<isize>; //~ ERROR type arguments are not allowed on this entity
let x: u16<isize>; //~ ERROR type arguments are not allowed on this entity
let x: u32<isize>; //~ ERROR type arguments are not allowed on this entity
let x: u64<isize>; //~ ERROR type arguments are not allowed on this entity
let x: char<isize>; //~ ERROR type arguments are not allowed on this entity
let x: isize<isize>; //~ ERROR type arguments are not allowed for this type
let x: i8<isize>; //~ ERROR type arguments are not allowed for this type
let x: i16<isize>; //~ ERROR type arguments are not allowed for this type
let x: i32<isize>; //~ ERROR type arguments are not allowed for this type
let x: i64<isize>; //~ ERROR type arguments are not allowed for this type
let x: usize<isize>; //~ ERROR type arguments are not allowed for this type
let x: u8<isize>; //~ ERROR type arguments are not allowed for this type
let x: u16<isize>; //~ ERROR type arguments are not allowed for this type
let x: u32<isize>; //~ ERROR type arguments are not allowed for this type
let x: u64<isize>; //~ ERROR type arguments are not allowed for this type
let x: char<isize>; //~ ERROR type arguments are not allowed for this type

let x: isize<'static>; //~ ERROR lifetime arguments are not allowed on this entity
let x: i8<'static>; //~ ERROR lifetime arguments are not allowed on this entity
let x: i16<'static>; //~ ERROR lifetime arguments are not allowed on this entity
let x: i32<'static>; //~ ERROR lifetime arguments are not allowed on this entity
let x: i64<'static>; //~ ERROR lifetime arguments are not allowed on this entity
let x: usize<'static>; //~ ERROR lifetime arguments are not allowed on this entity
let x: u8<'static>; //~ ERROR lifetime arguments are not allowed on this entity
let x: u16<'static>; //~ ERROR lifetime arguments are not allowed on this entity
let x: u32<'static>; //~ ERROR lifetime arguments are not allowed on this entity
let x: u64<'static>; //~ ERROR lifetime arguments are not allowed on this entity
let x: char<'static>; //~ ERROR lifetime arguments are not allowed on this entity
let x: isize<'static>; //~ ERROR lifetime arguments are not allowed for this type
let x: i8<'static>; //~ ERROR lifetime arguments are not allowed for this type
let x: i16<'static>; //~ ERROR lifetime arguments are not allowed for this type
let x: i32<'static>; //~ ERROR lifetime arguments are not allowed for this type
let x: i64<'static>; //~ ERROR lifetime arguments are not allowed for this type
let x: usize<'static>; //~ ERROR lifetime arguments are not allowed for this type
let x: u8<'static>; //~ ERROR lifetime arguments are not allowed for this type
let x: u16<'static>; //~ ERROR lifetime arguments are not allowed for this type
let x: u32<'static>; //~ ERROR lifetime arguments are not allowed for this type
let x: u64<'static>; //~ ERROR lifetime arguments are not allowed for this type
let x: char<'static>; //~ ERROR lifetime arguments are not allowed for this type

}
Loading