diff options
| author | bors <bors@rust-lang.org> | 2021-07-08 17:51:10 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-07-08 17:51:10 +0000 |
| commit | aa65b08b1dbaf4b637847646801ebc8c01d7ecbd (patch) | |
| tree | 9828a028f1c2c73ed4f8c85959c7eebb747ecc48 /compiler/rustc_errors/src | |
| parent | d0485c7986e0dac6ffd0207aba56467cb9378d85 (diff) | |
| parent | 60566820b3800036a00e2b7e5787b8c816dc2342 (diff) | |
| download | rust-aa65b08b1dbaf4b637847646801ebc8c01d7ecbd.tar.gz rust-aa65b08b1dbaf4b637847646801ebc8c01d7ecbd.zip | |
Auto merge of #86982 - GuillaumeGomez:rollup-7sbye3c, r=GuillaumeGomez
Rollup of 8 pull requests Successful merges: - #84961 (Rework SESSION_GLOBALS API) - #86726 (Use diagnostic items instead of lang items for rfc2229 migrations) - #86789 (Update BTreeSet::drain_filter documentation) - #86838 (Checking that function is const if marked with rustc_const_unstable) - #86903 (Fix small headers display) - #86913 (Document rustdoc with `--document-private-items`) - #86957 (Update .mailmap file) - #86971 (mailmap: Add alternative addresses for myself) Failed merges: - #86869 (Account for capture kind in auto traits migration) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_errors/src')
| -rw-r--r-- | compiler/rustc_errors/src/json/tests.rs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/compiler/rustc_errors/src/json/tests.rs b/compiler/rustc_errors/src/json/tests.rs index e69e868c8ed..d055937ac36 100644 --- a/compiler/rustc_errors/src/json/tests.rs +++ b/compiler/rustc_errors/src/json/tests.rs @@ -39,16 +39,11 @@ impl<T: Write> Write for Shared<T> { } } -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_session_globals(|| { + rustc_span::create_default_session_globals_then(|| { let sm = Lrc::new(SourceMap::new(FilePathMapping::empty())); sm.new_source_file(Path::new("test.rs").to_owned().into(), code.to_owned()); |
