Reformat using the new identifier sorting from rustfmt
This commit is contained in:
parent
1173204b36
commit
c682aa162b
1455 changed files with 7152 additions and 8384 deletions
|
@ -8,9 +8,9 @@ use rustc_middle::span_bug;
|
|||
use rustc_middle::traits::Reveal;
|
||||
use rustc_middle::ty::util::IntTypeExt;
|
||||
use rustc_middle::ty::{self, GenericArgsRef, Ty, TyCtxt};
|
||||
use rustc_span::source_map::Spanned;
|
||||
use rustc_span::DUMMY_SP;
|
||||
use rustc_target::abi::{FieldIdx, VariantIdx, FIRST_VARIANT};
|
||||
use rustc_span::source_map::Spanned;
|
||||
use rustc_target::abi::{FIRST_VARIANT, FieldIdx, VariantIdx};
|
||||
use tracing::{debug, instrument};
|
||||
|
||||
/// The value of an inserted drop flag.
|
||||
|
@ -233,15 +233,12 @@ where
|
|||
.patch_terminator(bb, TerminatorKind::Goto { target: self.succ });
|
||||
}
|
||||
DropStyle::Static => {
|
||||
self.elaborator.patch().patch_terminator(
|
||||
bb,
|
||||
TerminatorKind::Drop {
|
||||
place: self.place,
|
||||
target: self.succ,
|
||||
unwind: self.unwind.into_action(),
|
||||
replace: false,
|
||||
},
|
||||
);
|
||||
self.elaborator.patch().patch_terminator(bb, TerminatorKind::Drop {
|
||||
place: self.place,
|
||||
target: self.succ,
|
||||
unwind: self.unwind.into_action(),
|
||||
replace: false,
|
||||
});
|
||||
}
|
||||
DropStyle::Conditional => {
|
||||
let drop_bb = self.complete_drop(self.succ, self.unwind);
|
||||
|
@ -732,15 +729,12 @@ where
|
|||
};
|
||||
let loop_block = self.elaborator.patch().new_block(loop_block);
|
||||
|
||||
self.elaborator.patch().patch_terminator(
|
||||
drop_block,
|
||||
TerminatorKind::Drop {
|
||||
place: tcx.mk_place_deref(ptr),
|
||||
target: loop_block,
|
||||
unwind: unwind.into_action(),
|
||||
replace: false,
|
||||
},
|
||||
);
|
||||
self.elaborator.patch().patch_terminator(drop_block, TerminatorKind::Drop {
|
||||
place: tcx.mk_place_deref(ptr),
|
||||
target: loop_block,
|
||||
unwind: unwind.into_action(),
|
||||
replace: false,
|
||||
});
|
||||
|
||||
loop_block
|
||||
}
|
||||
|
|
|
@ -7,17 +7,17 @@ use rustc_data_structures::work_queue::WorkQueue;
|
|||
use rustc_hir::def_id::DefId;
|
||||
use rustc_index::{Idx, IndexVec};
|
||||
use rustc_middle::bug;
|
||||
use rustc_middle::mir::{self, create_dump_file, dump_enabled, traversal, BasicBlock};
|
||||
use rustc_middle::ty::print::with_no_trimmed_paths;
|
||||
use rustc_middle::mir::{self, BasicBlock, create_dump_file, dump_enabled, traversal};
|
||||
use rustc_middle::ty::TyCtxt;
|
||||
use rustc_span::symbol::{sym, Symbol};
|
||||
use rustc_middle::ty::print::with_no_trimmed_paths;
|
||||
use rustc_span::symbol::{Symbol, sym};
|
||||
use tracing::{debug, error};
|
||||
use {rustc_ast as ast, rustc_graphviz as dot};
|
||||
|
||||
use super::fmt::DebugWithContext;
|
||||
use super::{
|
||||
graphviz, visit_results, Analysis, AnalysisDomain, Direction, GenKill, GenKillAnalysis,
|
||||
GenKillSet, JoinSemiLattice, ResultsCursor, ResultsVisitor,
|
||||
Analysis, AnalysisDomain, Direction, GenKill, GenKillAnalysis, GenKillSet, JoinSemiLattice,
|
||||
ResultsCursor, ResultsVisitor, graphviz, visit_results,
|
||||
};
|
||||
use crate::errors::{
|
||||
DuplicateValuesFor, PathMustEndInFilename, RequiresAnArgument, UnknownFormatter,
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
use std::fmt;
|
||||
|
||||
use rustc_index::bit_set::{BitSet, ChunkedBitSet, HybridBitSet};
|
||||
use rustc_index::Idx;
|
||||
use rustc_index::bit_set::{BitSet, ChunkedBitSet, HybridBitSet};
|
||||
|
||||
use super::lattice::MaybeReachable;
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ use std::{io, ops, str};
|
|||
use regex::Regex;
|
||||
use rustc_graphviz as dot;
|
||||
use rustc_index::bit_set::BitSet;
|
||||
use rustc_middle::mir::{self, graphviz_safe_def_name, BasicBlock, Body, Location};
|
||||
use rustc_middle::mir::{self, BasicBlock, Body, Location, graphviz_safe_def_name};
|
||||
|
||||
use super::fmt::{DebugDiffWithAdapter, DebugWithAdapter, DebugWithContext};
|
||||
use super::{Analysis, CallReturnPlaces, Direction, Results, ResultsCursor, ResultsVisitor};
|
||||
|
@ -502,10 +502,10 @@ where
|
|||
r#"<td colspan="{colspan}" {fmt} align="left">{state}</td>"#,
|
||||
colspan = this.style.num_state_columns(),
|
||||
fmt = fmt,
|
||||
state = dot::escape_html(&format!(
|
||||
"{:?}",
|
||||
DebugWithAdapter { this: state, ctxt: analysis }
|
||||
)),
|
||||
state = dot::escape_html(&format!("{:?}", DebugWithAdapter {
|
||||
this: state,
|
||||
ctxt: analysis
|
||||
})),
|
||||
)
|
||||
})
|
||||
}
|
||||
|
|
|
@ -32,8 +32,8 @@
|
|||
|
||||
use std::cmp::Ordering;
|
||||
|
||||
use rustc_index::bit_set::{BitSet, ChunkedBitSet, HybridBitSet};
|
||||
use rustc_index::Idx;
|
||||
use rustc_index::bit_set::{BitSet, ChunkedBitSet, HybridBitSet};
|
||||
use rustc_middle::mir::{self, BasicBlock, CallReturnPlaces, Location, TerminatorEdges};
|
||||
use rustc_middle::ty::TyCtxt;
|
||||
|
||||
|
@ -49,7 +49,7 @@ pub use self::cursor::ResultsCursor;
|
|||
pub use self::direction::{Backward, Direction, Forward};
|
||||
pub use self::engine::{Engine, Results};
|
||||
pub use self::lattice::{JoinSemiLattice, MaybeReachable};
|
||||
pub use self::visitor::{visit_results, ResultsVisitable, ResultsVisitor};
|
||||
pub use self::visitor::{ResultsVisitable, ResultsVisitor, visit_results};
|
||||
|
||||
/// Analysis domains are all bitsets of various kinds. This trait holds
|
||||
/// operations needed by all of them.
|
||||
|
|
|
@ -30,32 +30,26 @@ fn mock_body<'tcx>() -> mir::Body<'tcx> {
|
|||
|
||||
block(4, mir::TerminatorKind::Return);
|
||||
block(1, mir::TerminatorKind::Return);
|
||||
block(
|
||||
2,
|
||||
mir::TerminatorKind::Call {
|
||||
func: mir::Operand::Copy(dummy_place.clone()),
|
||||
args: [].into(),
|
||||
destination: dummy_place.clone(),
|
||||
target: Some(mir::START_BLOCK),
|
||||
unwind: mir::UnwindAction::Continue,
|
||||
call_source: mir::CallSource::Misc,
|
||||
fn_span: DUMMY_SP,
|
||||
},
|
||||
);
|
||||
block(2, mir::TerminatorKind::Call {
|
||||
func: mir::Operand::Copy(dummy_place.clone()),
|
||||
args: [].into(),
|
||||
destination: dummy_place.clone(),
|
||||
target: Some(mir::START_BLOCK),
|
||||
unwind: mir::UnwindAction::Continue,
|
||||
call_source: mir::CallSource::Misc,
|
||||
fn_span: DUMMY_SP,
|
||||
});
|
||||
block(3, mir::TerminatorKind::Return);
|
||||
block(0, mir::TerminatorKind::Return);
|
||||
block(
|
||||
4,
|
||||
mir::TerminatorKind::Call {
|
||||
func: mir::Operand::Copy(dummy_place.clone()),
|
||||
args: [].into(),
|
||||
destination: dummy_place.clone(),
|
||||
target: Some(mir::START_BLOCK),
|
||||
unwind: mir::UnwindAction::Continue,
|
||||
call_source: mir::CallSource::Misc,
|
||||
fn_span: DUMMY_SP,
|
||||
},
|
||||
);
|
||||
block(4, mir::TerminatorKind::Call {
|
||||
func: mir::Operand::Copy(dummy_place.clone()),
|
||||
args: [].into(),
|
||||
destination: dummy_place.clone(),
|
||||
target: Some(mir::START_BLOCK),
|
||||
unwind: mir::UnwindAction::Continue,
|
||||
call_source: mir::CallSource::Misc,
|
||||
fn_span: DUMMY_SP,
|
||||
});
|
||||
|
||||
mir::Body::new_cfg_only(blocks)
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use std::assert_matches::assert_matches;
|
||||
|
||||
use rustc_index::bit_set::{BitSet, ChunkedBitSet};
|
||||
use rustc_index::Idx;
|
||||
use rustc_index::bit_set::{BitSet, ChunkedBitSet};
|
||||
use rustc_middle::bug;
|
||||
use rustc_middle::mir::{self, Body, CallReturnPlaces, Location, TerminatorEdges};
|
||||
use rustc_middle::ty::{self, TyCtxt};
|
||||
|
@ -11,9 +11,9 @@ use crate::elaborate_drops::DropFlagState;
|
|||
use crate::framework::SwitchIntEdgeEffects;
|
||||
use crate::move_paths::{HasMoveData, InitIndex, InitKind, LookupResult, MoveData, MovePathIndex};
|
||||
use crate::{
|
||||
drop_flag_effects, drop_flag_effects_for_function_entry, drop_flag_effects_for_location,
|
||||
lattice, on_all_children_bits, on_lookup_result_bits, AnalysisDomain, GenKill, GenKillAnalysis,
|
||||
MaybeReachable,
|
||||
AnalysisDomain, GenKill, GenKillAnalysis, MaybeReachable, drop_flag_effects,
|
||||
drop_flag_effects_for_function_entry, drop_flag_effects_for_location, lattice,
|
||||
on_all_children_bits, on_lookup_result_bits,
|
||||
};
|
||||
|
||||
/// `MaybeInitializedPlaces` tracks all places that might be
|
||||
|
|
|
@ -7,7 +7,7 @@ mod initialized;
|
|||
mod liveness;
|
||||
mod storage_liveness;
|
||||
|
||||
pub use self::borrowed_locals::{borrowed_locals, MaybeBorrowedLocals};
|
||||
pub use self::borrowed_locals::{MaybeBorrowedLocals, borrowed_locals};
|
||||
pub use self::initialized::{
|
||||
DefinitelyInitializedPlaces, EverInitializedPlaces, MaybeInitializedPlaces,
|
||||
MaybeUninitializedPlaces,
|
||||
|
|
|
@ -17,9 +17,9 @@ pub use self::drop_flag_effects::{
|
|||
move_path_children_matching, on_all_children_bits, on_lookup_result_bits,
|
||||
};
|
||||
pub use self::framework::{
|
||||
fmt, graphviz, lattice, visit_results, Analysis, AnalysisDomain, Backward, Direction, Engine,
|
||||
Forward, GenKill, GenKillAnalysis, JoinSemiLattice, MaybeReachable, Results, ResultsCursor,
|
||||
ResultsVisitable, ResultsVisitor, SwitchIntEdgeEffects,
|
||||
Analysis, AnalysisDomain, Backward, Direction, Engine, Forward, GenKill, GenKillAnalysis,
|
||||
JoinSemiLattice, MaybeReachable, Results, ResultsCursor, ResultsVisitable, ResultsVisitor,
|
||||
SwitchIntEdgeEffects, fmt, graphviz, lattice, visit_results,
|
||||
};
|
||||
use self::move_paths::MoveData;
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ use rustc_middle::mir::tcx::{PlaceTy, RvalueInitializationState};
|
|||
use rustc_middle::mir::*;
|
||||
use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitableExt};
|
||||
use rustc_middle::{bug, span_bug};
|
||||
use smallvec::{smallvec, SmallVec};
|
||||
use smallvec::{SmallVec, smallvec};
|
||||
use tracing::debug;
|
||||
|
||||
use super::abs_domain::Lift;
|
||||
|
|
|
@ -3,7 +3,7 @@ use rustc_index::interval::SparseIntervalMatrix;
|
|||
use rustc_index::{Idx, IndexVec};
|
||||
use rustc_middle::mir::{self, BasicBlock, Body, Location};
|
||||
|
||||
use crate::framework::{visit_results, ResultsVisitable, ResultsVisitor};
|
||||
use crate::framework::{ResultsVisitable, ResultsVisitor, visit_results};
|
||||
|
||||
/// Maps between a `Location` and a `PointIndex` (and vice versa).
|
||||
pub struct DenseLocationMap {
|
||||
|
|
|
@ -3,8 +3,8 @@ use rustc_hir::def_id::DefId;
|
|||
use rustc_index::bit_set::BitSet;
|
||||
use rustc_middle::mir::{self, Body, Local, Location};
|
||||
use rustc_middle::ty::{self, Ty, TyCtxt};
|
||||
use rustc_span::symbol::{sym, Symbol};
|
||||
use rustc_span::Span;
|
||||
use rustc_span::symbol::{Symbol, sym};
|
||||
use tracing::{debug, info};
|
||||
|
||||
use crate::errors::{
|
||||
|
|
|
@ -39,8 +39,8 @@ use std::ops::Range;
|
|||
use rustc_data_structures::captures::Captures;
|
||||
use rustc_data_structures::fx::{FxHashMap, FxIndexSet, StdEntry};
|
||||
use rustc_data_structures::stack::ensure_sufficient_stack;
|
||||
use rustc_index::bit_set::BitSet;
|
||||
use rustc_index::IndexVec;
|
||||
use rustc_index::bit_set::BitSet;
|
||||
use rustc_middle::bug;
|
||||
use rustc_middle::mir::tcx::PlaceTy;
|
||||
use rustc_middle::mir::visit::{MutatingUseContext, PlaceContext, Visitor};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue