[WIP] rustc_mir: disallow global mutable state in proc macros.#63831
[WIP] rustc_mir: disallow global mutable state in proc macros.#63831eddyb wants to merge 1 commit intorust-lang:masterfrom
Conversation
|
(rust_highfive has picked a reviewer for you, use r? to override) |
|
@bors try |
[WIP] rustc_mir: disallow global mutable state in proc macros. Along the lines of #63809, this PR attempts to get rid of the main (or only?) place `proc_macro` handles could be leaked to, *and* further disallow/discourage sharing (other) state between invocations. The approach of banning (interior-)mutable `static`s was most recently mentioned in #63804 (comment), but it's likely been brought up several times, we just never tried it. (Note that this is not foolproof: one would have to scan all dependencies for such `static`s, modulo `proc_macro`/`std`, and even then it's possible there would be a lot of false positives) So this is mostly for a check-only crater run, to see what (if anything) breaks.
|
☀️ Try build successful - checks-azure |
|
@craterbot run mode=check-only |
|
@craterbot run mode=check-only |
|
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
|
@craterbot crates=full |
|
📝 Configuration of the ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
ee8492f to
55f3acf
Compare
|
@craterbot abort |
|
🗑️ Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
60: core: Remove usage of mutable global state r=taiki-e a=taiki-e It may be a warning in the future. So, use the hash value of the input AST instead of PRNG. See rust-lang/rust#64398 (comment) and rust-lang/rust#63831. Co-authored-by: Taiki Endo <te316e89@gmail.com>
|
Crater completed in #64398, marking as waiting on author to decide what to do (or not to do) next. |
|
Regressed crates list is here. |
|
The new functionality around crate lists has been deployed @eddyb. The following invocation should work (I don't have craterbot permissions): @craterbot check crates=https://gist.githubusercontent.com/ecstatic-morse/ca6fe943de6937db635143472358d90d/raw/177739189815b3c52a7f69b494dbb91ea2d25e1d/gistfile1.txt |
|
🔒 Error: you're not allowed to interact with this bot. 🔑 If you are a member of the Rust team and need access, add yourself to the whitelist. |
|
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
|
@craterbot p=1 since this is such a small run |
|
🚨 Error: failed to parse the command 🆘 If you have any trouble with Crater please ping |
|
@craterbot p=1 |
|
📝 Configuration of the ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
|
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
|
🎉 Experiment
|
|
Marking as waiting on author to triage the regressions. |
|
Ping from triage Thanks |
|
I can't think of a good way to categorize uses of interior mutability in We probably can't do much here, and sandboxing (e.g. via WASM) will likely be opt-in. |
Along the lines of #63809, this PR attempts to get rid of the main (or only?) place
proc_macrohandles could be leaked to, and further disallow/discourage sharing (other) state between invocations.The approach of banning (interior-)mutable
statics was most recently mentioned in #63804 (comment), but it's likely been brought up several times, we just never tried it.(Note that this is not foolproof: one would have to scan all dependencies for such
statics, moduloproc_macro/std, and even then it's possible there would be a lot of false positives)So this is mostly for a check-only crater run, to see what (if anything) breaks.