-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTT-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
Code
fn f(x: u8 = 0) {}
Current output
error: expected parameter name, found `=`
--> src/lib.rs:1:12
|
1 | fn f(x: u8 = 0) {
| ^ expected parameter name
error: expected one of `!`, `(`, `)`, `+`, `,`, `::`, or `<`, found `=`
--> src/lib.rs:1:12
|
1 | fn f(x: u8 = 0) {
| -^ expected one of 7 possible tokens
| |
| help: missing `,`
Desired output
error: default function parameters are not supported
Rationale and extra context
especially since #![feature(default_field_values)]
uses the same syntax, this seems plausible to try
Other cases
Rust Version
1.87.0-nightly
(2025-02-19 f280acf4c743806abbbb)
Anything else?
No response
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTT-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.