Skip to content

Commit fe52f8e

Browse files
authored
Rollup merge of #60347 - JohnTitor:remove-flags, r=matthewjasper
Remove `-Z two-phase-borrows` and `-Z two-phase-beyond-autoref` fixes #60331
2 parents 634e2da + 3a487ea commit fe52f8e

File tree

3 files changed

+3
-14
lines changed

3 files changed

+3
-14
lines changed

src/librustc/session/config.rs

-4
Original file line numberDiff line numberDiff line change
@@ -1215,10 +1215,6 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
12151215
"make unnamed regions display as '# (where # is some non-ident unique id)"),
12161216
borrowck: Option<String> = (None, parse_opt_string, [UNTRACKED],
12171217
"select which borrowck is used (`ast`, `mir`, `migrate`, or `compare`)"),
1218-
two_phase_borrows: bool = (false, parse_bool, [UNTRACKED],
1219-
"use two-phase reserved/active distinction for `&mut` borrows in MIR borrowck"),
1220-
two_phase_beyond_autoref: bool = (false, parse_bool, [UNTRACKED],
1221-
"when using two-phase-borrows, allow two phases even for non-autoref `&mut` borrows"),
12221218
time_passes: bool = (false, parse_bool, [UNTRACKED],
12231219
"measure time of each rustc pass"),
12241220
time: bool = (false, parse_bool, [UNTRACKED],

src/librustc_mir/borrow_check/borrow_set.rs

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use crate::borrow_check::place_ext::PlaceExt;
22
use crate::borrow_check::nll::ToRegionVid;
3+
use crate::borrow_check::path_utils::allow_two_phase_borrow;
34
use crate::dataflow::indexes::BorrowIndex;
45
use crate::dataflow::move_paths::MoveData;
56
use rustc::mir::traversal;
@@ -299,13 +300,6 @@ impl<'a, 'gcx, 'tcx> Visitor<'tcx> for GatherBorrows<'a, 'gcx, 'tcx> {
299300
}
300301

301302
impl<'a, 'gcx, 'tcx> GatherBorrows<'a, 'gcx, 'tcx> {
302-
/// Returns `true` if the borrow represented by `kind` is
303-
/// allowed to be split into separate Reservation and
304-
/// Activation phases.
305-
fn allow_two_phase_borrow(&self, kind: mir::BorrowKind) -> bool {
306-
kind.allows_two_phase_borrow()
307-
|| self.tcx.sess.opts.debugging_opts.two_phase_beyond_autoref
308-
}
309303

310304
/// If this is a two-phase borrow, then we will record it
311305
/// as "pending" until we find the activating use.
@@ -321,7 +315,7 @@ impl<'a, 'gcx, 'tcx> GatherBorrows<'a, 'gcx, 'tcx> {
321315
start_location, assigned_place, borrow_index,
322316
);
323317

324-
if !self.allow_two_phase_borrow(kind) {
318+
if !allow_two_phase_borrow(&self.tcx, kind) {
325319
debug!(" -> {:?}", start_location);
326320
return;
327321
}

src/librustc_mir/borrow_check/path_utils.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@ use rustc_data_structures::graph::dominators::Dominators;
1212
/// allowed to be split into separate Reservation and
1313
/// Activation phases.
1414
pub(super) fn allow_two_phase_borrow<'a, 'tcx, 'gcx: 'tcx>(
15-
tcx: &TyCtxt<'a, 'gcx, 'tcx>,
15+
_tcx: &TyCtxt<'a, 'gcx, 'tcx>,
1616
kind: BorrowKind
1717
) -> bool {
1818
kind.allows_two_phase_borrow()
19-
|| tcx.sess.opts.debugging_opts.two_phase_beyond_autoref
2019
}
2120

2221
/// Control for the path borrow checking code

0 commit comments

Comments
 (0)