diff --git a/src/librustc_mir/dataflow/graphviz.rs b/src/librustc_mir/dataflow/graphviz.rs index 0305e4c93b6a..07585c08f6a2 100644 --- a/src/librustc_mir/dataflow/graphviz.rs +++ b/src/librustc_mir/dataflow/graphviz.rs @@ -111,7 +111,7 @@ impl<'a, 'tcx, MWF, P> dot::Labeller<'a> for Graph<'a, 'tcx, MWF, P> // | | | | bb11[0]: active | // +---------+----------------------------------+------------------+------------------+ // | [00-00] | _7 = const Foo::twiddle(move _8) | [0c-00] | [f3-0f] | - // +---------+----------------------------------+------------------+------------------+ + // +---------+----------------------------------+------------------+------------------+ let mut v = Vec::new(); self.node_label_internal(n, &mut v, *n, self.mbcx.mir()).unwrap(); dot::LabelText::html(String::from_utf8(v).unwrap()) @@ -140,7 +140,7 @@ where MWF: MirWithFlowState<'tcx>, block: BasicBlock, mir: &Mir) -> io::Result<()> { // Header rows - const HDRS: [&'static str; 4] = ["ENTRY", "MIR", "GEN", "KILL"]; + const HDRS: [&'static str; 4] = ["ENTRY", "MIR", "BLOCK GENS", "BLOCK KILLS"]; const HDR_FMT: &'static str = "bgcolor=\"grey\""; write!(w, "
| ", HDRS.len())?;
write!(w, "{:?}", block.index())?;
diff --git a/src/librustc_mir/dataflow/impls/borrows.rs b/src/librustc_mir/dataflow/impls/borrows.rs
index 8f1c7945339a..b7c95da09be9 100644
--- a/src/librustc_mir/dataflow/impls/borrows.rs
+++ b/src/librustc_mir/dataflow/impls/borrows.rs
@@ -272,17 +272,6 @@ impl<'a, 'gcx, 'tcx> Borrows<'a, 'gcx, 'tcx> {
}
}
- /// Represents what kind of usage we've seen.
- enum PlaceUsageType {
- /// No usage seen
- None,
- /// Has been seen as the argument to a StorageDead statement. This is required to
- /// gracefully handle cases where user code has an unneeded
- StorageKilled,
- /// Has been used in borrow-activating context
- BorrowActivateUsage
- }
-
/// A MIR visitor that determines if a specific place is used in a two-phase activating
/// manner in a given chunk of MIR.
struct ContainsUseOfPlace<'b, 'tcx: 'b> {
@@ -404,7 +393,8 @@ impl<'a, 'gcx, 'tcx> Borrows<'a, 'gcx, 'tcx> {
let stmt = &block_data.statements[location.statement_index];
if let mir::StatementKind::EndRegion(region_scope) = stmt.kind {
if &ReScope(region_scope) == region {
- // We encountered an EndRegion statement that terminates the provided region
+ // We encountered an EndRegion statement that terminates the provided
+ // region
return true;
}
}
@@ -430,7 +420,7 @@ impl<'a, 'gcx, 'tcx> Borrows<'a, 'gcx, 'tcx> {
/// See
/// - https://github.com/rust-lang/rust/issues/48431
/// for detailed design notes.
- /// See the TODO in the body of the function for notes on extending support to more
+ /// See the FIXME in the body of the function for notes on extending support to more
/// general two-phased borrows.
fn compute_activation_location(&self,
start_location: Location,
@@ -473,7 +463,7 @@ impl<'a, 'gcx, 'tcx> Borrows<'a, 'gcx, 'tcx> {
}
if self.location_contains_use(curr_loc, assigned_place) {
- // TODO: Handle this case a little more gracefully. Perhaps collect
+ // FIXME: Handle this case a little more gracefully. Perhaps collect
// all uses in a vector, and find the point in the CFG that dominates
// all of them?
// Right now this is sufficient though since there should only be exactly
@@ -596,7 +586,9 @@ impl<'a, 'gcx, 'tcx> BitDenotation for Borrows<'a, 'gcx, 'tcx> {
// `_sets`.
}
- fn before_statement_effect(&self, sets: &mut BlockSets |