Reformat use
declarations.
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
This commit is contained in:
parent
118f9350c5
commit
84ac80f192
1865 changed files with 8367 additions and 9199 deletions
|
@ -1,10 +1,10 @@
|
|||
use crate::elaborate_drops::DropFlagState;
|
||||
use rustc_middle::mir::{self, Body, Location, Terminator, TerminatorKind};
|
||||
use rustc_target::abi::VariantIdx;
|
||||
use tracing::debug;
|
||||
|
||||
use super::move_paths::{InitKind, LookupResult, MoveData, MovePathIndex};
|
||||
use super::MoveDataParamEnv;
|
||||
use crate::elaborate_drops::DropFlagState;
|
||||
|
||||
pub fn move_path_children_matching<'tcx, F>(
|
||||
move_data: &MoveData<'tcx>,
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
use std::{fmt, iter};
|
||||
|
||||
use rustc_hir::lang_items::LangItem;
|
||||
use rustc_index::Idx;
|
||||
use rustc_middle::mir::patch::MirPatch;
|
||||
|
@ -5,12 +7,10 @@ use rustc_middle::mir::*;
|
|||
use rustc_middle::span_bug;
|
||||
use rustc_middle::traits::Reveal;
|
||||
use rustc_middle::ty::util::IntTypeExt;
|
||||
use rustc_middle::ty::GenericArgsRef;
|
||||
use rustc_middle::ty::{self, Ty, TyCtxt};
|
||||
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 std::{fmt, iter};
|
||||
use tracing::{debug, instrument};
|
||||
|
||||
/// The value of an inserted drop flag.
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
//! Random access inspection of the results of a dataflow analysis.
|
||||
|
||||
use crate::framework::BitSetExt;
|
||||
|
||||
use std::cmp::Ordering;
|
||||
|
||||
#[cfg(debug_assertions)]
|
||||
|
@ -9,6 +7,7 @@ use rustc_index::bit_set::BitSet;
|
|||
use rustc_middle::mir::{self, BasicBlock, Location};
|
||||
|
||||
use super::{Analysis, Direction, Effect, EffectIndex, Results};
|
||||
use crate::framework::BitSetExt;
|
||||
|
||||
/// Allows random access inspection of the results of a dataflow analysis.
|
||||
///
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
use std::ops::RangeInclusive;
|
||||
|
||||
use rustc_middle::mir::{
|
||||
self, BasicBlock, CallReturnPlaces, Location, SwitchTargets, TerminatorEdges,
|
||||
};
|
||||
use std::ops::RangeInclusive;
|
||||
|
||||
use super::visitor::{ResultsVisitable, ResultsVisitor};
|
||||
use super::{Analysis, Effect, EffectIndex, GenKillAnalysis, GenKillSet, SwitchIntTarget};
|
||||
|
|
|
@ -1,32 +1,28 @@
|
|||
//! A solver for dataflow problems.
|
||||
|
||||
use crate::errors::{
|
||||
DuplicateValuesFor, PathMustEndInFilename, RequiresAnArgument, UnknownFormatter,
|
||||
};
|
||||
use crate::framework::BitSetExt;
|
||||
|
||||
use std::ffi::OsString;
|
||||
use std::path::PathBuf;
|
||||
|
||||
use rustc_ast as ast;
|
||||
use rustc_data_structures::work_queue::WorkQueue;
|
||||
use rustc_graphviz as dot;
|
||||
use rustc_hir::def_id::DefId;
|
||||
use rustc_index::{Idx, IndexVec};
|
||||
use rustc_middle::bug;
|
||||
use rustc_middle::mir::{self, traversal, BasicBlock};
|
||||
use rustc_middle::mir::{create_dump_file, dump_enabled};
|
||||
use rustc_middle::mir::{self, create_dump_file, dump_enabled, traversal, BasicBlock};
|
||||
use rustc_middle::ty::print::with_no_trimmed_paths;
|
||||
use rustc_middle::ty::TyCtxt;
|
||||
use rustc_span::symbol::{sym, Symbol};
|
||||
use tracing::{debug, error};
|
||||
use {rustc_ast as ast, rustc_graphviz as dot};
|
||||
|
||||
use super::fmt::DebugWithContext;
|
||||
use super::graphviz;
|
||||
use super::{
|
||||
visit_results, Analysis, AnalysisDomain, Direction, GenKill, GenKillAnalysis, GenKillSet,
|
||||
JoinSemiLattice, ResultsCursor, ResultsVisitor,
|
||||
graphviz, visit_results, Analysis, AnalysisDomain, Direction, GenKill, GenKillAnalysis,
|
||||
GenKillSet, JoinSemiLattice, ResultsCursor, ResultsVisitor,
|
||||
};
|
||||
use crate::errors::{
|
||||
DuplicateValuesFor, PathMustEndInFilename, RequiresAnArgument, UnknownFormatter,
|
||||
};
|
||||
use crate::framework::BitSetExt;
|
||||
|
||||
pub type EntrySets<'tcx, A> = IndexVec<BasicBlock, <A as AnalysisDomain<'tcx>>::Domain>;
|
||||
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
//! Custom formatting traits used when outputting Graphviz diagrams with the results of a dataflow
|
||||
//! analysis.
|
||||
|
||||
use super::lattice::MaybeReachable;
|
||||
use std::fmt;
|
||||
|
||||
use rustc_index::bit_set::{BitSet, ChunkedBitSet, HybridBitSet};
|
||||
use rustc_index::Idx;
|
||||
use std::fmt;
|
||||
|
||||
use super::lattice::MaybeReachable;
|
||||
|
||||
/// An extension to `fmt::Debug` for data that can be better printed with some auxiliary data `C`.
|
||||
pub trait DebugWithContext<C>: Eq + fmt::Debug {
|
||||
|
|
|
@ -8,8 +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::graphviz_safe_def_name;
|
||||
use rustc_middle::mir::{self, BasicBlock, Body, Location};
|
||||
use rustc_middle::mir::{self, graphviz_safe_def_name, BasicBlock, Body, Location};
|
||||
|
||||
use super::fmt::{DebugDiffWithAdapter, DebugWithAdapter, DebugWithContext};
|
||||
use super::{Analysis, CallReturnPlaces, Direction, Results, ResultsCursor, ResultsVisitor};
|
||||
|
|
|
@ -38,10 +38,12 @@
|
|||
//! [Hasse diagram]: https://en.wikipedia.org/wiki/Hasse_diagram
|
||||
//! [poset]: https://en.wikipedia.org/wiki/Partially_ordered_set
|
||||
|
||||
use crate::framework::BitSetExt;
|
||||
use std::iter;
|
||||
|
||||
use rustc_index::bit_set::{BitSet, ChunkedBitSet, HybridBitSet};
|
||||
use rustc_index::{Idx, IndexVec};
|
||||
use std::iter;
|
||||
|
||||
use crate::framework::BitSetExt;
|
||||
|
||||
/// A [partially ordered set][poset] that has a [least upper bound][lub] for any pair of elements
|
||||
/// in the set.
|
||||
|
|
|
@ -5,15 +5,14 @@ use rustc_middle::mir::{self, Body, CallReturnPlaces, Location, TerminatorEdges}
|
|||
use rustc_middle::ty::{self, TyCtxt};
|
||||
use tracing::{debug, instrument};
|
||||
|
||||
use crate::drop_flag_effects_for_function_entry;
|
||||
use crate::drop_flag_effects_for_location;
|
||||
use crate::elaborate_drops::DropFlagState;
|
||||
use crate::framework::SwitchIntEdgeEffects;
|
||||
use crate::move_paths::{HasMoveData, InitIndex, InitKind, LookupResult, MoveData, MovePathIndex};
|
||||
use crate::on_lookup_result_bits;
|
||||
use crate::MoveDataParamEnv;
|
||||
use crate::{drop_flag_effects, on_all_children_bits};
|
||||
use crate::{lattice, AnalysisDomain, GenKill, GenKillAnalysis, MaybeReachable};
|
||||
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, MoveDataParamEnv,
|
||||
};
|
||||
|
||||
/// `MaybeInitializedPlaces` tracks all places that might be
|
||||
/// initialized upon reaching a particular point in the control flow
|
||||
|
|
|
@ -7,13 +7,12 @@ mod initialized;
|
|||
mod liveness;
|
||||
mod storage_liveness;
|
||||
|
||||
pub use self::borrowed_locals::borrowed_locals;
|
||||
pub use self::borrowed_locals::MaybeBorrowedLocals;
|
||||
pub use self::borrowed_locals::{borrowed_locals, MaybeBorrowedLocals};
|
||||
pub use self::initialized::{
|
||||
DefinitelyInitializedPlaces, EverInitializedPlaces, MaybeInitializedPlaces,
|
||||
MaybeUninitializedPlaces,
|
||||
};
|
||||
pub use self::liveness::MaybeLiveLocals;
|
||||
pub use self::liveness::MaybeTransitiveLiveLocals;
|
||||
pub use self::liveness::TransferFunction as LivenessTransferFunction;
|
||||
pub use self::liveness::{
|
||||
MaybeLiveLocals, MaybeTransitiveLiveLocals, TransferFunction as LivenessTransferFunction,
|
||||
};
|
||||
pub use self::storage_liveness::{MaybeRequiresStorage, MaybeStorageDead, MaybeStorageLive};
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
use std::borrow::Cow;
|
||||
|
||||
use rustc_index::bit_set::BitSet;
|
||||
use rustc_middle::mir::visit::{NonMutatingUseContext, PlaceContext, Visitor};
|
||||
use rustc_middle::mir::*;
|
||||
|
||||
use std::borrow::Cow;
|
||||
|
||||
use super::MaybeBorrowedLocals;
|
||||
use crate::{GenKill, ResultsCursor};
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
use std::mem;
|
||||
|
||||
use rustc_index::IndexVec;
|
||||
use rustc_middle::mir::tcx::{PlaceTy, RvalueInitializationState};
|
||||
use rustc_middle::mir::*;
|
||||
|
@ -6,12 +8,10 @@ use rustc_middle::{bug, span_bug};
|
|||
use smallvec::{smallvec, SmallVec};
|
||||
use tracing::debug;
|
||||
|
||||
use std::mem;
|
||||
|
||||
use super::abs_domain::Lift;
|
||||
use super::{Init, InitIndex, InitKind, InitLocation, LookupResult};
|
||||
use super::{
|
||||
LocationMap, MoveData, MoveOut, MoveOutIndex, MovePath, MovePathIndex, MovePathLookup,
|
||||
Init, InitIndex, InitKind, InitLocation, LocationMap, LookupResult, MoveData, MoveOut,
|
||||
MoveOutIndex, MovePath, MovePathIndex, MovePathLookup,
|
||||
};
|
||||
|
||||
struct MoveDataBuilder<'a, 'tcx, F> {
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
use crate::un_derefer::UnDerefer;
|
||||
use std::fmt;
|
||||
use std::ops::{Index, IndexMut};
|
||||
|
||||
use rustc_data_structures::fx::FxHashMap;
|
||||
use rustc_index::{IndexSlice, IndexVec};
|
||||
use rustc_middle::mir::*;
|
||||
|
@ -6,10 +8,8 @@ use rustc_middle::ty::{ParamEnv, Ty, TyCtxt};
|
|||
use rustc_span::Span;
|
||||
use smallvec::SmallVec;
|
||||
|
||||
use std::fmt;
|
||||
use std::ops::{Index, IndexMut};
|
||||
|
||||
use self::abs_domain::{AbstractElem, Lift};
|
||||
use crate::un_derefer::UnDerefer;
|
||||
|
||||
mod abs_domain;
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
use crate::framework::{visit_results, ResultsVisitable, ResultsVisitor};
|
||||
use rustc_index::bit_set::BitSet;
|
||||
use rustc_index::interval::SparseIntervalMatrix;
|
||||
use rustc_index::Idx;
|
||||
use rustc_index::IndexVec;
|
||||
use rustc_index::{Idx, IndexVec};
|
||||
use rustc_middle::mir::{self, BasicBlock, Body, Location};
|
||||
|
||||
use crate::framework::{visit_results, ResultsVisitable, ResultsVisitor};
|
||||
|
||||
/// Maps between a `Location` and a `PointIndex` (and vice versa).
|
||||
pub struct DenseLocationMap {
|
||||
/// For each basic block, how many points are contained within?
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
use rustc_ast::MetaItem;
|
||||
use rustc_hir::def_id::DefId;
|
||||
use rustc_index::bit_set::BitSet;
|
||||
use rustc_middle::mir::{self, Body, Local, Location, MirPass};
|
||||
use rustc_middle::ty::{self, Ty, TyCtxt};
|
||||
use rustc_span::symbol::{sym, Symbol};
|
||||
use rustc_span::Span;
|
||||
use tracing::{debug, info};
|
||||
|
||||
use crate::errors::{
|
||||
PeekArgumentNotALocal, PeekArgumentUntracked, PeekBitNotSet, PeekMustBeNotTemporary,
|
||||
PeekMustBePlaceOrRefPlace, StopAfterDataFlowEndedCompilation,
|
||||
|
@ -6,19 +15,8 @@ use crate::framework::BitSetExt;
|
|||
use crate::impls::{
|
||||
DefinitelyInitializedPlaces, MaybeInitializedPlaces, MaybeLiveLocals, MaybeUninitializedPlaces,
|
||||
};
|
||||
use crate::move_paths::{HasMoveData, MoveData};
|
||||
use crate::move_paths::{LookupResult, MovePathIndex};
|
||||
use crate::MoveDataParamEnv;
|
||||
use crate::{Analysis, JoinSemiLattice, ResultsCursor};
|
||||
use rustc_ast::MetaItem;
|
||||
use rustc_hir::def_id::DefId;
|
||||
use rustc_index::bit_set::BitSet;
|
||||
use rustc_middle::mir::MirPass;
|
||||
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 tracing::{debug, info};
|
||||
use crate::move_paths::{HasMoveData, LookupResult, MoveData, MovePathIndex};
|
||||
use crate::{Analysis, JoinSemiLattice, MoveDataParamEnv, ResultsCursor};
|
||||
|
||||
pub struct SanityCheck;
|
||||
|
||||
|
|
|
@ -48,10 +48,9 @@ use rustc_middle::ty::{self, Ty, TyCtxt};
|
|||
use rustc_target::abi::{FieldIdx, VariantIdx};
|
||||
use tracing::debug;
|
||||
|
||||
use crate::fmt::DebugWithContext;
|
||||
use crate::lattice::{HasBottom, HasTop};
|
||||
use crate::{
|
||||
fmt::DebugWithContext, Analysis, AnalysisDomain, JoinSemiLattice, SwitchIntEdgeEffects,
|
||||
};
|
||||
use crate::{Analysis, AnalysisDomain, JoinSemiLattice, SwitchIntEdgeEffects};
|
||||
|
||||
pub trait ValueAnalysis<'tcx> {
|
||||
/// For each place of interest, the analysis tracks a value of the given type.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue