diff --git a/compiler/rustc_parse/src/parser/mod.rs b/compiler/rustc_parse/src/parser/mod.rs index b746256f5fefc..22f308ff36dba 100644 --- a/compiler/rustc_parse/src/parser/mod.rs +++ b/compiler/rustc_parse/src/parser/mod.rs @@ -264,7 +264,7 @@ impl TokenType { TokenType::Ident => "identifier".to_string(), TokenType::Path => "path".to_string(), TokenType::Type => "type".to_string(), - TokenType::Const => "const".to_string(), + TokenType::Const => "a const expression".to_string(), } } } 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 index dad8c2a2909da..94dda17aad710 100644 --- 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 @@ -7,7 +7,7 @@ trait X { const _: () = { fn f1<'a>(arg : Box>) {} - //~^ ERROR: expected one of `>`, const, lifetime, or type, found `:` + //~^ 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 @@ -15,7 +15,7 @@ const _: () = { const _: () = { fn f1<'a>(arg : Box>) {} - //~^ ERROR: expected one of `>`, const, lifetime, or type, found `=` + //~^ 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 index 583697f0b67d2..8a5e2c29c3665 100644 --- 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 @@ -1,8 +1,8 @@ -error: expected one of `>`, const, lifetime, or type, found `:` +error: expected one of `>`, a const expression, lifetime, or type, found `:` --> $DIR/trait-path-missing-gen_arg.rs:9:30 | LL | fn f1<'a>(arg : Box>) {} - | ^ expected one of `>`, const, lifetime, or type + | ^ expected one of `>`, a const expression, lifetime, or type | help: expressions must be enclosed in braces to be used as const generic arguments | @@ -24,11 +24,11 @@ LL | fn f1<'a>(arg : Box>) {} | expected one of `!`, `)`, `+`, `,`, or `::` | help: missing `,` -error: expected one of `>`, const, lifetime, or type, found `=` +error: expected one of `>`, a const expression, lifetime, or type, found `=` --> $DIR/trait-path-missing-gen_arg.rs:17:30 | LL | fn f1<'a>(arg : Box>) {} - | ^ expected one of `>`, const, lifetime, or type + | ^ expected one of `>`, a const expression, lifetime, or type warning: the feature `generic_associated_types` is incomplete and may not be safe to use and/or cause compiler crashes --> $DIR/trait-path-missing-gen_arg.rs:1:12 diff --git a/src/test/ui/issues/issue-20616-3.rs b/src/test/ui/issues/issue-20616-3.rs index 780038c11b808..b2371051c78f9 100644 --- a/src/test/ui/issues/issue-20616-3.rs +++ b/src/test/ui/issues/issue-20616-3.rs @@ -11,7 +11,7 @@ type Type_1_<'a, T> = &'a T; type Type_3 = Box; -//~^ error: expected one of `>`, const, lifetime, or type, found `,` +//~^ error: expected one of `>`, a const expression, lifetime, or type, found `,` //type Type_4 = Type_1_<'static,, T>; // error: expected type, found `,` diff --git a/src/test/ui/issues/issue-20616-3.stderr b/src/test/ui/issues/issue-20616-3.stderr index 2f8cf8a79ed94..b535c7a3267d3 100644 --- a/src/test/ui/issues/issue-20616-3.stderr +++ b/src/test/ui/issues/issue-20616-3.stderr @@ -1,8 +1,8 @@ -error: expected one of `>`, const, lifetime, or type, found `,` +error: expected one of `>`, a const expression, lifetime, or type, found `,` --> $DIR/issue-20616-3.rs:13:24 | LL | type Type_3 = Box; - | ^ expected one of `>`, const, lifetime, or type + | ^ expected one of `>`, a const expression, lifetime, or type error: aborting due to previous error diff --git a/src/test/ui/issues/issue-20616-4.rs b/src/test/ui/issues/issue-20616-4.rs index 85aa9c1146d67..a71f47ca4bf93 100644 --- a/src/test/ui/issues/issue-20616-4.rs +++ b/src/test/ui/issues/issue-20616-4.rs @@ -14,7 +14,7 @@ type Type_1_<'a, T> = &'a T; type Type_4 = Type_1_<'static,, T>; -//~^ error: expected one of `>`, const, lifetime, or type, found `,` +//~^ error: expected one of `>`, a const expression, lifetime, or type, found `,` type Type_5_<'a> = Type_1_<'a, ()>; diff --git a/src/test/ui/issues/issue-20616-4.stderr b/src/test/ui/issues/issue-20616-4.stderr index 3be6c2e78ced0..2b3b75f3119e3 100644 --- a/src/test/ui/issues/issue-20616-4.stderr +++ b/src/test/ui/issues/issue-20616-4.stderr @@ -1,8 +1,8 @@ -error: expected one of `>`, const, lifetime, or type, found `,` +error: expected one of `>`, a const expression, lifetime, or type, found `,` --> $DIR/issue-20616-4.rs:16:34 | LL | type Type_4 = Type_1_<'static,, T>; - | ^ expected one of `>`, const, lifetime, or type + | ^ expected one of `>`, a const expression, lifetime, or type error: aborting due to previous error diff --git a/src/test/ui/issues/issue-20616-5.rs b/src/test/ui/issues/issue-20616-5.rs index c0c6bc6dd97fe..b96d09d59ae69 100644 --- a/src/test/ui/issues/issue-20616-5.rs +++ b/src/test/ui/issues/issue-20616-5.rs @@ -20,7 +20,7 @@ type Type_5_<'a> = Type_1_<'a, ()>; type Type_5<'a> = Type_1_<'a, (),,>; -//~^ error: expected one of `>`, const, lifetime, or type, found `,` +//~^ error: expected one of `>`, a const expression, lifetime, or type, found `,` //type Type_6 = Type_5_<'a,,>; // error: expected type, found `,` diff --git a/src/test/ui/issues/issue-20616-5.stderr b/src/test/ui/issues/issue-20616-5.stderr index b90fbf6005147..1ec1dbde69528 100644 --- a/src/test/ui/issues/issue-20616-5.stderr +++ b/src/test/ui/issues/issue-20616-5.stderr @@ -1,8 +1,8 @@ -error: expected one of `>`, const, lifetime, or type, found `,` +error: expected one of `>`, a const expression, lifetime, or type, found `,` --> $DIR/issue-20616-5.rs:22:34 | LL | type Type_5<'a> = Type_1_<'a, (),,>; - | ^ expected one of `>`, const, lifetime, or type + | ^ expected one of `>`, a const expression, lifetime, or type error: aborting due to previous error diff --git a/src/test/ui/issues/issue-20616-6.rs b/src/test/ui/issues/issue-20616-6.rs index 73c75bdc45fb1..a2c45ecec7a4b 100644 --- a/src/test/ui/issues/issue-20616-6.rs +++ b/src/test/ui/issues/issue-20616-6.rs @@ -23,7 +23,7 @@ type Type_5_<'a> = Type_1_<'a, ()>; type Type_6 = Type_5_<'a,,>; -//~^ error: expected one of `>`, const, lifetime, or type, found `,` +//~^ error: expected one of `>`, a const expression, lifetime, or type, found `,` //type Type_7 = Box<(),,>; // error: expected type, found `,` diff --git a/src/test/ui/issues/issue-20616-6.stderr b/src/test/ui/issues/issue-20616-6.stderr index ea1c15ba42337..7401abdd091e6 100644 --- a/src/test/ui/issues/issue-20616-6.stderr +++ b/src/test/ui/issues/issue-20616-6.stderr @@ -1,8 +1,8 @@ -error: expected one of `>`, const, lifetime, or type, found `,` +error: expected one of `>`, a const expression, lifetime, or type, found `,` --> $DIR/issue-20616-6.rs:25:26 | LL | type Type_6 = Type_5_<'a,,>; - | ^ expected one of `>`, const, lifetime, or type + | ^ expected one of `>`, a const expression, lifetime, or type error: aborting due to previous error diff --git a/src/test/ui/issues/issue-20616-7.rs b/src/test/ui/issues/issue-20616-7.rs index 8beeebd7a9550..67209c02adffb 100644 --- a/src/test/ui/issues/issue-20616-7.rs +++ b/src/test/ui/issues/issue-20616-7.rs @@ -26,7 +26,7 @@ type Type_5_<'a> = Type_1_<'a, ()>; type Type_7 = Box<(),,>; -//~^ error: expected one of `>`, const, lifetime, or type, found `,` +//~^ error: expected one of `>`, a const expression, lifetime, or type, found `,` //type Type_8<'a,,> = &'a (); // error: expected ident, found `,` diff --git a/src/test/ui/issues/issue-20616-7.stderr b/src/test/ui/issues/issue-20616-7.stderr index dcd199902fc0b..e2c3efe844701 100644 --- a/src/test/ui/issues/issue-20616-7.stderr +++ b/src/test/ui/issues/issue-20616-7.stderr @@ -1,8 +1,8 @@ -error: expected one of `>`, const, lifetime, or type, found `,` +error: expected one of `>`, a const expression, lifetime, or type, found `,` --> $DIR/issue-20616-7.rs:28:22 | LL | type Type_7 = Box<(),,>; - | ^ expected one of `>`, const, lifetime, or type + | ^ expected one of `>`, a const expression, lifetime, or type error: aborting due to previous error diff --git a/src/test/ui/parser/removed-syntax-uniq-mut-ty.rs b/src/test/ui/parser/removed-syntax-uniq-mut-ty.rs index f9a9d071a3d1b..a8dee5bbda40a 100644 --- a/src/test/ui/parser/removed-syntax-uniq-mut-ty.rs +++ b/src/test/ui/parser/removed-syntax-uniq-mut-ty.rs @@ -1,2 +1,2 @@ type mut_box = Box; -//~^ ERROR expected one of `>`, const, lifetime, or type, found keyword `mut` +//~^ ERROR expected one of `>`, a const expression, lifetime, or type, found keyword `mut` diff --git a/src/test/ui/parser/removed-syntax-uniq-mut-ty.stderr b/src/test/ui/parser/removed-syntax-uniq-mut-ty.stderr index 0703caf5beddd..39db0be9fbbd6 100644 --- a/src/test/ui/parser/removed-syntax-uniq-mut-ty.stderr +++ b/src/test/ui/parser/removed-syntax-uniq-mut-ty.stderr @@ -1,8 +1,8 @@ -error: expected one of `>`, const, lifetime, or type, found keyword `mut` +error: expected one of `>`, a const expression, lifetime, or type, found keyword `mut` --> $DIR/removed-syntax-uniq-mut-ty.rs:1:20 | LL | type mut_box = Box; - | ^^^ expected one of `>`, const, lifetime, or type + | ^^^ expected one of `>`, a const expression, lifetime, or type error: aborting due to previous error