about summary refs log tree commit diff
path: root/src/librustc
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-09-26 01:22:16 +0200
committerMazdak Farrokhzad <twingoow@gmail.com>2019-09-27 19:48:07 +0200
commitdfd365f3e4fed3df101bd2d3ea01c494f40bd345 (patch)
tree4c8f409ee224739300114c1844544c8240cefe47 /src/librustc
parentdefd5088d616bb324c92069b2c1129b76bc0ff94 (diff)
downloadrust-dfd365f3e4fed3df101bd2d3ea01c494f40bd345.tar.gz
rust-dfd365f3e4fed3df101bd2d3ea01c494f40bd345.zip
cleanup dead ast-borrowck / migrate-mode code.
Diffstat (limited to 'src/librustc')
-rw-r--r--src/librustc/arena.rs1
-rw-r--r--src/librustc/infer/mod.rs2
-rw-r--r--src/librustc/lib.rs1
-rw-r--r--src/librustc/middle/borrowck.rs31
-rw-r--r--src/librustc/query/mod.rs4
-rw-r--r--src/librustc/session/config.rs8
-rw-r--r--src/librustc/ty/context.rs6
-rw-r--r--src/librustc/ty/query/mod.rs1
8 files changed, 2 insertions, 52 deletions
diff --git a/src/librustc/arena.rs b/src/librustc/arena.rs
index d4fc1b12830..5d06f62f446 100644
--- a/src/librustc/arena.rs
+++ b/src/librustc/arena.rs
@@ -86,7 +86,6 @@ macro_rules! arena_types {
                     rustc::infer::canonical::QueryResponse<'tcx, rustc::ty::Ty<'tcx>>
                 >,
             [few] crate_inherent_impls: rustc::ty::CrateInherentImpls,
-            [decode] borrowck: rustc::middle::borrowck::BorrowCheckResult,
             [few] upstream_monomorphizations:
                 rustc::util::nodemap::DefIdMap<
                     rustc_data_structures::fx::FxHashMap<
diff --git a/src/librustc/infer/mod.rs b/src/librustc/infer/mod.rs
index ca07496afed..81183dc1f79 100644
--- a/src/librustc/infer/mod.rs
+++ b/src/librustc/infer/mod.rs
@@ -93,6 +93,8 @@ impl SuppressRegionErrors {
     /// checks, so we should ignore errors if NLL is (unconditionally)
     /// enabled.
     pub fn when_nll_is_enabled(tcx: TyCtxt<'_>) -> Self {
+        // FIXME(Centril): Once we actually remove `::Migrate` also make
+        // this always `true` and then proceed to eliminate the dead code.
         match tcx.borrowck_mode() {
             // If we're on Migrate mode, report AST region errors
             BorrowckMode::Migrate => SuppressRegionErrors { suppressed: false },
diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs
index 7a01ae6b6d9..bd9899b644b 100644
--- a/src/librustc/lib.rs
+++ b/src/librustc/lib.rs
@@ -100,7 +100,6 @@ pub mod infer;
 pub mod lint;
 
 pub mod middle {
-    pub mod borrowck;
     pub mod expr_use_visitor;
     pub mod cstore;
     pub mod dead;
diff --git a/src/librustc/middle/borrowck.rs b/src/librustc/middle/borrowck.rs
deleted file mode 100644
index 60c24eeae7b..00000000000
--- a/src/librustc/middle/borrowck.rs
+++ /dev/null
@@ -1,31 +0,0 @@
-use crate::ich::StableHashingContext;
-
-use rustc_data_structures::stable_hasher::{HashStable, StableHasher,
-                                           StableHasherResult};
-
-#[derive(Copy, Clone, Debug, RustcEncodable, RustcDecodable)]
-pub enum SignalledError { SawSomeError, NoErrorsSeen }
-
-impl Default for SignalledError {
-    fn default() -> SignalledError {
-        SignalledError::NoErrorsSeen
-    }
-}
-
-impl_stable_hash_for!(enum self::SignalledError { SawSomeError, NoErrorsSeen });
-
-#[derive(Debug, Default, RustcEncodable, RustcDecodable)]
-pub struct BorrowCheckResult {
-    pub signalled_any_error: SignalledError,
-}
-
-impl<'a> HashStable<StableHashingContext<'a>> for BorrowCheckResult {
-    fn hash_stable<W: StableHasherResult>(&self,
-                                          hcx: &mut StableHashingContext<'a>,
-                                          hasher: &mut StableHasher<W>) {
-        let BorrowCheckResult {
-            ref signalled_any_error,
-        } = *self;
-        signalled_any_error.hash_stable(hcx, hasher);
-    }
-}
diff --git a/src/librustc/query/mod.rs b/src/librustc/query/mod.rs
index 6de351fa13a..4b1558592ae 100644
--- a/src/librustc/query/mod.rs
+++ b/src/librustc/query/mod.rs
@@ -397,10 +397,6 @@ rustc_queries! {
     }
 
     BorrowChecking {
-        query borrowck(key: DefId) -> &'tcx BorrowCheckResult {
-            cache_on_disk_if { key.is_local() }
-        }
-
         /// Borrow-checks the function body. If this is a closure, returns
         /// additional requirements that the closure's creator must verify.
         query mir_borrowck(key: DefId) -> mir::BorrowCheckResult<'tcx> {
diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs
index b4fe550067a..cbb22f1e448 100644
--- a/src/librustc/session/config.rs
+++ b/src/librustc/session/config.rs
@@ -478,14 +478,6 @@ impl BorrowckMode {
             BorrowckMode::Migrate => true,
         }
     }
-
-    /// Returns whether we should emit the AST-based borrow checker errors.
-    pub fn use_ast(self) -> bool {
-        match self {
-            BorrowckMode::Mir => false,
-            BorrowckMode::Migrate => false,
-        }
-    }
 }
 
 pub enum Input {
diff --git a/src/librustc/ty/context.rs b/src/librustc/ty/context.rs
index 3c511cb4d18..ad3fee17166 100644
--- a/src/librustc/ty/context.rs
+++ b/src/librustc/ty/context.rs
@@ -1435,12 +1435,6 @@ impl<'tcx> TyCtxt<'tcx> {
         self.queries.on_disk_cache.serialize(self.global_tcx(), encoder)
     }
 
-    /// If `true`, we should use the AST-based borrowck (we may *also* use
-    /// the MIR-based borrowck).
-    pub fn use_ast_borrowck(self) -> bool {
-        self.borrowck_mode().use_ast()
-    }
-
     /// If `true`, we should use the MIR-based borrowck, but also
     /// fall back on the AST borrowck if the MIR-based one errors.
     pub fn migrate_borrowck(self) -> bool {
diff --git a/src/librustc/ty/query/mod.rs b/src/librustc/ty/query/mod.rs
index f4b99ca3688..f559cde4b03 100644
--- a/src/librustc/ty/query/mod.rs
+++ b/src/librustc/ty/query/mod.rs
@@ -4,7 +4,6 @@ use crate::hir::def::{DefKind, Export};
 use crate::hir::{self, TraitCandidate, ItemLocalId, CodegenFnAttrs};
 use crate::infer::canonical::{self, Canonical};
 use crate::lint;
-use crate::middle::borrowck::BorrowCheckResult;
 use crate::middle::cstore::{ExternCrate, LinkagePreference, NativeLibrary, ForeignModule};
 use crate::middle::cstore::{NativeLibraryKind, DepKind, CrateSource};
 use crate::middle::privacy::AccessLevels;