diff --git a/src/librustc/ty/query/job.rs b/src/librustc/ty/query/job.rs index f8bae1673d208..fbcbfae9f8f4f 100644 --- a/src/librustc/ty/query/job.rs +++ b/src/librustc/ty/query/job.rs @@ -435,12 +435,14 @@ pub unsafe fn handle_deadlock() { let syntax_pos_globals = syntax_pos::GLOBALS.with(|syntax_pos_globals| syntax_pos_globals as *const _); let syntax_pos_globals = &*syntax_pos_globals; + let syntax_globals = syntax::GLOBALS.with(|syntax_globals| syntax_globals as *const _); + let syntax_globals = &*syntax_globals; thread::spawn(move || { tls::GCX_PTR.set(gcx_ptr, || { - syntax_pos::GLOBALS.set(syntax_pos_globals, || { + syntax::GLOBALS.set(syntax_globals, || { syntax_pos::GLOBALS .set(syntax_pos_globals, || tls::with_global(|tcx| deadlock(tcx, ®istry))) - }) + }); }) }); }