Permit standalone generic parameters as const generic arguments in macros
This commit is contained in:
parent
c4f836ad1a
commit
efcbf1b00b
5 changed files with 18 additions and 28 deletions
|
|
@ -1,14 +1,3 @@
|
|||
error: expressions must be enclosed in braces to be used as const generic arguments
|
||||
--> $DIR/macro_rules-braces.rs:34:17
|
||||
|
|
||||
LL | let _: baz!(N);
|
||||
| ^
|
||||
|
|
||||
help: enclose the `const` expression in braces
|
||||
|
|
||||
LL | let _: baz!({ N });
|
||||
| ^ ^
|
||||
|
||||
error: expressions must be enclosed in braces to be used as const generic arguments
|
||||
--> $DIR/macro_rules-braces.rs:54:17
|
||||
|
|
||||
|
|
@ -68,5 +57,5 @@ LL | let _: biz!({ N });
|
|||
= note: this may fail depending on what value the parameter takes
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
error: aborting due to 5 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,3 @@
|
|||
error: expressions must be enclosed in braces to be used as const generic arguments
|
||||
--> $DIR/macro_rules-braces.rs:34:17
|
||||
|
|
||||
LL | let _: baz!(N);
|
||||
| ^
|
||||
|
|
||||
help: enclose the `const` expression in braces
|
||||
|
|
||||
LL | let _: baz!({ N });
|
||||
| ^ ^
|
||||
|
||||
error: expressions must be enclosed in braces to be used as const generic arguments
|
||||
--> $DIR/macro_rules-braces.rs:54:17
|
||||
|
|
||||
|
|
@ -52,5 +41,5 @@ LL | let _: biz!({ N });
|
|||
|
|
||||
= help: const parameters may only be used as standalone arguments, i.e. `N`
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
error: aborting due to 5 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ fn test<const N: usize>() {
|
|||
let _: foo!({{ N }}); //[min]~ ERROR generic parameters may not
|
||||
let _: bar!(N);
|
||||
let _: bar!({ N }); //[min]~ ERROR generic parameters may not
|
||||
let _: baz!(N); //~ ERROR expressions must be enclosed in braces
|
||||
let _: baz!(N);
|
||||
let _: baz!({ N });
|
||||
let _: baz!({{ N }}); //[min]~ ERROR generic parameters may not
|
||||
let _: biz!(N);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue