-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-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
Given the following code: link
trait Trait { }
module test {
pub constant X: i32 = 123;
pub immutable Y: i32 = 234;
}
implement Trait for () { }
external "Rust" fn foo() { }
fn main() {
let mutable a = 0;
}
The current output is:
Compiling playground v0.0.1 (/playground)
error: expected one of `!` or `::`, found `test`
--> src/main.rs:3:8
|
3 | module test {
| ^^^^ expected one of `!` or `::`
error: could not compile `playground` due to previous error
There are multiple similar issues and all of them are merged (#99903 #99751 #100140). Hence, I think we should extend such behavior to all relevant rust keywords. Additional details are listed below:
module
->mod
constant
->const
immutable
->const
implement
->impl
external
->extern
mutable
->mut
Any of the wrong keywords on the lhs that is used in place of the right one on the rhs, should suggest changing said invalid keyword with the respective valid ones.
fmease
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-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.