Closed
Description
When writing public let some = 3;
it will suggest pub let some = 3;
and I think nothing should be suggested before it is validated.
Note:
The statement to be suggested must be checked if it is true or not, if true it is suggested and if not it is not.
The issue from: #99903
fn main() {
public let some = 3;
}
The current output is:
Compiling playground v0.0.1 (/playground)
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found keyword `let`
--> src/main.rs:2:12
|
2 | public let some = 3;
| ^^^ expected one of 8 possible tokens
|
help: write `pub` instead of `public` to make the item public
|
2 | pub let some = 3;
| ~~~
error: could not compile `playground` due to previous error
Ideally the output should look like:
Compiling playground v0.0.1 (/playground)
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found keyword `let`
--> src/main.rs:2:12
|
2 | public let some = 3;
| ^^^ expected one of 8 possible tokens
error: could not compile `playground` due to previous error