Skip to content

Commit aa83481

Browse files
authored
Rollup merge of rust-lang#57219 - matthewjasper:mir-cleanup, r=nikomatsakis
Remove some unused code Closes rust-lang#57096
2 parents 6861426 + afb7c06 commit aa83481

File tree

8 files changed

+9
-71
lines changed

8 files changed

+9
-71
lines changed

src/librustc/ich/impls_ty.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -477,22 +477,6 @@ impl_stable_hash_for!(enum mir::interpret::InboundsCheck {
477477
MaybeDead
478478
});
479479

480-
impl_stable_hash_for!(enum mir::interpret::Lock {
481-
NoLock,
482-
WriteLock(dl),
483-
ReadLock(v)
484-
});
485-
486-
impl_stable_hash_for!(struct mir::interpret::DynamicLifetime {
487-
frame,
488-
region
489-
});
490-
491-
impl_stable_hash_for!(enum mir::interpret::AccessKind {
492-
Read,
493-
Write
494-
});
495-
496480
impl_stable_hash_for!(enum ty::Variance {
497481
Covariant,
498482
Invariant,

src/librustc/mir/interpret/mod.rs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ use mir;
2929
use hir::def_id::DefId;
3030
use ty::{self, TyCtxt, Instance};
3131
use ty::layout::{self, Size};
32-
use middle::region;
3332
use std::io;
3433
use rustc_serialize::{Encoder, Decodable, Encodable};
3534
use rustc_data_structures::fx::FxHashMap;
@@ -40,27 +39,6 @@ use ty::codec::TyDecoder;
4039
use std::sync::atomic::{AtomicU32, Ordering};
4140
use std::num::NonZeroU32;
4241

43-
#[derive(Clone, Debug, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable)]
44-
pub enum Lock {
45-
NoLock,
46-
WriteLock(DynamicLifetime),
47-
/// This should never be empty -- that would be a read lock held and nobody
48-
/// there to release it...
49-
ReadLock(Vec<DynamicLifetime>),
50-
}
51-
52-
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable)]
53-
pub struct DynamicLifetime {
54-
pub frame: usize,
55-
pub region: Option<region::Scope>, // "None" indicates "until the function ends"
56-
}
57-
58-
#[derive(Copy, Clone, Debug, PartialEq, Eq, RustcEncodable, RustcDecodable)]
59-
pub enum AccessKind {
60-
Read,
61-
Write,
62-
}
63-
6442
/// Uniquely identifies a specific constant or static.
6543
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash, RustcEncodable, RustcDecodable)]
6644
pub struct GlobalId<'tcx> {

src/librustc/session/config.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1311,12 +1311,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
13111311
"Disable the instrumentation pre-inliner, useful for profiling / PGO."),
13121312
relro_level: Option<RelroLevel> = (None, parse_relro_level, [TRACKED],
13131313
"choose which RELRO level to use"),
1314-
nll_subminimal_causes: bool = (false, parse_bool, [UNTRACKED],
1315-
"when tracking region error causes, accept subminimal results for faster execution."),
13161314
nll_facts: bool = (false, parse_bool, [UNTRACKED],
13171315
"dump facts from NLL analysis into side files"),
1318-
disable_nll_user_type_assert: bool = (false, parse_bool, [UNTRACKED],
1319-
"disable user provided type assertion in NLL"),
13201316
nll_dont_emit_read_for_match: bool = (false, parse_bool, [UNTRACKED],
13211317
"in match codegen, do not include FakeRead statements (used by mir-borrowck)"),
13221318
dont_buffer_diagnostics: bool = (false, parse_bool, [UNTRACKED],

src/librustc_mir/dataflow/impls/borrows.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -279,20 +279,6 @@ impl<'a, 'gcx, 'tcx> BitDenotation<'tcx> for Borrows<'a, 'gcx, 'tcx> {
279279
});
280280

281281
sets.gen(*index);
282-
283-
// Issue #46746: Two-phase borrows handles
284-
// stmts of form `Tmp = &mut Borrow` ...
285-
match lhs {
286-
Place::Promoted(_) |
287-
Place::Local(..) | Place::Static(..) => {} // okay
288-
Place::Projection(..) => {
289-
// ... can assign into projections,
290-
// e.g., `box (&mut _)`. Current
291-
// conservative solution: force
292-
// immediate activation here.
293-
sets.gen(*index);
294-
}
295-
}
296282
}
297283
}
298284

src/test/run-pass/generator/yield-subtype.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#![allow(dead_code)]
44

55
// revisions:lexical nll
6-
//[nll]compile-flags: -Z disable-nll-user-type-assert
76
#![cfg_attr(nll, feature(nll))]
87

98
#![feature(generators)]

src/test/ui/span/dropck_vec_cycle_checked.nll.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0597]: `c2` does not live long enough
2-
--> $DIR/dropck_vec_cycle_checked.rs:103:24
2+
--> $DIR/dropck_vec_cycle_checked.rs:98:24
33
|
44
LL | c1.v[0].v.set(Some(&c2));
55
| ^^^ borrowed value does not live long enough
@@ -13,7 +13,7 @@ LL | }
1313
= note: values in a scope are dropped in the opposite order they are defined
1414

1515
error[E0597]: `c3` does not live long enough
16-
--> $DIR/dropck_vec_cycle_checked.rs:105:24
16+
--> $DIR/dropck_vec_cycle_checked.rs:100:24
1717
|
1818
LL | c1.v[1].v.set(Some(&c3));
1919
| ^^^ borrowed value does not live long enough
@@ -27,7 +27,7 @@ LL | }
2727
= note: values in a scope are dropped in the opposite order they are defined
2828

2929
error[E0597]: `c1` does not live long enough
30-
--> $DIR/dropck_vec_cycle_checked.rs:111:24
30+
--> $DIR/dropck_vec_cycle_checked.rs:106:24
3131
|
3232
LL | c3.v[0].v.set(Some(&c1));
3333
| ^^^ borrowed value does not live long enough

src/test/ui/span/dropck_vec_cycle_checked.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1-
// compile-flags: -Z nll-subminimal-causes
2-
// (Work around rust-lang/rust#49998 by opting into nll-subminimal-causes.)
3-
41
// Reject mixing cyclic structure and Drop when using Vec.
52
//
63
// (Compare against compile-fail/dropck_arr_cycle_checked.rs)
74

8-
9-
105
use std::cell::Cell;
116
use id::Id;
127

src/test/ui/span/dropck_vec_cycle_checked.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0597]: `c2` does not live long enough
2-
--> $DIR/dropck_vec_cycle_checked.rs:103:25
2+
--> $DIR/dropck_vec_cycle_checked.rs:98:25
33
|
44
LL | c1.v[0].v.set(Some(&c2));
55
| ^^ borrowed value does not live long enough
@@ -10,7 +10,7 @@ LL | }
1010
= note: values in a scope are dropped in the opposite order they are created
1111

1212
error[E0597]: `c3` does not live long enough
13-
--> $DIR/dropck_vec_cycle_checked.rs:105:25
13+
--> $DIR/dropck_vec_cycle_checked.rs:100:25
1414
|
1515
LL | c1.v[1].v.set(Some(&c3));
1616
| ^^ borrowed value does not live long enough
@@ -21,7 +21,7 @@ LL | }
2121
= note: values in a scope are dropped in the opposite order they are created
2222

2323
error[E0597]: `c2` does not live long enough
24-
--> $DIR/dropck_vec_cycle_checked.rs:107:25
24+
--> $DIR/dropck_vec_cycle_checked.rs:102:25
2525
|
2626
LL | c2.v[0].v.set(Some(&c2));
2727
| ^^ borrowed value does not live long enough
@@ -32,7 +32,7 @@ LL | }
3232
= note: values in a scope are dropped in the opposite order they are created
3333

3434
error[E0597]: `c3` does not live long enough
35-
--> $DIR/dropck_vec_cycle_checked.rs:109:25
35+
--> $DIR/dropck_vec_cycle_checked.rs:104:25
3636
|
3737
LL | c2.v[1].v.set(Some(&c3));
3838
| ^^ borrowed value does not live long enough
@@ -43,7 +43,7 @@ LL | }
4343
= note: values in a scope are dropped in the opposite order they are created
4444

4545
error[E0597]: `c1` does not live long enough
46-
--> $DIR/dropck_vec_cycle_checked.rs:111:25
46+
--> $DIR/dropck_vec_cycle_checked.rs:106:25
4747
|
4848
LL | c3.v[0].v.set(Some(&c1));
4949
| ^^ borrowed value does not live long enough
@@ -54,7 +54,7 @@ LL | }
5454
= note: values in a scope are dropped in the opposite order they are created
5555

5656
error[E0597]: `c2` does not live long enough
57-
--> $DIR/dropck_vec_cycle_checked.rs:113:25
57+
--> $DIR/dropck_vec_cycle_checked.rs:108:25
5858
|
5959
LL | c3.v[1].v.set(Some(&c2));
6060
| ^^ borrowed value does not live long enough

0 commit comments

Comments
 (0)