-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Closed
Copy link
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-edition-2024Area: The 2024 editionArea: The 2024 editionA-patternsRelating to patterns and pattern matchingRelating to patterns and pattern matchingC-bugCategory: This is a bug.Category: This is a bug.I-edition-triagedIssue: This issue has been reviewed and triaged by the Edition team.Issue: This issue has been reviewed and triaged by the Edition team.
Description
In Rust 2024, the following error message is emitted:
//@ edition: 2024
fn main() {
let [&_x] = &mut [&()];
//~^ ERROR this pattern relies on behavior which may change in edition 2024
//~| ERROR cannot implicitly match against multiple layers of reference
//~| NOTE make the implied reference pattern explicit
}
This message isn't great. The problem isn't really that the behavior may change in Rust 2024, it's that this is simply disallowed (starting in Rust 2024).
We should probably also remove the bit about "implicitly matching against multiple layers of references". If someone is in the Rust 2024 headspace, this isn't necessarily what the person was trying to do in writing this.
Tracking:
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-edition-2024Area: The 2024 editionArea: The 2024 editionA-patternsRelating to patterns and pattern matchingRelating to patterns and pattern matchingC-bugCategory: This is a bug.Category: This is a bug.I-edition-triagedIssue: This issue has been reviewed and triaged by the Edition team.Issue: This issue has been reviewed and triaged by the Edition team.