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`
This commit is contained in:
Nicholas Nethercote 2020-07-06 10:53:14 +10:00
parent 2753fab7ce
commit 81c5bb6a3f
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() {