Skip to content

Commit

Permalink
Rename current_gcx_
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoxc committed Oct 1, 2023
1 parent 3bb7aa3 commit b555ae8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions compiler/rustc_interface/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,8 @@ pub(crate) fn run_in_thread_pool_with_globals<F: FnOnce(CurrentGcx) -> R + Send,
});
}

let current_gcx = CurrentGcx::new();
let current_gcx_ = FromDyn::from(current_gcx.clone());
let current_gcx = FromDyn::from(current_gcx);
let current_gcx = FromDyn::from(CurrentGcx::new());
let current_gcx2 = current_gcx.clone();

let mut builder = rayon::ThreadPoolBuilder::new()
.thread_name(|_| "rustc".to_string())
Expand All @@ -220,7 +219,7 @@ pub(crate) fn run_in_thread_pool_with_globals<F: FnOnce(CurrentGcx) -> R + Send,

// Get a `GlobalCtxt` reference from `CurrentGcx` as we cannot rely on having a
// `TyCtxt` TLS reference here.
let query_map = current_gcx_.access(|gcx| {
let query_map = current_gcx2.access(|gcx| {
tls::enter_context(&tls::ImplicitCtxt::new(gcx), || {
tls::with(|tcx| {
QueryCtxt::new(tcx)
Expand Down

0 comments on commit b555ae8

Please sign in to comment.