Rework SESSION_GLOBALS API to prevent overwriting it

This commit is contained in:
Guillaume Gomez
2021-05-05 21:31:25 +02:00
committed by Guillaume Gomez
parent 0cd0709f19
commit a2654fb64c
27 changed files with 146 additions and 100 deletions

View File

@@ -144,8 +144,7 @@ fn format_align_fill() {
}
#[test]
fn format_counts() {
use rustc_span::{edition, SessionGlobals, SESSION_GLOBALS};
SESSION_GLOBALS.set(&SessionGlobals::new(edition::DEFAULT_EDITION), || {
rustc_span::create_default_session_globals_then(|| {
same(
"{:10x}",
&[NextArgument(Argument {