about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2018-04-27 12:08:54 +0200
committerJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2018-04-27 12:09:59 +0200
commitf678bf0ababf77ca224c8110bd6aea5569c698da (patch)
tree4af9e4538058abf888bb0701fd1b711601571a43 /src
parent9a5978966305fdb921982db365bf77ac22d090cf (diff)
downloadrust-f678bf0ababf77ca224c8110bd6aea5569c698da.tar.gz
rust-f678bf0ababf77ca224c8110bd6aea5569c698da.zip
Address comments
Diffstat (limited to 'src')
-rw-r--r--src/librustc/ty/maps/config.rs3
-rw-r--r--src/librustc/ty/maps/plumbing.rs12
2 files changed, 9 insertions, 6 deletions
diff --git a/src/librustc/ty/maps/config.rs b/src/librustc/ty/maps/config.rs
index 2f6e7ade89f..57c8c4f34e7 100644
--- a/src/librustc/ty/maps/config.rs
+++ b/src/librustc/ty/maps/config.rs
@@ -35,10 +35,13 @@ pub trait QueryConfig<'tcx> {
     type Value: Clone + for<'a> HashStable<StableHashingContext<'a>>;
 
     fn query(key: Self::Key) -> Query<'tcx>;
+
+    // Don't use this method to access query results, instead use the methods on TyCtxt
     fn query_map<'a>(tcx: TyCtxt<'a, 'tcx, '_>) -> &'a Lock<QueryMap<'tcx, Self>>;
 
     fn to_dep_node(tcx: TyCtxt<'_, 'tcx, '_>, key: &Self::Key) -> DepNode;
 
+    // Don't use this method to compute query results, instead use the methods on TyCtxt
     fn compute(tcx: TyCtxt<'_, 'tcx, '_>, key: Self::Key) -> Self::Value;
 
     fn handle_cycle_error(tcx: TyCtxt<'_, 'tcx, '_>) -> Self::Value;
diff --git a/src/librustc/ty/maps/plumbing.rs b/src/librustc/ty/maps/plumbing.rs
index 83305db57da..37950463f74 100644
--- a/src/librustc/ty/maps/plumbing.rs
+++ b/src/librustc/ty/maps/plumbing.rs
@@ -186,18 +186,18 @@ impl<'a, 'tcx, Q: QueryDescription<'tcx>> JobOwner<'a, 'tcx, Q> {
         // The TyCtxt stored in TLS has the same global interner lifetime
         // as `tcx`, so we use `with_related_context` to relate the 'gcx lifetimes
         // when accessing the ImplicitCtxt
-        let r = tls::with_related_context(tcx, move |icx| {
+        let r = tls::with_related_context(tcx, move |current_icx| {
             // Update the ImplicitCtxt to point to our new query job
-            let icx = tls::ImplicitCtxt {
+            let new_icx = tls::ImplicitCtxt {
                 tcx,
                 query: Some(self.job.clone()),
-                layout_depth: icx.layout_depth,
-                task: icx.task,
+                layout_depth: current_icx.layout_depth,
+                task: current_icx.task,
             };
 
             // Use the ImplicitCtxt while we execute the query
-            tls::enter_context(&icx, |icx| {
-                compute(icx.tcx)
+            tls::enter_context(&new_icx, |_| {
+                compute(tcx)
             })
         });