about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/librustc/ty/query/plumbing.rs8
-rw-r--r--src/librustc_query_system/Cargo.toml1
-rw-r--r--src/librustc_query_system/query/config.rs7
-rw-r--r--src/librustc_query_system/query/plumbing.rs2
4 files changed, 9 insertions, 9 deletions
diff --git a/src/librustc/ty/query/plumbing.rs b/src/librustc/ty/query/plumbing.rs
index 8cdc1ae27ee..c60fdd2f4fc 100644
--- a/src/librustc/ty/query/plumbing.rs
+++ b/src/librustc/ty/query/plumbing.rs
@@ -13,15 +13,17 @@ use rustc_data_structures::fx::FxHashMap;
 use rustc_data_structures::sync::Lock;
 use rustc_data_structures::thin_vec::ThinVec;
 use rustc_errors::{struct_span_err, Diagnostic, DiagnosticBuilder, Handler, Level};
-use rustc_session::Session;
 use rustc_span::def_id::DefId;
 use rustc_span::Span;
 
 impl QueryContext for TyCtxt<'tcx> {
     type Query = Query<'tcx>;
 
-    fn session(&self) -> &Session {
-        &self.sess
+    fn incremental_verify_ich(&self) -> bool {
+        self.sess.opts.debugging_opts.incremental_verify_ich
+    }
+    fn verbose(&self) -> bool {
+        self.sess.verbose()
     }
 
     fn def_path_str(&self, def_id: DefId) -> String {
diff --git a/src/librustc_query_system/Cargo.toml b/src/librustc_query_system/Cargo.toml
index 6304e632b51..e1657a8f3c6 100644
--- a/src/librustc_query_system/Cargo.toml
+++ b/src/librustc_query_system/Cargo.toml
@@ -17,7 +17,6 @@ rustc_errors = { path = "../librustc_errors" }
 rustc_index = { path = "../librustc_index" }
 rustc_macros = { path = "../librustc_macros" }
 rustc_serialize = { path = "../libserialize", package = "serialize" }
-rustc_session = { path = "../librustc_session" }
 rustc_span = { path = "../librustc_span" }
 parking_lot = "0.9"
 smallvec = { version = "1.0", features = ["union", "may_dangle"] }
diff --git a/src/librustc_query_system/query/config.rs b/src/librustc_query_system/query/config.rs
index 106688d2b54..46a48a31161 100644
--- a/src/librustc_query_system/query/config.rs
+++ b/src/librustc_query_system/query/config.rs
@@ -15,7 +15,6 @@ use rustc_data_structures::stable_hasher::HashStable;
 use rustc_data_structures::sync::Lock;
 use rustc_data_structures::thin_vec::ThinVec;
 use rustc_errors::Diagnostic;
-use rustc_session::Session;
 use std::borrow::Cow;
 use std::fmt::Debug;
 use std::hash::Hash;
@@ -33,8 +32,8 @@ pub trait QueryConfig<CTX> {
 pub trait QueryContext: DepContext {
     type Query: Clone + HashStable<Self::StableHashingContext>;
 
-    /// Access the session.
-    fn session(&self) -> &Session;
+    fn incremental_verify_ich(&self) -> bool;
+    fn verbose(&self) -> bool;
 
     /// Get string representation from DefPath.
     fn def_path_str(&self, def_id: DefId) -> String;
@@ -101,7 +100,7 @@ where
     M: QueryAccessors<CTX, Key = DefId>,
 {
     default fn describe(tcx: CTX, def_id: DefId) -> Cow<'static, str> {
-        if !tcx.session().verbose() {
+        if !tcx.verbose() {
             format!("processing `{}`", tcx.def_path_str(def_id)).into()
         } else {
             let name = ::std::any::type_name::<M>();
diff --git a/src/librustc_query_system/query/plumbing.rs b/src/librustc_query_system/query/plumbing.rs
index b3187ba9189..97b68042039 100644
--- a/src/librustc_query_system/query/plumbing.rs
+++ b/src/librustc_query_system/query/plumbing.rs
@@ -514,7 +514,7 @@ where
 
     // If `-Zincremental-verify-ich` is specified, re-hash results from
     // the cache and make sure that they have the expected fingerprint.
-    if unlikely!(tcx.session().opts.debugging_opts.incremental_verify_ich) {
+    if unlikely!(tcx.incremental_verify_ich()) {
         incremental_verify_ich::<Q, _>(tcx, &result, dep_node, dep_node_index);
     }