Closed
Description
#![feature(min_const_generics)]
struct Foo<const M: usize>;
macro_rules! baz {
( $x:expr) => {
Foo<$x> //[full]~ ERROR constant expression depends
}
}
fn test<const N: usize>() {
let _: baz!(N);
}
fails with
error: expressions must be enclosed in braces to be used as const generic arguments
--> src/lib.rs:9:17
|
9 | let _: baz!(N);
| ^
|
help: enclose the `const` expression in braces
|
9 | let _: baz!({ N });
|
This should be allowed. See the discussion in https://github.com/rust-lang/rust/pull/78916/files#r520390092 for more details.
As fixing this should allow strictly more code to compile, this won't require a breaking change. I do not consider this to be blocking stabilization.