Skip to content
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

Suggest const and static for global variable #100396

Merged
merged 1 commit into from
Aug 12, 2022

Conversation

chenyukang
Copy link
Member

Fixing #100394

@rust-highfive
Copy link
Collaborator

r? @petrochenkov

(rust-highfive has picked a reviewer for you, use r? to override)

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Aug 11, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 11, 2022
@est31
Copy link
Member

est31 commented Aug 11, 2022

The other question is if a const is always the right suggestion, maybe static is better in some cases?

@chenyukang
Copy link
Member Author

The other question is if a const is always the right suggestion, maybe static is better in some cases?

Yes, I think we can only give a suggestion to use const or static for global variables.

@chenyukang chenyukang changed the title Suggest const for global variable Suggest const and static for global variable Aug 11, 2022
@rust-log-analyzer

This comment has been minimized.

@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Aug 11, 2022

📌 Commit 98518c2 has been approved by petrochenkov

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 11, 2022
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Aug 12, 2022
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Aug 12, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 12, 2022
Rollup of 9 pull requests

Successful merges:

 - rust-lang#100022 (Optimize thread ID generation)
 - rust-lang#100030 (cleanup code w/ pointers in std a little)
 - rust-lang#100229 (add -Zextra-const-ub-checks to enable more UB checking in const-eval)
 - rust-lang#100247 (Generalize trait object generic param check to aliases.)
 - rust-lang#100255 (Adding more verbose documentation for `std::fmt::Write`)
 - rust-lang#100366 (errors: don't fail on broken primary translations)
 - rust-lang#100396 (Suggest const and static for global variable)
 - rust-lang#100409 (rustdoc: don't generate DOM element for operator)
 - rust-lang#100443 (Add two let else regression tests)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 9914c96 into rust-lang:master Aug 12, 2022
@rustbot rustbot added this to the 1.65.0 milestone Aug 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants