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

tighten CTFE safety net for accesses to globals #70947

Merged
merged 2 commits into from
Apr 15, 2020

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented Apr 9, 2020

Previously, we only rejected reading from all statics. Now we also reject reading from any mutable global. Mutable globals are the true culprit here as their run-time value might be different from their compile-time values. Statics are just the approximation we use for that so far.

Also refactor the code a bit to make it clearer what is being checked and allowed.

r? @oli-obk

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 9, 2020
@oli-obk
Copy link
Contributor

oli-obk commented Apr 14, 2020

@bors r+

@bors
Copy link
Contributor

bors commented Apr 14, 2020

📌 Commit a1f7e9a has been approved by oli-obk

@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 Apr 14, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 15, 2020
Rollup of 8 pull requests

Successful merges:

 - rust-lang#70657 (Allow `try`-blocks in places where an open delim is expected)
 - rust-lang#70947 (tighten CTFE safety net for accesses to globals)
 - rust-lang#70949 (simplify `vec!` macro)
 - rust-lang#71002 (fix target & runtool args order)
 - rust-lang#71082 (ptr: introduce len() method on raw slices)
 - rust-lang#71128 (Remove unused single_step flag)
 - rust-lang#71133 (Tighten time complexity on the doc of sort_by_key)
 - rust-lang#71135 (Update books)

Failed merges:

r? @ghost
@bors bors merged commit b5dc6e6 into rust-lang:master Apr 15, 2020
@RalfJung RalfJung deleted the ctfe-no-read-mut-global branch April 15, 2020 10:15
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants