diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2020-07-09 11:50:32 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-09 11:50:32 -0700 |
| commit | 89c9e970ddbe47622bcc52b135d35508510daa55 (patch) | |
| tree | a3d85f853606c2815705ac3b240022efdc4faac2 /src/librustc_errors/json | |
| parent | 07301e3d549f3f41a3d0a9f31aade293a3b9a3af (diff) | |
| parent | 81c5bb6a3fb02d1c1c3a4698e9e0e031ef2f4e4e (diff) | |
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
Diffstat (limited to 'src/librustc_errors/json')
| -rw-r--r-- | src/librustc_errors/json/tests.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/librustc_errors/json/tests.rs b/src/librustc_errors/json/tests.rs index a2ed6ad6f35..dcfcdbc63f2 100644 --- a/src/librustc_errors/json/tests.rs +++ b/src/librustc_errors/json/tests.rs @@ -39,16 +39,16 @@ impl<T: Write> Write for Shared<T> { } } -fn with_default_globals(f: impl FnOnce()) { - let globals = rustc_span::Globals::new(rustc_span::edition::DEFAULT_EDITION); - rustc_span::GLOBALS.set(&globals, || rustc_span::GLOBALS.set(&globals, f)) +fn with_default_session_globals(f: impl FnOnce()) { + let session_globals = rustc_span::SessionGlobals::new(rustc_span::edition::DEFAULT_EDITION); + rustc_span::SESSION_GLOBALS.set(&session_globals, f); } /// Test the span yields correct positions in JSON. fn test_positions(code: &str, span: (u32, u32), expected_output: SpanTestData) { let expected_output = TestData { spans: vec![expected_output] }; - with_default_globals(|| { + with_default_session_globals(|| { let sm = Lrc::new(SourceMap::new(FilePathMapping::empty())); sm.new_source_file(Path::new("test.rs").to_owned().into(), code.to_owned()); |
