Avoid function-scoping global variables#75958
Merged
bors merged 1 commit intorust-lang:masterfrom Aug 27, 2020
Merged
Conversation
In 2e6f2e8, we added a main function to the publish_toolstate.py script. Unfortunately, we missed that the Python program implicitly declares global variables in that code, which means that adding a function changes variable scoping and breaks other code. This commit avoids introducing that function and adds a warning to future editors of the code.
Contributor
|
(rust_highfive has picked a reviewer for you, use r? to override) |
kennytm
approved these changes
Aug 26, 2020
Member
kennytm
left a comment
There was a problem hiding this comment.
using the global github_token inside issue() is an oversight (others are passed as arguments). but we haven't statically checked which other variables are still accessed globally. so we gotta workaround like this for now :(
Member
|
@bors r+ |
Collaborator
|
📌 Commit c8b2402 has been approved by |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Aug 27, 2020
Rollup of 10 pull requests Successful merges: - rust-lang#74730 (Hexagon libstd: update type defs) - rust-lang#75758 (Fixes for VxWorks) - rust-lang#75780 (Unconfuse Unpin docs a bit) - rust-lang#75806 (Prevent automatic page change when using history) - rust-lang#75818 (Update docs for SystemTime Windows implementation) - rust-lang#75837 (Fix font color for help button in ayu and dark themes) - rust-lang#75870 (Unify theme choices border color in ayu theme) - rust-lang#75875 (Shorten liballoc vec resize intra-doc link) - rust-lang#75953 (Fix swapped stability attributes for rustdoc lints) - rust-lang#75958 (Avoid function-scoping global variables) Failed merges: r? @ghost
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In 2e6f2e8, we added a main function to the publish_toolstate.py script.
Unfortunately, we missed that the Python program implicitly declares global
variables in that code, which means that adding a function changes variable
scoping and breaks other code.
This commit avoids introducing that function and adds a warning to future
editors of the code.