Rollup merge of #74079 - nnethercote:session-globals, r=nikomatsakis

Eliminate confusing "globals" terminology.

There are some structures that are called "globals", but are they global
to a compilation session, and not truly global. I have always found this
highly confusing, so this commit renames them as "session globals" and
adds a comment explaining things.

Also, the commit fixes an unnecessary nesting of `set()` calls
`src/librustc_errors/json/tests.rs`

r? @Aaron1011
This commit is contained in:
Manish Goregaokar 2020-07-09 11:50:32 -07:00 committed by GitHub
commit 89c9e970dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 136 additions and 127 deletions

View file

@ -19,7 +19,7 @@ use std::path::Path;
mod gravy;
pub fn main() {
rustc_ast::with_default_globals(|| parse());
rustc_ast::with_default_session_globals(|| parse());
assert_eq!(gravy::foo(), 10);
}

View file

@ -208,7 +208,7 @@ impl MutVisitor for AddParens {
}
fn main() {
rustc_ast::with_default_globals(|| run());
rustc_ast::with_default_session_globals(|| run());
}
fn run() {