about summary refs log tree commit diff
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2019-01-05 23:56:43 +0800
committerGitHub <noreply@github.com>2019-01-05 23:56:43 +0800
commitaa83481a5cfe668bdb081a7189204d4819c986ce (patch)
treeefdffa15a2f4b413076f463aed8d8b717e188cf9
parent68614265d312fc2cbe8a696f7dabb9416eb6f221 (diff)
parentafb7c0683415bec312a1ac4679768472fa8ab73b (diff)
downloadrust-aa83481a5cfe668bdb081a7189204d4819c986ce.tar.gz
rust-aa83481a5cfe668bdb081a7189204d4819c986ce.zip
Rollup merge of #57219 - matthewjasper:mir-cleanup, r=nikomatsakis
Remove some unused code

Closes #57096
-rw-r--r--src/librustc/ich/impls_ty.rs16
-rw-r--r--src/librustc/mir/interpret/mod.rs22
-rw-r--r--src/librustc/session/config.rs4
-rw-r--r--src/librustc_mir/dataflow/impls/borrows.rs14
-rw-r--r--src/test/run-pass/generator/yield-subtype.rs1
-rw-r--r--src/test/ui/span/dropck_vec_cycle_checked.nll.stderr6
-rw-r--r--src/test/ui/span/dropck_vec_cycle_checked.rs5
-rw-r--r--src/test/ui/span/dropck_vec_cycle_checked.stderr12
8 files changed, 9 insertions, 71 deletions
diff --git a/src/librustc/ich/impls_ty.rs b/src/librustc/ich/impls_ty.rs
index 57a53d3f09a..ef7fb0128ef 100644
--- a/src/librustc/ich/impls_ty.rs
+++ b/src/librustc/ich/impls_ty.rs
@@ -477,22 +477,6 @@ impl_stable_hash_for!(enum mir::interpret::InboundsCheck {
     MaybeDead
 });
 
-impl_stable_hash_for!(enum mir::interpret::Lock {
-    NoLock,
-    WriteLock(dl),
-    ReadLock(v)
-});
-
-impl_stable_hash_for!(struct mir::interpret::DynamicLifetime {
-    frame,
-    region
-});
-
-impl_stable_hash_for!(enum mir::interpret::AccessKind {
-    Read,
-    Write
-});
-
 impl_stable_hash_for!(enum ty::Variance {
     Covariant,
     Invariant,
diff --git a/src/librustc/mir/interpret/mod.rs b/src/librustc/mir/interpret/mod.rs
index 25a0f0ba489..e6a560b2ad7 100644
--- a/src/librustc/mir/interpret/mod.rs
+++ b/src/librustc/mir/interpret/mod.rs
@@ -29,7 +29,6 @@ use mir;
 use hir::def_id::DefId;
 use ty::{self, TyCtxt, Instance};
 use ty::layout::{self, Size};
-use middle::region;
 use std::io;
 use rustc_serialize::{Encoder, Decodable, Encodable};
 use rustc_data_structures::fx::FxHashMap;
@@ -40,27 +39,6 @@ use ty::codec::TyDecoder;
 use std::sync::atomic::{AtomicU32, Ordering};
 use std::num::NonZeroU32;
 
-#[derive(Clone, Debug, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable)]
-pub enum Lock {
-    NoLock,
-    WriteLock(DynamicLifetime),
-    /// This should never be empty -- that would be a read lock held and nobody
-    /// there to release it...
-    ReadLock(Vec<DynamicLifetime>),
-}
-
-#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable)]
-pub struct DynamicLifetime {
-    pub frame: usize,
-    pub region: Option<region::Scope>, // "None" indicates "until the function ends"
-}
-
-#[derive(Copy, Clone, Debug, PartialEq, Eq, RustcEncodable, RustcDecodable)]
-pub enum AccessKind {
-    Read,
-    Write,
-}
-
 /// Uniquely identifies a specific constant or static.
 #[derive(Copy, Clone, Debug, Eq, PartialEq, Hash, RustcEncodable, RustcDecodable)]
 pub struct GlobalId<'tcx> {
diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs
index 33409f9b4a7..42adc6a87fd 100644
--- a/src/librustc/session/config.rs
+++ b/src/librustc/session/config.rs
@@ -1311,12 +1311,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
         "Disable the instrumentation pre-inliner, useful for profiling / PGO."),
     relro_level: Option<RelroLevel> = (None, parse_relro_level, [TRACKED],
         "choose which RELRO level to use"),
-    nll_subminimal_causes: bool = (false, parse_bool, [UNTRACKED],
-        "when tracking region error causes, accept subminimal results for faster execution."),
     nll_facts: bool = (false, parse_bool, [UNTRACKED],
                        "dump facts from NLL analysis into side files"),
-    disable_nll_user_type_assert: bool = (false, parse_bool, [UNTRACKED],
-        "disable user provided type assertion in NLL"),
     nll_dont_emit_read_for_match: bool = (false, parse_bool, [UNTRACKED],
         "in match codegen, do not include FakeRead statements (used by mir-borrowck)"),
     dont_buffer_diagnostics: bool = (false, parse_bool, [UNTRACKED],
diff --git a/src/librustc_mir/dataflow/impls/borrows.rs b/src/librustc_mir/dataflow/impls/borrows.rs
index 518fbaae627..0ceff4aa048 100644
--- a/src/librustc_mir/dataflow/impls/borrows.rs
+++ b/src/librustc_mir/dataflow/impls/borrows.rs
@@ -279,20 +279,6 @@ impl<'a, 'gcx, 'tcx> BitDenotation<'tcx> for Borrows<'a, 'gcx, 'tcx> {
                     });
 
                     sets.gen(*index);
-
-                    // Issue #46746: Two-phase borrows handles
-                    // stmts of form `Tmp = &mut Borrow` ...
-                    match lhs {
-                        Place::Promoted(_) |
-                        Place::Local(..) | Place::Static(..) => {} // okay
-                        Place::Projection(..) => {
-                            // ... can assign into projections,
-                            // e.g., `box (&mut _)`. Current
-                            // conservative solution: force
-                            // immediate activation here.
-                            sets.gen(*index);
-                        }
-                    }
                 }
             }
 
diff --git a/src/test/run-pass/generator/yield-subtype.rs b/src/test/run-pass/generator/yield-subtype.rs
index c00662e6c01..c38524857b4 100644
--- a/src/test/run-pass/generator/yield-subtype.rs
+++ b/src/test/run-pass/generator/yield-subtype.rs
@@ -3,7 +3,6 @@
 #![allow(dead_code)]
 
 // revisions:lexical nll
-//[nll]compile-flags: -Z disable-nll-user-type-assert
 #![cfg_attr(nll, feature(nll))]
 
 #![feature(generators)]
diff --git a/src/test/ui/span/dropck_vec_cycle_checked.nll.stderr b/src/test/ui/span/dropck_vec_cycle_checked.nll.stderr
index 3d9c9354769..05692515af8 100644
--- a/src/test/ui/span/dropck_vec_cycle_checked.nll.stderr
+++ b/src/test/ui/span/dropck_vec_cycle_checked.nll.stderr
@@ -1,5 +1,5 @@
 error[E0597]: `c2` does not live long enough
-  --> $DIR/dropck_vec_cycle_checked.rs:103:24
+  --> $DIR/dropck_vec_cycle_checked.rs:98:24
    |
 LL |     c1.v[0].v.set(Some(&c2));
    |                        ^^^ borrowed value does not live long enough
@@ -13,7 +13,7 @@ LL | }
    = note: values in a scope are dropped in the opposite order they are defined
 
 error[E0597]: `c3` does not live long enough
-  --> $DIR/dropck_vec_cycle_checked.rs:105:24
+  --> $DIR/dropck_vec_cycle_checked.rs:100:24
    |
 LL |     c1.v[1].v.set(Some(&c3));
    |                        ^^^ borrowed value does not live long enough
@@ -27,7 +27,7 @@ LL | }
    = note: values in a scope are dropped in the opposite order they are defined
 
 error[E0597]: `c1` does not live long enough
-  --> $DIR/dropck_vec_cycle_checked.rs:111:24
+  --> $DIR/dropck_vec_cycle_checked.rs:106:24
    |
 LL |     c3.v[0].v.set(Some(&c1));
    |                        ^^^ borrowed value does not live long enough
diff --git a/src/test/ui/span/dropck_vec_cycle_checked.rs b/src/test/ui/span/dropck_vec_cycle_checked.rs
index 4f627c4270c..c80e0386e6a 100644
--- a/src/test/ui/span/dropck_vec_cycle_checked.rs
+++ b/src/test/ui/span/dropck_vec_cycle_checked.rs
@@ -1,12 +1,7 @@
-// compile-flags: -Z nll-subminimal-causes
-// (Work around rust-lang/rust#49998 by opting into nll-subminimal-causes.)
-
 // Reject mixing cyclic structure and Drop when using Vec.
 //
 // (Compare against compile-fail/dropck_arr_cycle_checked.rs)
 
-
-
 use std::cell::Cell;
 use id::Id;
 
diff --git a/src/test/ui/span/dropck_vec_cycle_checked.stderr b/src/test/ui/span/dropck_vec_cycle_checked.stderr
index 3a521444611..35e4314d0c6 100644
--- a/src/test/ui/span/dropck_vec_cycle_checked.stderr
+++ b/src/test/ui/span/dropck_vec_cycle_checked.stderr
@@ -1,5 +1,5 @@
 error[E0597]: `c2` does not live long enough
-  --> $DIR/dropck_vec_cycle_checked.rs:103:25
+  --> $DIR/dropck_vec_cycle_checked.rs:98:25
    |
 LL |     c1.v[0].v.set(Some(&c2));
    |                         ^^ borrowed value does not live long enough
@@ -10,7 +10,7 @@ LL | }
    = note: values in a scope are dropped in the opposite order they are created
 
 error[E0597]: `c3` does not live long enough
-  --> $DIR/dropck_vec_cycle_checked.rs:105:25
+  --> $DIR/dropck_vec_cycle_checked.rs:100:25
    |
 LL |     c1.v[1].v.set(Some(&c3));
    |                         ^^ borrowed value does not live long enough
@@ -21,7 +21,7 @@ LL | }
    = note: values in a scope are dropped in the opposite order they are created
 
 error[E0597]: `c2` does not live long enough
-  --> $DIR/dropck_vec_cycle_checked.rs:107:25
+  --> $DIR/dropck_vec_cycle_checked.rs:102:25
    |
 LL |     c2.v[0].v.set(Some(&c2));
    |                         ^^ borrowed value does not live long enough
@@ -32,7 +32,7 @@ LL | }
    = note: values in a scope are dropped in the opposite order they are created
 
 error[E0597]: `c3` does not live long enough
-  --> $DIR/dropck_vec_cycle_checked.rs:109:25
+  --> $DIR/dropck_vec_cycle_checked.rs:104:25
    |
 LL |     c2.v[1].v.set(Some(&c3));
    |                         ^^ borrowed value does not live long enough
@@ -43,7 +43,7 @@ LL | }
    = note: values in a scope are dropped in the opposite order they are created
 
 error[E0597]: `c1` does not live long enough
-  --> $DIR/dropck_vec_cycle_checked.rs:111:25
+  --> $DIR/dropck_vec_cycle_checked.rs:106:25
    |
 LL |     c3.v[0].v.set(Some(&c1));
    |                         ^^ borrowed value does not live long enough
@@ -54,7 +54,7 @@ LL | }
    = note: values in a scope are dropped in the opposite order they are created
 
 error[E0597]: `c2` does not live long enough
-  --> $DIR/dropck_vec_cycle_checked.rs:113:25
+  --> $DIR/dropck_vec_cycle_checked.rs:108:25
    |
 LL |     c3.v[1].v.set(Some(&c2));
    |                         ^^ borrowed value does not live long enough