-
Notifications
You must be signed in to change notification settings - Fork 14k
Closed
Labels
A-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTC-bugCategory: This is a bug.Category: This is a bug.I-needs-decisionIssue: In need of a decision.Issue: In need of a decision.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 results in a parsing error where the 0 character is unexpected.
fn get_usize() -> usize {
#[cfg(not(debug_assertions))]
0
#[cfg(debug_assertions)]
1
}However, the following code works fine:
fn get_usize_return() -> usize {
#[cfg(not(debug_assertions))]
return 0;
#[cfg(debug_assertions)]
1
}I think this is a bug in the parser?
kennytm
Metadata
Metadata
Assignees
Labels
A-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTC-bugCategory: This is a bug.Category: This is a bug.I-needs-decisionIssue: In need of a decision.Issue: In need of a decision.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.