-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Fix a wrong error message in 2024 edition #140056
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a8ec2f7
to
01eb091
Compare
This comment has been minimized.
This comment has been minimized.
01eb091
to
6daa8e9
Compare
The job Click to see the possible cause of the failure (guessed by this bot)
|
Fixes #139952