Skip to content

Commit abf449f

Browse files
Rework SESSION_GLOBALS API to prevent overwriting it
1 parent 33acc96 commit abf449f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/formatting.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ impl<'b, T: Write + 'b> Session<'b, T> {
3434
return Err(ErrorKind::VersionMismatch);
3535
}
3636

37-
rustc_span::with_session_globals(self.config.edition().into(), || {
37+
rustc_span::create_session_if_not_set_then(self.config.edition().into(), |_| {
3838
if self.config.disable_all_formatting() {
3939
// When the input is from stdin, echo back the input.
4040
if let Input::Text(ref buf) = input {

0 commit comments

Comments
 (0)