about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2021-05-05 21:31:25 +0200
committerGuillaume Gomez <guillaume.gomez@huawei.com>2021-07-08 16:16:28 +0200
commitabf449ffa657ab10c274595c1d3ec7a69bf801c3 (patch)
tree93a49ede5cd926b5b438cf918762f91bfad3941e /src
parent33acc960f78cfde092a4e720c01896fbff86cdc8 (diff)
downloadrust-abf449ffa657ab10c274595c1d3ec7a69bf801c3.tar.gz
rust-abf449ffa657ab10c274595c1d3ec7a69bf801c3.zip
Rework SESSION_GLOBALS API to prevent overwriting it
Diffstat (limited to 'src')
-rw-r--r--src/formatting.rs2
1 files changed, 1 insertions, 1 deletions
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 {