Code change:
LL |     let _: Wow<{ A.0 }>; |                +     + <ins> error: expected type, found `]` --> $DIR/bad-const-generic-exprs.rs:16:17 | LL |     let _: Wow<[]>; |                 ^ expected type | help: expressions must be enclosed in braces to be used as const generic arguments | LL |     let _: Wow<{ [] }>; |                +    + </ins> error: expected type, found `12` --> $DIR/bad-const-generic-exprs.rs:19:17 | LL |     let _: Wow<[12]>; |                 ^^ expected type <del> error[E0747]: type provided when a constant was expected </del> <ins> error: invalid const generic expression </ins> --> $DIR/bad-const-generic-exprs.rs:19:16 | LL |     let _: Wow<[12]>; |                ^^^^ <ins> | help: expressions must be enclosed in braces to be used as const generic arguments | LL |     let _: Wow<{ [12] }>; |                +      + error: expected type, found `0` --> $DIR/bad-const-generic-exprs.rs:23:17 | LL |     let _: Wow<[0, 1, 3]>; |                 ^ expected type | help: expressions must be enclosed in braces to be used as const generic arguments | LL |     let _: Wow<{ [0, 1, 3] }>; |                +           + error: expected type, found `0xff` --> $DIR/bad-const-generic-exprs.rs:26:17 | LL |     let _: Wow<[0xff; 8]>; |                 ^^^^ expected type error: invalid const generic expression --> $DIR/bad-const-generic-exprs.rs:26:16 | LL |     let _: Wow<[0xff; 8]>; |                ^^^^^^^^^ | help: expressions must be enclosed in braces to be used as const generic arguments | LL |     let _: Wow<{ [0xff; 8] }>; |                +           + error: expected type, found `1` --> $DIR/bad-const-generic-exprs.rs:30:17 | LL |     let _: Wow<[1, 2]>; // Regression test for issue #81698. |                 ^ expected type | help: expressions must be enclosed in braces to be used as const generic arguments | LL |     let _: Wow<{ [1, 2] }>; // Regression test for issue #81698. |                +        + error: expected type, found `0` --> $DIR/bad-const-generic-exprs.rs:33:17 | LL |     let _: Wow<&0>; |                 ^ expected type | help: expressions must be enclosed in braces to be used as const generic arguments | LL |     let _: Wow<{ &0 }>; |                +    + error: expected type, found `""` --> $DIR/bad-const-generic-exprs.rs:36:17 | LL |     let _: Wow<("", 0)>; |                 ^^ expected type | help: expressions must be enclosed in braces to be used as const generic arguments | LL |     let _: Wow<{ ("", 0) }>; |                +         + error: expected type, found `1` --> $DIR/bad-const-generic-exprs.rs:39:17 | LL |     let _: Wow<(1 + 2) * 3>; |                 ^ expected type | help: expressions must be enclosed in braces to be used as const generic arguments | LL |     let _: Wow<{ (1 + 2) * 3 }>; |                +             + error: expected one of `,` or `>`, found `0` --> $DIR/bad-const-generic-exprs.rs:43:17 | LL |     let _: Wow<!0>; |         -       ^ expected one of `,` or `>` |         | |         while parsing the type for `_` | help: you might have meant to end the type parameters here | LL |     let _: Wow<!>0>; |                 + </ins> <del> error: aborting due to 6 previous errors </del> <ins> error: aborting due to 15 previous errors </ins> <del> For more information about this error, try `rustc --explain E0747`. </del>

Related discussion:
text: <!-- Thank you for filing a bug report! Please provide a short summary of the bug, along with any information you feel relevant to replicating the bug. --This is a much abbreviated version of the code from my experiments with adding a shuffle API to the stdsimd repo, it probably needs further reduction but I wanted to file this before I forgot: I expected to see this happen: it works, provides a useful error, or even just ICEs. Instead, this happened: I got a request to input a type instead! And no, that doesn't work either if you put it in, because instead you get: : <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
The fix is Due to parsing ambiguities generic arguments currently need to be put into braces, unless they are really simple (like or ), is not simple enough.
Oh, cool! That does compile! I knew about that but wasn't sure if that was the problem because I thought that was just for expressions? I guess that's technically an array expression? That is none of the errors I was presented with, though, which makes this a diagnostics problem I suppose?
I believe diagnostic for const generic (example taken from ) needs to be improved too before release, at least I thought that can be used instead, if one didn't know about then they need to search it up.
Arrays as const parameters still have bad error messages. same with tuples
claim