From abf449ffa657ab10c274595c1d3ec7a69bf801c3 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 5 May 2021 21:31:25 +0200 Subject: Rework SESSION_GLOBALS API to prevent overwriting it --- src/formatting.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/formatting.rs b/src/formatting.rs index b69ecdc5cb8..e0403574eeb 100644 --- a/src/formatting.rs +++ b/src/formatting.rs @@ -34,7 +34,7 @@ impl<'b, T: Write + 'b> Session<'b, T> { return Err(ErrorKind::VersionMismatch); } - rustc_span::with_session_globals(self.config.edition().into(), || { + rustc_span::create_session_if_not_set_then(self.config.edition().into(), |_| { if self.config.disable_all_formatting() { // When the input is from stdin, echo back the input. if let Input::Text(ref buf) = input { -- cgit 1.4.1-3-g733a5