Fix a wrong error message in 2024 edition#140056
Conversation
| @@ -1,4 +1,4 @@ | |||
| warning: creating a shared reference to mutable static is discouraged | |||
| warning: creating a shared reference to mutable static is not allowed | |||
There was a problem hiding this comment.
I would like to ask if we should keep the error message as "discouraged" here (or other tests related to 2021 Edition) since my update will change the existing message in 2021 Edition 🤔 This is the first time to contribute the diagnostic issue, it would be nice if someone could tell me about the compatibility thing.
There was a problem hiding this comment.
The easy way is to reword this message to...
warning: creating a shared reference to mutable static
that way, it doesn't really matter if it's Edition 2021 / 2024.
The more complex way is to introduce different diagnostics between edition < 2024 and edition >= 2024, with edition 2021 wording being
warning: creating a shared reference to mutable static is discouraged
and edition 2024 wording being
error: creating a shared reference to mutable static is not allowed
There was a problem hiding this comment.
I agree that creating a shared reference to mutable static is better.
The warning: and error: will be enough information to let people know whether it's discouraged or not allowed.
("error" implies not being allowed and "warning" implies being discouraged)
There was a problem hiding this comment.
a8ec2f7 to
01eb091
Compare
This comment has been minimized.
This comment has been minimized.
01eb091 to
6daa8e9
Compare
This comment has been minimized.
This comment has been minimized.
6daa8e9 to
bffb760
Compare
|
Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
|
@bors r+ rollup |
…llaumeGomez Rollup of 7 pull requests Successful merges: - rust-lang#140056 (Fix a wrong error message in 2024 edition) - rust-lang#140220 (Fix detection of main function if there are expressions around it) - rust-lang#140249 (Remove `weak` alias terminology) - rust-lang#140316 (Introduce `BoxMarker` to improve pretty-printing correctness) - rust-lang#140347 (ci: clean more disk space in codebuild) - rust-lang#140349 (ci: use aws codebuild for the `dist-x86_64-linux` job) - rust-lang#140379 (rustc-dev-guide subtree update) r? `@ghost` `@rustbot` modify labels: rollup
…llaumeGomez Rollup of 7 pull requests Successful merges: - rust-lang#140056 (Fix a wrong error message in 2024 edition) - rust-lang#140220 (Fix detection of main function if there are expressions around it) - rust-lang#140249 (Remove `weak` alias terminology) - rust-lang#140316 (Introduce `BoxMarker` to improve pretty-printing correctness) - rust-lang#140347 (ci: clean more disk space in codebuild) - rust-lang#140349 (ci: use aws codebuild for the `dist-x86_64-linux` job) - rust-lang#140379 (rustc-dev-guide subtree update) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#140056 - yuk1ty:fix-static-mut-error-message, r=jieyouxu Fix a wrong error message in 2024 edition Fixes rust-lang#139952
Fixes #139952