-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
F-inline_constInline constants (aka: const blocks, const expressions, anonymous constants)Inline constants (aka: const blocks, const expressions, anonymous constants)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
The following code:
#![feature(inline_const)]
fn main() {
dbg!(const {});
}
fails to compile, producing this error message:
error: no rules expected the token `const`
--> src/main.rs:4:10
|
4 | dbg!(const {});
| ^^^^^ no rules expected this token in macro call
However, if the entire const {}
is placed in yet another {}
block, it just works:
#![feature(inline_const)]
fn main() {
dbg!({ const {} });
}
osa1 and eclairedelune
Metadata
Metadata
Assignees
Labels
F-inline_constInline constants (aka: const blocks, const expressions, anonymous constants)Inline constants (aka: const blocks, const expressions, anonymous constants)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.