rustc: remove 'x: 'y bounds (except from comments/strings).
This commit is contained in:
parent
44fb88d252
commit
b25b466a88
@ -7,7 +7,7 @@ use crate::ty::{self, TyCtxt};
|
||||
use crate::hir::{self, PatKind};
|
||||
use crate::hir::def_id::DefId;
|
||||
|
||||
struct CFGBuilder<'a, 'tcx: 'a> {
|
||||
struct CFGBuilder<'a, 'tcx> {
|
||||
tcx: TyCtxt<'tcx>,
|
||||
owner_def_id: DefId,
|
||||
tables: &'a ty::TypeckTables<'tcx>,
|
||||
|
@ -11,7 +11,7 @@ use crate::ty::TyCtxt;
|
||||
pub type Node<'a> = (cfg::CFGIndex, &'a cfg::CFGNode);
|
||||
pub type Edge<'a> = &'a cfg::CFGEdge;
|
||||
|
||||
pub struct LabelledCFG<'a, 'tcx: 'a> {
|
||||
pub struct LabelledCFG<'a, 'tcx> {
|
||||
pub tcx: TyCtxt<'tcx>,
|
||||
pub cfg: &'a cfg::CFG,
|
||||
pub name: String,
|
||||
|
@ -207,8 +207,8 @@ macro_rules! define_dep_nodes {
|
||||
pub fn new<'a, 'tcx>(tcx: TyCtxt<'tcx>,
|
||||
dep: DepConstructor<'tcx>)
|
||||
-> DepNode
|
||||
where 'tcx: 'a,
|
||||
'tcx: 'a
|
||||
where 'tcx,
|
||||
'tcx
|
||||
{
|
||||
match dep {
|
||||
$(
|
||||
|
@ -74,7 +74,7 @@ impl<'a> FnKind<'a> {
|
||||
///
|
||||
/// See the comments on `ItemLikeVisitor` for more details on the overall
|
||||
/// visit strategy.
|
||||
pub enum NestedVisitorMap<'this, 'tcx: 'this> {
|
||||
pub enum NestedVisitorMap<'this, 'tcx> {
|
||||
/// Do not visit any nested things. When you add a new
|
||||
/// "non-nested" thing, you will want to audit such uses to see if
|
||||
/// they remain valid.
|
||||
|
@ -415,7 +415,7 @@ impl<'a> LoweringContext<'a> {
|
||||
/// needed from arbitrary locations in the crate,
|
||||
/// e.g., the number of lifetime generic parameters
|
||||
/// declared for every type and trait definition.
|
||||
struct MiscCollector<'tcx, 'interner: 'tcx> {
|
||||
struct MiscCollector<'tcx, 'interner> {
|
||||
lctx: &'tcx mut LoweringContext<'interner>,
|
||||
hir_id_owner: Option<NodeId>,
|
||||
}
|
||||
@ -561,7 +561,7 @@ impl<'a> LoweringContext<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
struct ItemLowerer<'tcx, 'interner: 'tcx> {
|
||||
struct ItemLowerer<'tcx, 'interner> {
|
||||
lctx: &'tcx mut LoweringContext<'interner>,
|
||||
}
|
||||
|
||||
@ -1788,7 +1788,7 @@ impl<'a> LoweringContext<'a> {
|
||||
// This visitor walks over `impl Trait` bounds and creates defs for all lifetimes that
|
||||
// appear in the bounds, excluding lifetimes that are created within the bounds.
|
||||
// E.g., `'a`, `'b`, but not `'c` in `impl for<'c> SomeTrait<'a, 'b, 'c>`.
|
||||
struct ImplTraitLifetimeCollector<'r, 'a: 'r> {
|
||||
struct ImplTraitLifetimeCollector<'r, 'a> {
|
||||
context: &'r mut LoweringContext<'a>,
|
||||
parent: DefIndex,
|
||||
exist_ty_id: NodeId,
|
||||
@ -1799,7 +1799,7 @@ impl<'a> LoweringContext<'a> {
|
||||
output_lifetime_params: Vec<hir::GenericParam>,
|
||||
}
|
||||
|
||||
impl<'r, 'a: 'r, 'v> hir::intravisit::Visitor<'v> for ImplTraitLifetimeCollector<'r, 'a> {
|
||||
impl<'r, 'a, 'v> hir::intravisit::Visitor<'v> for ImplTraitLifetimeCollector<'r, 'a> {
|
||||
fn nested_visit_map<'this>(
|
||||
&'this mut self,
|
||||
) -> hir::intravisit::NestedVisitorMap<'this, 'v> {
|
||||
|
@ -26,19 +26,19 @@ pub fn check_crate<'hir>(hir_map: &hir::map::Map<'hir>) {
|
||||
}
|
||||
}
|
||||
|
||||
struct HirIdValidator<'a, 'hir: 'a> {
|
||||
struct HirIdValidator<'a, 'hir> {
|
||||
hir_map: &'a hir::map::Map<'hir>,
|
||||
owner_def_index: Option<DefIndex>,
|
||||
hir_ids_seen: FxHashSet<ItemLocalId>,
|
||||
errors: &'a Lock<Vec<String>>,
|
||||
}
|
||||
|
||||
struct OuterVisitor<'a, 'hir: 'a> {
|
||||
struct OuterVisitor<'a, 'hir> {
|
||||
hir_map: &'a hir::map::Map<'hir>,
|
||||
errors: &'a Lock<Vec<String>>,
|
||||
}
|
||||
|
||||
impl<'a, 'hir: 'a> OuterVisitor<'a, 'hir> {
|
||||
impl<'a, 'hir> OuterVisitor<'a, 'hir> {
|
||||
fn new_inner_visitor(&self,
|
||||
hir_map: &'a hir::map::Map<'hir>)
|
||||
-> HirIdValidator<'a, 'hir> {
|
||||
@ -51,7 +51,7 @@ impl<'a, 'hir: 'a> OuterVisitor<'a, 'hir> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'hir: 'a> ItemLikeVisitor<'hir> for OuterVisitor<'a, 'hir> {
|
||||
impl<'a, 'hir> ItemLikeVisitor<'hir> for OuterVisitor<'a, 'hir> {
|
||||
fn visit_item(&mut self, i: &'hir hir::Item) {
|
||||
let mut inner_visitor = self.new_inner_visitor(self.hir_map);
|
||||
inner_visitor.check(i.hir_id, |this| intravisit::walk_item(this, i));
|
||||
@ -68,7 +68,7 @@ impl<'a, 'hir: 'a> ItemLikeVisitor<'hir> for OuterVisitor<'a, 'hir> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'hir: 'a> HirIdValidator<'a, 'hir> {
|
||||
impl<'a, 'hir> HirIdValidator<'a, 'hir> {
|
||||
#[cold]
|
||||
#[inline(never)]
|
||||
fn error(&self, f: impl FnOnce() -> String) {
|
||||
@ -133,7 +133,7 @@ impl<'a, 'hir: 'a> HirIdValidator<'a, 'hir> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'hir: 'a> intravisit::Visitor<'hir> for HirIdValidator<'a, 'hir> {
|
||||
impl<'a, 'hir> intravisit::Visitor<'hir> for HirIdValidator<'a, 'hir> {
|
||||
|
||||
fn nested_visit_map<'this>(&'this mut self)
|
||||
-> intravisit::NestedVisitorMap<'this, 'hir> {
|
||||
|
@ -30,13 +30,13 @@ use super::*;
|
||||
use crate::ty::Const;
|
||||
use crate::ty::relate::{Relate, TypeRelation};
|
||||
|
||||
pub struct At<'a, 'tcx: 'a> {
|
||||
pub struct At<'a, 'tcx> {
|
||||
pub infcx: &'a InferCtxt<'a, 'tcx>,
|
||||
pub cause: &'a ObligationCause<'tcx>,
|
||||
pub param_env: ty::ParamEnv<'tcx>,
|
||||
}
|
||||
|
||||
pub struct Trace<'a, 'tcx: 'a> {
|
||||
pub struct Trace<'a, 'tcx> {
|
||||
at: At<'a, 'tcx>,
|
||||
a_is_expected: bool,
|
||||
trace: TypeTrace<'tcx>,
|
||||
|
@ -275,7 +275,7 @@ impl CanonicalizeRegionMode for CanonicalizeFreeRegionsOtherThanStatic {
|
||||
}
|
||||
}
|
||||
|
||||
struct Canonicalizer<'cx, 'tcx: 'cx> {
|
||||
struct Canonicalizer<'cx, 'tcx> {
|
||||
infcx: Option<&'cx InferCtxt<'cx, 'tcx>>,
|
||||
tcx: TyCtxt<'tcx>,
|
||||
variables: SmallVec<[CanonicalVarInfo; 8]>,
|
||||
|
@ -44,7 +44,7 @@ use syntax::ast;
|
||||
use syntax_pos::{Span, DUMMY_SP};
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct CombineFields<'infcx, 'tcx: 'infcx> {
|
||||
pub struct CombineFields<'infcx, 'tcx> {
|
||||
pub infcx: &'infcx InferCtxt<'infcx, 'tcx>,
|
||||
pub trace: TypeTrace<'tcx>,
|
||||
pub cause: Option<ty::relate::Cause>,
|
||||
@ -355,7 +355,7 @@ impl<'infcx, 'tcx> CombineFields<'infcx, 'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
struct Generalizer<'cx, 'tcx: 'cx> {
|
||||
struct Generalizer<'cx, 'tcx> {
|
||||
infcx: &'cx InferCtxt<'cx, 'tcx>,
|
||||
|
||||
/// The span, used when creating new type variables and things.
|
||||
|
@ -11,7 +11,7 @@ use crate::mir::interpret::ConstValue;
|
||||
use crate::infer::unify_key::replace_if_possible;
|
||||
|
||||
/// Ensures `a` is made equal to `b`. Returns `a` on success.
|
||||
pub struct Equate<'combine, 'infcx: 'combine, 'tcx: 'infcx> {
|
||||
pub struct Equate<'combine, 'infcx, 'tcx> {
|
||||
fields: &'combine mut CombineFields<'infcx, 'tcx>,
|
||||
a_is_expected: bool,
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ impl<'cx, 'tcx> InferCtxt<'cx, 'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
pub struct NiceRegionError<'cx, 'tcx: 'cx> {
|
||||
pub struct NiceRegionError<'cx, 'tcx> {
|
||||
infcx: &'cx InferCtxt<'cx, 'tcx>,
|
||||
error: Option<RegionResolutionError<'tcx>>,
|
||||
regions: Option<(Span, ty::Region<'tcx>, ty::Region<'tcx>)>,
|
||||
|
@ -41,7 +41,7 @@ use std::collections::hash_map::Entry;
|
||||
use super::InferCtxt;
|
||||
use super::unify_key::ToType;
|
||||
|
||||
pub struct TypeFreshener<'a, 'tcx: 'a> {
|
||||
pub struct TypeFreshener<'a, 'tcx> {
|
||||
infcx: &'a InferCtxt<'a, 'tcx>,
|
||||
ty_freshen_count: u32,
|
||||
const_freshen_count: u32,
|
||||
|
@ -133,7 +133,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
pub struct InferenceFudger<'a, 'tcx: 'a> {
|
||||
pub struct InferenceFudger<'a, 'tcx> {
|
||||
infcx: &'a InferCtxt<'a, 'tcx>,
|
||||
type_vars: (Range<TyVid>, Vec<TypeVariableOrigin>),
|
||||
int_vars: Range<IntVid>,
|
||||
|
@ -8,7 +8,7 @@ use crate::ty::{self, Ty, TyCtxt};
|
||||
use crate::ty::relate::{Relate, RelateResult, TypeRelation};
|
||||
|
||||
/// "Greatest lower bound" (common subtype)
|
||||
pub struct Glb<'combine, 'infcx: 'combine, 'tcx: 'infcx> {
|
||||
pub struct Glb<'combine, 'infcx, 'tcx> {
|
||||
fields: &'combine mut CombineFields<'infcx, 'tcx>,
|
||||
a_is_expected: bool,
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ use crate::ty::TyVar;
|
||||
use crate::ty::{self, Ty};
|
||||
use crate::ty::relate::{RelateResult, TypeRelation};
|
||||
|
||||
pub trait LatticeDir<'f, 'tcx: 'f>: TypeRelation<'tcx> {
|
||||
pub trait LatticeDir<'f, 'tcx>: TypeRelation<'tcx> {
|
||||
fn infcx(&self) -> &'f InferCtxt<'f, 'tcx>;
|
||||
|
||||
fn cause(&self) -> &ObligationCause<'tcx>;
|
||||
@ -48,7 +48,7 @@ pub fn super_lattice_tys<'a, 'tcx, L>(
|
||||
) -> RelateResult<'tcx, Ty<'tcx>>
|
||||
where
|
||||
L: LatticeDir<'a, 'tcx>,
|
||||
'tcx: 'a,
|
||||
'tcx,
|
||||
{
|
||||
debug!("{}.lattice_tys({:?}, {:?})",
|
||||
this.tag(),
|
||||
|
@ -107,7 +107,7 @@ pub fn maybe_print_constraints_for<'a, 'tcx>(
|
||||
}
|
||||
}
|
||||
|
||||
struct ConstraintGraph<'a, 'tcx: 'a> {
|
||||
struct ConstraintGraph<'a, 'tcx> {
|
||||
graph_name: String,
|
||||
region_rels: &'a RegionRelations<'a, 'tcx>,
|
||||
map: &'a BTreeMap<Constraint<'tcx>, SubregionOrigin<'tcx>>,
|
||||
|
@ -93,7 +93,7 @@ struct RegionAndOrigin<'tcx> {
|
||||
|
||||
type RegionGraph<'tcx> = Graph<(), Constraint<'tcx>>;
|
||||
|
||||
struct LexicalResolver<'cx, 'tcx: 'cx> {
|
||||
struct LexicalResolver<'cx, 'tcx> {
|
||||
region_rels: &'cx RegionRelations<'cx, 'tcx>,
|
||||
var_infos: VarInfos,
|
||||
data: RegionConstraintData<'tcx>,
|
||||
|
@ -8,7 +8,7 @@ use crate::ty::{self, Ty, TyCtxt};
|
||||
use crate::ty::relate::{Relate, RelateResult, TypeRelation};
|
||||
|
||||
/// "Least upper bound" (common supertype)
|
||||
pub struct Lub<'combine, 'infcx: 'combine, 'tcx: 'infcx> {
|
||||
pub struct Lub<'combine, 'infcx, 'tcx> {
|
||||
fields: &'combine mut CombineFields<'infcx, 'tcx>,
|
||||
a_is_expected: bool,
|
||||
}
|
||||
|
@ -585,7 +585,7 @@ impl<'tcx> InferOk<'tcx, ()> {
|
||||
}
|
||||
|
||||
#[must_use = "once you start a snapshot, you should always consume it"]
|
||||
pub struct CombinedSnapshot<'a, 'tcx: 'a> {
|
||||
pub struct CombinedSnapshot<'a, 'tcx> {
|
||||
projection_cache_snapshot: traits::ProjectionCacheSnapshot,
|
||||
type_snapshot: type_variable::Snapshot<'tcx>,
|
||||
const_snapshot: ut::Snapshot<ut::InPlace<ty::ConstVid<'tcx>>>,
|
||||
|
@ -38,7 +38,7 @@ pub enum NormalizationStrategy {
|
||||
Eager,
|
||||
}
|
||||
|
||||
pub struct TypeRelating<'me, 'tcx: 'me, D>
|
||||
pub struct TypeRelating<'me, 'tcx, D>
|
||||
where
|
||||
D: TypeRelatingDelegate<'tcx>,
|
||||
{
|
||||
@ -741,7 +741,7 @@ where
|
||||
/// binder depth, and finds late-bound regions targeting the
|
||||
/// `for<..`>. For each of those, it creates an entry in
|
||||
/// `bound_region_scope`.
|
||||
struct ScopeInstantiator<'me, 'tcx: 'me> {
|
||||
struct ScopeInstantiator<'me, 'tcx> {
|
||||
next_region: &'me mut dyn FnMut(ty::BoundRegion) -> ty::Region<'tcx>,
|
||||
// The debruijn index of the scope we are instantiating.
|
||||
target_index: ty::DebruijnIndex,
|
||||
@ -798,7 +798,7 @@ impl<'me, 'tcx> TypeVisitor<'tcx> for ScopeInstantiator<'me, 'tcx> {
|
||||
/// scopes.
|
||||
///
|
||||
/// [blog post]: https://is.gd/0hKvIr
|
||||
struct TypeGeneralizer<'me, 'tcx: 'me, D>
|
||||
struct TypeGeneralizer<'me, 'tcx, D>
|
||||
where
|
||||
D: TypeRelatingDelegate<'tcx> + 'me,
|
||||
{
|
||||
|
@ -723,7 +723,7 @@ impl TypeFolder<'tcx> for ReverseMapper<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
struct Instantiator<'a, 'tcx: 'a> {
|
||||
struct Instantiator<'a, 'tcx> {
|
||||
infcx: &'a InferCtxt<'a, 'tcx>,
|
||||
parent_def_id: DefId,
|
||||
body_id: hir::HirId,
|
||||
|
@ -67,7 +67,7 @@ pub struct OutlivesEnvironment<'tcx> {
|
||||
/// because of implied bounds.
|
||||
pub type RegionBoundPairs<'tcx> = Vec<(ty::Region<'tcx>, GenericKind<'tcx>)>;
|
||||
|
||||
impl<'a, 'tcx: 'a> OutlivesEnvironment<'tcx> {
|
||||
impl<'a, 'tcx> OutlivesEnvironment<'tcx> {
|
||||
pub fn new(param_env: ty::ParamEnv<'tcx>) -> Self {
|
||||
let mut env = OutlivesEnvironment {
|
||||
param_env,
|
||||
|
@ -226,7 +226,7 @@ impl<'cx, 'tcx> InferCtxt<'cx, 'tcx> {
|
||||
/// via a "delegate" of type `D` -- this is usually the `infcx`, which
|
||||
/// accrues them into the `region_obligations` code, but for NLL we
|
||||
/// use something else.
|
||||
pub struct TypeOutlives<'cx, 'tcx: 'cx, D>
|
||||
pub struct TypeOutlives<'cx, 'tcx, D>
|
||||
where
|
||||
D: TypeOutlivesDelegate<'tcx>,
|
||||
{
|
||||
|
@ -12,7 +12,7 @@ use crate::util::captures::Captures;
|
||||
/// via a "delegate" of type `D` -- this is usually the `infcx`, which
|
||||
/// accrues them into the `region_obligations` code, but for NLL we
|
||||
/// use something else.
|
||||
pub struct VerifyBoundCx<'cx, 'tcx: 'cx> {
|
||||
pub struct VerifyBoundCx<'cx, 'tcx> {
|
||||
tcx: TyCtxt<'tcx>,
|
||||
region_bound_pairs: &'cx RegionBoundPairs<'tcx>,
|
||||
implicit_region_bound: Option<ty::Region<'tcx>>,
|
||||
|
@ -12,7 +12,7 @@ use crate::ty::fold::{TypeFolder, TypeVisitor};
|
||||
/// been unified with (similar to `shallow_resolve`, but deep). This is
|
||||
/// useful for printing messages etc but also required at various
|
||||
/// points for correctness.
|
||||
pub struct OpportunisticVarResolver<'a, 'tcx: 'a> {
|
||||
pub struct OpportunisticVarResolver<'a, 'tcx> {
|
||||
infcx: &'a InferCtxt<'a, 'tcx>,
|
||||
}
|
||||
|
||||
@ -50,7 +50,7 @@ impl<'a, 'tcx> TypeFolder<'tcx> for OpportunisticVarResolver<'a, 'tcx> {
|
||||
/// The opportunistic type and region resolver is similar to the
|
||||
/// opportunistic type resolver, but also opportunistically resolves
|
||||
/// regions. It is useful for canonicalization.
|
||||
pub struct OpportunisticTypeAndRegionResolver<'a, 'tcx: 'a> {
|
||||
pub struct OpportunisticTypeAndRegionResolver<'a, 'tcx> {
|
||||
infcx: &'a InferCtxt<'a, 'tcx>,
|
||||
}
|
||||
|
||||
@ -101,7 +101,7 @@ impl<'a, 'tcx> TypeFolder<'tcx> for OpportunisticTypeAndRegionResolver<'a, 'tcx>
|
||||
/// type variables that don't yet have a value. The first unresolved type is stored.
|
||||
/// It does not construct the fully resolved type (which might
|
||||
/// involve some hashing and so forth).
|
||||
pub struct UnresolvedTypeFinder<'a, 'tcx: 'a> {
|
||||
pub struct UnresolvedTypeFinder<'a, 'tcx> {
|
||||
infcx: &'a InferCtxt<'a, 'tcx>,
|
||||
|
||||
/// Used to find the type parameter name and location for error reporting.
|
||||
@ -171,7 +171,7 @@ where
|
||||
|
||||
// N.B. This type is not public because the protocol around checking the
|
||||
// `err` field is not enforcable otherwise.
|
||||
struct FullTypeResolver<'a, 'tcx: 'a> {
|
||||
struct FullTypeResolver<'a, 'tcx> {
|
||||
infcx: &'a InferCtxt<'a, 'tcx>,
|
||||
err: Option<FixupError<'tcx>>,
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ use crate::mir::interpret::ConstValue;
|
||||
use std::mem;
|
||||
|
||||
/// Ensures `a` is made a subtype of `b`. Returns `a` on success.
|
||||
pub struct Sub<'combine, 'infcx: 'combine, 'tcx: 'infcx> {
|
||||
pub struct Sub<'combine, 'infcx, 'tcx> {
|
||||
fields: &'combine mut CombineFields<'infcx, 'tcx>,
|
||||
a_is_expected: bool,
|
||||
}
|
||||
|
@ -507,7 +507,7 @@ impl LintStore {
|
||||
}
|
||||
|
||||
/// Context for lint checking after type checking.
|
||||
pub struct LateContext<'a, 'tcx: 'a> {
|
||||
pub struct LateContext<'a, 'tcx> {
|
||||
/// Type context we're checking in.
|
||||
pub tcx: TyCtxt<'tcx>,
|
||||
|
||||
@ -533,7 +533,7 @@ pub struct LateContext<'a, 'tcx: 'a> {
|
||||
only_module: bool,
|
||||
}
|
||||
|
||||
pub struct LateContextAndPass<'a, 'tcx: 'a, T: LateLintPass<'a, 'tcx>> {
|
||||
pub struct LateContextAndPass<'a, 'tcx, T: LateLintPass<'a, 'tcx>> {
|
||||
context: LateContext<'a, 'tcx>,
|
||||
pass: T,
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ fn should_explore<'tcx>(tcx: TyCtxt<'tcx>, hir_id: hir::HirId) -> bool {
|
||||
}
|
||||
}
|
||||
|
||||
struct MarkSymbolVisitor<'a, 'tcx: 'a> {
|
||||
struct MarkSymbolVisitor<'a, 'tcx> {
|
||||
worklist: Vec<hir::HirId>,
|
||||
tcx: TyCtxt<'tcx>,
|
||||
tables: &'a ty::TypeckTables<'tcx>,
|
||||
@ -351,7 +351,7 @@ fn has_allow_dead_code_or_lang_attr(
|
||||
// or
|
||||
// 2) We are not sure to be live or not
|
||||
// * Implementation of a trait method
|
||||
struct LifeSeeder<'k, 'tcx: 'k> {
|
||||
struct LifeSeeder<'k, 'tcx> {
|
||||
worklist: Vec<hir::HirId>,
|
||||
krate: &'k hir::Crate,
|
||||
tcx: TyCtxt<'tcx>,
|
||||
|
@ -11,7 +11,7 @@ use crate::hir::itemlikevisit::ItemLikeVisitor;
|
||||
use crate::ty::TyCtxt;
|
||||
use crate::ty::query::Providers;
|
||||
|
||||
struct EntryContext<'a, 'tcx: 'a> {
|
||||
struct EntryContext<'a, 'tcx> {
|
||||
session: &'a Session,
|
||||
|
||||
map: &'a hir_map::Map<'tcx>,
|
||||
|
@ -229,7 +229,7 @@ impl OverloadedCallType {
|
||||
// The ExprUseVisitor type
|
||||
//
|
||||
// This is the code that actually walks the tree.
|
||||
pub struct ExprUseVisitor<'a, 'tcx: 'a> {
|
||||
pub struct ExprUseVisitor<'a, 'tcx> {
|
||||
mc: mc::MemCategorizationContext<'a, 'tcx>,
|
||||
delegate: &'a mut dyn Delegate<'tcx>,
|
||||
param_env: ty::ParamEnv<'tcx>,
|
||||
|
@ -15,7 +15,7 @@ use crate::ty::{self, TyCtxt, Region};
|
||||
///
|
||||
/// This stuff is a bit convoluted and should be refactored, but as we
|
||||
/// transition to NLL, it'll all go away anyhow.
|
||||
pub struct RegionRelations<'a, 'tcx: 'a> {
|
||||
pub struct RegionRelations<'a, 'tcx> {
|
||||
pub tcx: TyCtxt<'tcx>,
|
||||
|
||||
/// The context used to fetch the region maps.
|
||||
|
@ -352,7 +352,7 @@ impl IrMaps<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
fn visit_fn<'a, 'tcx: 'a>(
|
||||
fn visit_fn<'a, 'tcx>(
|
||||
ir: &mut IrMaps<'tcx>,
|
||||
fk: FnKind<'tcx>,
|
||||
decl: &'tcx hir::FnDecl,
|
||||
@ -682,7 +682,7 @@ const ACC_READ: u32 = 1;
|
||||
const ACC_WRITE: u32 = 2;
|
||||
const ACC_USE: u32 = 4;
|
||||
|
||||
struct Liveness<'a, 'tcx: 'a> {
|
||||
struct Liveness<'a, 'tcx> {
|
||||
ir: &'a mut IrMaps<'tcx>,
|
||||
tables: &'a ty::TypeckTables<'tcx>,
|
||||
s: Specials,
|
||||
|
@ -65,7 +65,7 @@ fn method_might_be_inlined<'tcx>(
|
||||
}
|
||||
|
||||
// Information needed while computing reachability.
|
||||
struct ReachableContext<'a, 'tcx: 'a> {
|
||||
struct ReachableContext<'a, 'tcx> {
|
||||
// The type context.
|
||||
tcx: TyCtxt<'tcx>,
|
||||
tables: &'a ty::TypeckTables<'tcx>,
|
||||
@ -334,13 +334,13 @@ impl<'a, 'tcx> ReachableContext<'a, 'tcx> {
|
||||
// items of non-exported traits (or maybe all local traits?) unless their respective
|
||||
// trait items are used from inlinable code through method call syntax or UFCS, or their
|
||||
// trait is a lang item.
|
||||
struct CollectPrivateImplItemsVisitor<'a, 'tcx: 'a> {
|
||||
struct CollectPrivateImplItemsVisitor<'a, 'tcx> {
|
||||
tcx: TyCtxt<'tcx>,
|
||||
access_levels: &'a privacy::AccessLevels,
|
||||
worklist: &'a mut Vec<hir::HirId>,
|
||||
}
|
||||
|
||||
impl<'a, 'tcx: 'a> ItemLikeVisitor<'tcx> for CollectPrivateImplItemsVisitor<'a, 'tcx> {
|
||||
impl<'a, 'tcx> ItemLikeVisitor<'tcx> for CollectPrivateImplItemsVisitor<'a, 'tcx> {
|
||||
fn visit_item(&mut self, item: &hir::Item) {
|
||||
// Anything which has custom linkage gets thrown on the worklist no
|
||||
// matter where it is in the crate, along with "special std symbols"
|
||||
|
@ -217,7 +217,7 @@ impl_stable_hash_for!(struct crate::middle::resolve_lifetime::ResolveLifetimes {
|
||||
object_lifetime_defaults
|
||||
});
|
||||
|
||||
struct LifetimeContext<'a, 'tcx: 'a> {
|
||||
struct LifetimeContext<'a, 'tcx> {
|
||||
tcx: TyCtxt<'tcx>,
|
||||
map: &'a mut NamedRegionMap,
|
||||
scope: ScopeRef<'a>,
|
||||
@ -1160,7 +1160,7 @@ fn signal_shadowing_problem(tcx: TyCtxt<'_>, name: ast::Name, orig: Original, sh
|
||||
// Adds all labels in `b` to `ctxt.labels_in_fn`, signalling a warning
|
||||
// if one of the label shadows a lifetime or another label.
|
||||
fn extract_labels(ctxt: &mut LifetimeContext<'_, '_>, body: &hir::Body) {
|
||||
struct GatherLabels<'a, 'tcx: 'a> {
|
||||
struct GatherLabels<'a, 'tcx> {
|
||||
tcx: TyCtxt<'tcx>,
|
||||
scope: ScopeRef<'a>,
|
||||
labels_in_fn: &'a mut Vec<ast::Ident>,
|
||||
|
@ -105,7 +105,7 @@ impl_stable_hash_for!(struct self::Index<'tcx> {
|
||||
});
|
||||
|
||||
// A private tree-walker for producing an Index.
|
||||
struct Annotator<'a, 'tcx: 'a> {
|
||||
struct Annotator<'a, 'tcx> {
|
||||
tcx: TyCtxt<'tcx>,
|
||||
index: &'a mut Index<'tcx>,
|
||||
parent_stab: Option<&'tcx Stability>,
|
||||
@ -113,7 +113,7 @@ struct Annotator<'a, 'tcx: 'a> {
|
||||
in_trait_impl: bool,
|
||||
}
|
||||
|
||||
impl<'a, 'tcx: 'a> Annotator<'a, 'tcx> {
|
||||
impl<'a, 'tcx> Annotator<'a, 'tcx> {
|
||||
// Determine the stability for a node based on its attributes and inherited
|
||||
// stability. The stability is recorded in the index and used as the parent.
|
||||
fn annotate<F>(&mut self, hir_id: HirId, attrs: &[Attribute],
|
||||
@ -316,12 +316,12 @@ impl<'a, 'tcx> Visitor<'tcx> for Annotator<'a, 'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
struct MissingStabilityAnnotations<'a, 'tcx: 'a> {
|
||||
struct MissingStabilityAnnotations<'a, 'tcx> {
|
||||
tcx: TyCtxt<'tcx>,
|
||||
access_levels: &'a AccessLevels,
|
||||
}
|
||||
|
||||
impl<'a, 'tcx: 'a> MissingStabilityAnnotations<'a, 'tcx> {
|
||||
impl<'a, 'tcx> MissingStabilityAnnotations<'a, 'tcx> {
|
||||
fn check_missing_stability(&self, hir_id: HirId, span: Span, name: &str) {
|
||||
let stab = self.tcx.stability().local_stability(hir_id);
|
||||
let is_error = !self.tcx.sess.opts.test &&
|
||||
|
@ -17,7 +17,7 @@ use crate::ty::TyCtxt;
|
||||
macro_rules! weak_lang_items {
|
||||
($($name:ident, $item:ident, $sym:ident;)*) => (
|
||||
|
||||
struct Context<'a, 'tcx: 'a> {
|
||||
struct Context<'a, 'tcx> {
|
||||
tcx: TyCtxt<'tcx>,
|
||||
items: &'a mut lang_items::LanguageItems,
|
||||
}
|
||||
|
@ -2104,7 +2104,7 @@ impl<'tcx> Place<'tcx> {
|
||||
/// N.B., this particular impl strategy is not the most obvious. It was
|
||||
/// chosen because it makes a measurable difference to NLL
|
||||
/// performance, as this code (`borrow_conflicts_with_place`) is somewhat hot.
|
||||
pub enum Projections<'p, 'tcx: 'p> {
|
||||
pub enum Projections<'p, 'tcx> {
|
||||
Empty,
|
||||
|
||||
List {
|
||||
@ -2143,7 +2143,7 @@ impl<'p, 'tcx> IntoIterator for &'p Projections<'p, 'tcx> {
|
||||
/// N.B., this is not a *true* Rust iterator -- the code above just
|
||||
/// manually invokes `next`. This is because we (sometimes) want to
|
||||
/// keep executing even after `None` has been returned.
|
||||
pub struct ProjectionsIter<'p, 'tcx: 'p> {
|
||||
pub struct ProjectionsIter<'p, 'tcx> {
|
||||
pub value: &'p Projections<'p, 'tcx>,
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ use super::*;
|
||||
///
|
||||
/// A preorder traversal of this graph is either `A B D C` or `A C D B`
|
||||
#[derive(Clone)]
|
||||
pub struct Preorder<'a, 'tcx: 'a> {
|
||||
pub struct Preorder<'a, 'tcx> {
|
||||
body: &'a Body<'tcx>,
|
||||
visited: BitSet<BasicBlock>,
|
||||
worklist: Vec<BasicBlock>,
|
||||
@ -98,7 +98,7 @@ impl<'a, 'tcx> Iterator for Preorder<'a, 'tcx> {
|
||||
/// ```
|
||||
///
|
||||
/// A Postorder traversal of this graph is `D B C A` or `D C B A`
|
||||
pub struct Postorder<'a, 'tcx: 'a> {
|
||||
pub struct Postorder<'a, 'tcx> {
|
||||
body: &'a Body<'tcx>,
|
||||
visited: BitSet<BasicBlock>,
|
||||
visit_stack: Vec<(BasicBlock, Successors<'a>)>,
|
||||
@ -251,7 +251,7 @@ impl<'a, 'tcx> Iterator for Postorder<'a, 'tcx> {
|
||||
/// constructed as few times as possible. Use the `reset` method to be able
|
||||
/// to re-use the traversal
|
||||
#[derive(Clone)]
|
||||
pub struct ReversePostorder<'a, 'tcx: 'a> {
|
||||
pub struct ReversePostorder<'a, 'tcx> {
|
||||
body: &'a Body<'tcx>,
|
||||
blocks: Vec<BasicBlock>,
|
||||
idx: usize
|
||||
|
@ -1449,7 +1449,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
|
||||
param_env: ty::ParamEnv<'tcx>,
|
||||
pred: ty::PolyTraitRef<'tcx>,
|
||||
) -> bool {
|
||||
struct ParamToVarFolder<'a, 'tcx: 'a> {
|
||||
struct ParamToVarFolder<'a, 'tcx> {
|
||||
infcx: &'a InferCtxt<'a, 'tcx>,
|
||||
var_map: FxHashMap<Ty<'tcx>, Ty<'tcx>>,
|
||||
}
|
||||
|
@ -224,7 +224,7 @@ impl<'tcx> TraitEngine<'tcx> for FulfillmentContext<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
struct FulfillProcessor<'a, 'b: 'a, 'tcx: 'b> {
|
||||
struct FulfillProcessor<'a, 'b, 'tcx> {
|
||||
selcx: &'a mut SelectionContext<'b, 'tcx>,
|
||||
register_region_obligations: bool,
|
||||
}
|
||||
|
@ -285,7 +285,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
struct AssocTypeNormalizer<'a, 'b: 'a, 'tcx: 'b> {
|
||||
struct AssocTypeNormalizer<'a, 'b, 'tcx> {
|
||||
selcx: &'a mut SelectionContext<'b, 'tcx>,
|
||||
param_env: ty::ParamEnv<'tcx>,
|
||||
cause: ObligationCause<'tcx>,
|
||||
|
@ -73,7 +73,7 @@ pub struct NormalizationResult<'tcx> {
|
||||
pub normalized_ty: Ty<'tcx>,
|
||||
}
|
||||
|
||||
struct QueryNormalizer<'cx, 'tcx: 'cx> {
|
||||
struct QueryNormalizer<'cx, 'tcx> {
|
||||
infcx: &'cx InferCtxt<'cx, 'tcx>,
|
||||
cause: &'cx ObligationCause<'tcx>,
|
||||
param_env: ty::ParamEnv<'tcx>,
|
||||
|
@ -50,7 +50,7 @@ use std::iter;
|
||||
use std::rc::Rc;
|
||||
use crate::util::nodemap::{FxHashMap, FxHashSet};
|
||||
|
||||
pub struct SelectionContext<'cx, 'tcx: 'cx> {
|
||||
pub struct SelectionContext<'cx, 'tcx> {
|
||||
infcx: &'cx InferCtxt<'cx, 'tcx>,
|
||||
|
||||
/// Freshener used specifically for entries on the obligation
|
||||
@ -144,7 +144,7 @@ impl IntercrateAmbiguityCause {
|
||||
}
|
||||
|
||||
// A stack that walks back up the stack frame.
|
||||
struct TraitObligationStack<'prev, 'tcx: 'prev> {
|
||||
struct TraitObligationStack<'prev, 'tcx> {
|
||||
obligation: &'prev TraitObligation<'tcx>,
|
||||
|
||||
/// Trait ref from `obligation` but "freshened" with the
|
||||
@ -697,7 +697,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
||||
) -> Result<EvaluationResult, OverflowError>
|
||||
where
|
||||
I: IntoIterator<Item = PredicateObligation<'tcx>>,
|
||||
'tcx: 'a,
|
||||
'tcx,
|
||||
{
|
||||
let mut result = EvaluatedToOk;
|
||||
for obligation in predicates {
|
||||
@ -3789,7 +3789,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
||||
matcher.relate(previous, current).is_ok()
|
||||
}
|
||||
|
||||
fn push_stack<'o, 's: 'o>(
|
||||
fn push_stack<'o, 's>(
|
||||
&mut self,
|
||||
previous_stack: TraitObligationStackList<'s, 'tcx>,
|
||||
obligation: &'o TraitObligation<'tcx>,
|
||||
@ -4252,7 +4252,7 @@ impl<'tcx> ProvisionalEvaluationCache<'tcx> {
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone)]
|
||||
struct TraitObligationStackList<'o, 'tcx: 'o> {
|
||||
struct TraitObligationStackList<'o, 'tcx> {
|
||||
cache: &'o ProvisionalEvaluationCache<'tcx>,
|
||||
head: Option<&'o TraitObligationStack<'o, 'tcx>>,
|
||||
}
|
||||
|
@ -511,7 +511,7 @@ fn decode_tagged<'a, 'tcx, D, T, V>(decoder: &mut D,
|
||||
where T: Decodable + Eq + ::std::fmt::Debug,
|
||||
V: Decodable,
|
||||
D: DecoderWithPosition,
|
||||
'tcx: 'a,
|
||||
'tcx,
|
||||
{
|
||||
let start_pos = decoder.position();
|
||||
|
||||
|
@ -89,7 +89,7 @@ macro_rules! profq_query_msg {
|
||||
|
||||
/// A type representing the responsibility to execute the job in the `job` field.
|
||||
/// This will poison the relevant query if dropped.
|
||||
pub(super) struct JobOwner<'a, 'tcx: 'a, Q: QueryDescription<'tcx> + 'a> {
|
||||
pub(super) struct JobOwner<'a, 'tcx, Q: QueryDescription<'tcx> + 'a> {
|
||||
cache: &'a Lock<QueryCache<'tcx, Q>>,
|
||||
key: Q::Key,
|
||||
job: Lrc<QueryJob<'tcx>>,
|
||||
@ -230,7 +230,7 @@ pub struct CycleError<'tcx> {
|
||||
}
|
||||
|
||||
/// The result of `try_get_lock`
|
||||
pub(super) enum TryGetJob<'a, 'tcx: 'a, D: QueryDescription<'tcx> + 'a> {
|
||||
pub(super) enum TryGetJob<'a, 'tcx, D: QueryDescription<'tcx> + 'a> {
|
||||
/// The query is not yet started. Contains a guard to the cache eventually used to start it.
|
||||
NotYetStarted(JobOwner<'a, 'tcx, D>),
|
||||
|
||||
|
@ -101,7 +101,7 @@ pub fn predicate_obligations<'a, 'tcx>(
|
||||
wf.normalize()
|
||||
}
|
||||
|
||||
struct WfPredicates<'a, 'tcx: 'a> {
|
||||
struct WfPredicates<'a, 'tcx> {
|
||||
infcx: &'a InferCtxt<'a, 'tcx>,
|
||||
param_env: ty::ParamEnv<'tcx>,
|
||||
body_id: hir::HirId,
|
||||
|
@ -78,7 +78,7 @@ fn owned_ptr_base_path_rc<'tcx>(loan_path: &Rc<LoanPath<'tcx>>) -> Rc<LoanPath<'
|
||||
}
|
||||
}
|
||||
|
||||
struct CheckLoanCtxt<'a, 'tcx: 'a> {
|
||||
struct CheckLoanCtxt<'a, 'tcx> {
|
||||
bccx: &'a BorrowckCtxt<'a, 'tcx>,
|
||||
dfcx_loans: &'a LoanDataFlow<'tcx>,
|
||||
move_data: &'a move_data::FlowedMoveData<'tcx>,
|
||||
|
@ -16,7 +16,7 @@ use rustc::hir::*;
|
||||
use rustc::hir::Node;
|
||||
use log::debug;
|
||||
|
||||
struct GatherMoveInfo<'c, 'tcx: 'c> {
|
||||
struct GatherMoveInfo<'c, 'tcx> {
|
||||
id: hir::ItemLocalId,
|
||||
kind: MoveKind,
|
||||
cmt: &'c mc::cmt_<'tcx>,
|
||||
@ -91,7 +91,7 @@ pub fn gather_move_from_expr<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
|
||||
gather_move(bccx, move_data, move_error_collector, move_info);
|
||||
}
|
||||
|
||||
pub fn gather_move_from_pat<'a, 'c, 'tcx: 'c>(bccx: &BorrowckCtxt<'a, 'tcx>,
|
||||
pub fn gather_move_from_pat<'a, 'c, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
|
||||
move_data: &MoveData<'tcx>,
|
||||
move_error_collector: &mut MoveErrorCollector<'tcx>,
|
||||
move_pat: &hir::Pat,
|
||||
@ -121,7 +121,7 @@ pub fn gather_move_from_pat<'a, 'c, 'tcx: 'c>(bccx: &BorrowckCtxt<'a, 'tcx>,
|
||||
gather_move(bccx, move_data, move_error_collector, move_info);
|
||||
}
|
||||
|
||||
fn gather_move<'a, 'c, 'tcx: 'c>(bccx: &BorrowckCtxt<'a, 'tcx>,
|
||||
fn gather_move<'a, 'c, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
|
||||
move_data: &MoveData<'tcx>,
|
||||
move_error_collector: &mut MoveErrorCollector<'tcx>,
|
||||
move_info: GatherMoveInfo<'c, 'tcx>) {
|
||||
|
@ -38,7 +38,7 @@ pub fn guarantee_lifetime<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// Private
|
||||
|
||||
struct GuaranteeLifetimeContext<'a, 'tcx: 'a> {
|
||||
struct GuaranteeLifetimeContext<'a, 'tcx> {
|
||||
bccx: &'a BorrowckCtxt<'a, 'tcx>,
|
||||
|
||||
// the scope of the function body for the enclosing item
|
||||
|
@ -56,7 +56,7 @@ pub fn gather_loans_in_fn<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
|
||||
(all_loans, move_data)
|
||||
}
|
||||
|
||||
struct GatherLoanCtxt<'a, 'tcx: 'a> {
|
||||
struct GatherLoanCtxt<'a, 'tcx> {
|
||||
bccx: &'a BorrowckCtxt<'a, 'tcx>,
|
||||
move_data: move_data::MoveData<'tcx>,
|
||||
move_error_collector: move_error::MoveErrorCollector<'tcx>,
|
||||
|
@ -37,7 +37,7 @@ pub fn compute_restrictions<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// Private
|
||||
|
||||
struct RestrictionsContext<'a, 'tcx: 'a> {
|
||||
struct RestrictionsContext<'a, 'tcx> {
|
||||
bccx: &'a BorrowckCtxt<'a, 'tcx>,
|
||||
span: Span,
|
||||
loan_region: ty::Region<'tcx>,
|
||||
|
@ -552,7 +552,7 @@ pub enum bckerr_code<'tcx> {
|
||||
// Combination of an error code and the categorization of the expression
|
||||
// that caused it
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub struct BckError<'c, 'tcx: 'c> {
|
||||
pub struct BckError<'c, 'tcx> {
|
||||
span: Span,
|
||||
cause: AliasableViolationKind,
|
||||
cmt: &'c mc::cmt_<'tcx>,
|
||||
|
@ -30,7 +30,7 @@ impl Variant {
|
||||
}
|
||||
}
|
||||
|
||||
pub struct DataflowLabeller<'a, 'tcx: 'a> {
|
||||
pub struct DataflowLabeller<'a, 'tcx> {
|
||||
pub inner: cfg_dot::LabelledCFG<'a, 'tcx>,
|
||||
pub variants: Vec<Variant>,
|
||||
pub borrowck_ctxt: &'a BorrowckCtxt<'a, 'tcx>,
|
||||
|
@ -27,7 +27,7 @@ use std::iter::TrustedLen;
|
||||
|
||||
// All Builders must have an llfn associated with them
|
||||
#[must_use]
|
||||
pub struct Builder<'a, 'll: 'a, 'tcx: 'll> {
|
||||
pub struct Builder<'a, 'll, 'tcx> {
|
||||
pub llbuilder: &'ll mut llvm::Builder<'ll>,
|
||||
pub cx: &'a CodegenCx<'ll, 'tcx>,
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ use crate::abi::Abi;
|
||||
/// There is one `CodegenCx` per compilation unit. Each one has its own LLVM
|
||||
/// `llvm::Context` so that several compilation units may be optimized in parallel.
|
||||
/// All other LLVM data structures in the `CodegenCx` are tied to that `llvm::Context`.
|
||||
pub struct CodegenCx<'ll, 'tcx: 'll> {
|
||||
pub struct CodegenCx<'ll, 'tcx> {
|
||||
pub tcx: TyCtxt<'tcx>,
|
||||
pub check_overflow: bool,
|
||||
pub use_dll_storage_attrs: bool,
|
||||
|
@ -125,7 +125,7 @@ impl ExtraBackendMethods for LlvmCodegenBackend {
|
||||
) {
|
||||
unsafe { allocator::codegen(tcx, mods, kind) }
|
||||
}
|
||||
fn compile_codegen_unit<'a, 'tcx: 'a>(&self, tcx: TyCtxt<'tcx>, cgu_name: InternedString) {
|
||||
fn compile_codegen_unit<'a, 'tcx>(&self, tcx: TyCtxt<'tcx>, cgu_name: InternedString) {
|
||||
base::compile_codegen_unit(tcx, cgu_name);
|
||||
}
|
||||
fn target_machine_factory(
|
||||
|
@ -29,11 +29,11 @@ While the LLVM-specific code will be left in `rustc_codegen_llvm`, all the new t
|
||||
The two most important structures for the LLVM codegen are `CodegenCx` and `Builder`. They are parametrized by multiple lifetime parameters and the type for `Value`.
|
||||
|
||||
```rust
|
||||
struct CodegenCx<'ll, 'tcx: 'll> {
|
||||
struct CodegenCx<'ll, 'tcx> {
|
||||
/* ... */
|
||||
}
|
||||
|
||||
struct Builder<'a, 'll: 'a, 'tcx: 'll> {
|
||||
struct Builder<'a, 'll, 'tcx> {
|
||||
cx: &'a CodegenCx<'ll, 'tcx>,
|
||||
/* ... */
|
||||
}
|
||||
@ -49,7 +49,7 @@ The code in `rustc_codegen_llvm` has to deal with multiple explicit lifetime par
|
||||
Although there are already many lifetime parameters in the code, making it generic uncovered situations where the borrow-checker was passing only due to the special nature of the LLVM objects manipulated (they are extern pointers). For instance, a additional lifetime parameter had to be added to `LocalAnalyser` in `analyse.rs`, leading to the definition:
|
||||
|
||||
```rust
|
||||
struct LocalAnalyzer<'mir, 'a: 'mir, 'tcx: 'a> {
|
||||
struct LocalAnalyzer<'mir, 'a, 'tcx> {
|
||||
/* ... */
|
||||
}
|
||||
```
|
||||
@ -61,7 +61,7 @@ However, the two most important structures `CodegenCx` and `Builder` are not def
|
||||
Because they have to be defined by the backend, `CodegenCx` and `Builder` will be the structures implementing all the traits defining the backend's interface. These traits are defined in the folder `rustc_codegen_ssa/traits` and all the backend-agnostic code is parametrized by them. For instance, let us explain how a function in `base.rs` is parametrized:
|
||||
|
||||
```rust
|
||||
pub fn codegen_instance<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
pub fn codegen_instance<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
cx: &'a Bx::CodegenCx,
|
||||
instance: Instance<'tcx>
|
||||
) {
|
||||
@ -74,7 +74,7 @@ In this signature, we have the two lifetime parameters explained earlier and the
|
||||
On the trait side, here is an example with part of the definition of `BuilderMethods` in `traits/builder.rs`:
|
||||
|
||||
```rust
|
||||
pub trait BuilderMethods<'a, 'tcx: 'a>:
|
||||
pub trait BuilderMethods<'a, 'tcx>:
|
||||
HasCodegen<'tcx>
|
||||
+ DebugInfoBuilderMethods<'tcx>
|
||||
+ ArgTypeMethods<'tcx>
|
||||
|
@ -88,7 +88,7 @@ pub fn bin_op_to_fcmp_predicate(op: hir::BinOpKind) -> RealPredicate {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn compare_simd_types<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
pub fn compare_simd_types<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
bx: &mut Bx,
|
||||
lhs: Bx::Value,
|
||||
rhs: Bx::Value,
|
||||
@ -152,7 +152,7 @@ pub fn unsized_info<'tcx, Cx: CodegenMethods<'tcx>>(
|
||||
}
|
||||
|
||||
/// Coerce `src` to `dst_ty`. `src_ty` must be a thin pointer.
|
||||
pub fn unsize_thin_ptr<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
pub fn unsize_thin_ptr<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
bx: &mut Bx,
|
||||
src: Bx::Value,
|
||||
src_ty: Ty<'tcx>,
|
||||
@ -207,7 +207,7 @@ pub fn unsize_thin_ptr<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
|
||||
/// Coerce `src`, which is a reference to a value of type `src_ty`,
|
||||
/// to a value of type `dst_ty` and store the result in `dst`
|
||||
pub fn coerce_unsized_into<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
pub fn coerce_unsized_into<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
bx: &mut Bx,
|
||||
src: PlaceRef<'tcx, Bx::Value>,
|
||||
dst: PlaceRef<'tcx, Bx::Value>
|
||||
@ -266,7 +266,7 @@ pub fn coerce_unsized_into<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
}
|
||||
}
|
||||
|
||||
pub fn cast_shift_expr_rhs<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
pub fn cast_shift_expr_rhs<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
bx: &mut Bx,
|
||||
op: hir::BinOpKind,
|
||||
lhs: Bx::Value,
|
||||
@ -275,7 +275,7 @@ pub fn cast_shift_expr_rhs<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
cast_shift_rhs(bx, op, lhs, rhs)
|
||||
}
|
||||
|
||||
fn cast_shift_rhs<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
fn cast_shift_rhs<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
bx: &mut Bx,
|
||||
op: hir::BinOpKind,
|
||||
lhs: Bx::Value,
|
||||
@ -316,7 +316,7 @@ pub fn wants_msvc_seh(sess: &Session) -> bool {
|
||||
sess.target.target.options.is_like_msvc
|
||||
}
|
||||
|
||||
pub fn from_immediate<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
pub fn from_immediate<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
bx: &mut Bx,
|
||||
val: Bx::Value
|
||||
) -> Bx::Value {
|
||||
@ -327,7 +327,7 @@ pub fn from_immediate<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
}
|
||||
}
|
||||
|
||||
pub fn to_immediate<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
pub fn to_immediate<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
bx: &mut Bx,
|
||||
val: Bx::Value,
|
||||
layout: layout::TyLayout<'_>,
|
||||
@ -338,7 +338,7 @@ pub fn to_immediate<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
val
|
||||
}
|
||||
|
||||
pub fn to_immediate_scalar<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
pub fn to_immediate_scalar<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
bx: &mut Bx,
|
||||
val: Bx::Value,
|
||||
scalar: &layout::Scalar,
|
||||
@ -349,7 +349,7 @@ pub fn to_immediate_scalar<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
val
|
||||
}
|
||||
|
||||
pub fn memcpy_ty<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
pub fn memcpy_ty<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
bx: &mut Bx,
|
||||
dst: Bx::Value,
|
||||
dst_align: Align,
|
||||
@ -366,7 +366,7 @@ pub fn memcpy_ty<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
bx.memcpy(dst, dst_align, src, src_align, bx.cx().const_usize(size), flags);
|
||||
}
|
||||
|
||||
pub fn codegen_instance<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
pub fn codegen_instance<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
cx: &'a Bx::CodegenCx,
|
||||
instance: Instance<'tcx>,
|
||||
) {
|
||||
@ -387,7 +387,7 @@ pub fn codegen_instance<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
|
||||
/// Creates the `main` function which will initialize the rust runtime and call
|
||||
/// users main function.
|
||||
pub fn maybe_create_entry_wrapper<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
pub fn maybe_create_entry_wrapper<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
cx: &'a Bx::CodegenCx
|
||||
) {
|
||||
let (main_def_id, span) = match cx.tcx().entry_fn(LOCAL_CRATE) {
|
||||
@ -412,7 +412,7 @@ pub fn maybe_create_entry_wrapper<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
None => {} // Do nothing.
|
||||
}
|
||||
|
||||
fn create_entry_fn<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
fn create_entry_fn<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
cx: &'a Bx::CodegenCx,
|
||||
sp: Span,
|
||||
rust_main: Bx::Value,
|
||||
|
@ -137,7 +137,7 @@ pub fn langcall(tcx: TyCtxt<'_>, span: Option<Span>, msg: &str, li: LangItem) ->
|
||||
// all shifts). For 32- and 64-bit types, this matches the semantics
|
||||
// of Java. (See related discussion on #1877 and #10183.)
|
||||
|
||||
pub fn build_unchecked_lshift<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
pub fn build_unchecked_lshift<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
bx: &mut Bx,
|
||||
lhs: Bx::Value,
|
||||
rhs: Bx::Value
|
||||
@ -148,7 +148,7 @@ pub fn build_unchecked_lshift<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
bx.shl(lhs, rhs)
|
||||
}
|
||||
|
||||
pub fn build_unchecked_rshift<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
pub fn build_unchecked_rshift<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
bx: &mut Bx,
|
||||
lhs_t: Ty<'tcx>,
|
||||
lhs: Bx::Value,
|
||||
@ -165,7 +165,7 @@ pub fn build_unchecked_rshift<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
}
|
||||
}
|
||||
|
||||
fn shift_mask_rhs<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
fn shift_mask_rhs<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
bx: &mut Bx,
|
||||
rhs: Bx::Value
|
||||
) -> Bx::Value {
|
||||
@ -174,7 +174,7 @@ fn shift_mask_rhs<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
bx.and(rhs, shift_val)
|
||||
}
|
||||
|
||||
pub fn shift_mask_val<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
pub fn shift_mask_val<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
bx: &mut Bx,
|
||||
llty: Bx::Type,
|
||||
mask_llty: Bx::Type,
|
||||
|
@ -7,7 +7,7 @@ use crate::common::IntPredicate;
|
||||
use crate::meth;
|
||||
use crate::traits::*;
|
||||
|
||||
pub fn size_and_align_of_dst<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
pub fn size_and_align_of_dst<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
bx: &mut Bx,
|
||||
t: Ty<'tcx>,
|
||||
info: Option<Bx::Value>
|
||||
|
@ -12,7 +12,7 @@ pub const DESTRUCTOR: VirtualIndex = VirtualIndex(0);
|
||||
pub const SIZE: VirtualIndex = VirtualIndex(1);
|
||||
pub const ALIGN: VirtualIndex = VirtualIndex(2);
|
||||
|
||||
impl<'a, 'tcx: 'a> VirtualIndex {
|
||||
impl<'a, 'tcx> VirtualIndex {
|
||||
pub fn from_index(index: usize) -> Self {
|
||||
VirtualIndex(index as u64 + 3)
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ use rustc::ty::layout::{LayoutOf, HasTyCtxt};
|
||||
use super::FunctionCx;
|
||||
use crate::traits::*;
|
||||
|
||||
pub fn non_ssa_locals<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
pub fn non_ssa_locals<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
fx: &FunctionCx<'a, 'tcx, Bx>
|
||||
) -> BitSet<mir::Local> {
|
||||
let mir = fx.mir;
|
||||
@ -43,7 +43,7 @@ pub fn non_ssa_locals<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
analyzer.non_ssa_locals
|
||||
}
|
||||
|
||||
struct LocalAnalyzer<'mir, 'a: 'mir, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> {
|
||||
struct LocalAnalyzer<'mir, 'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> {
|
||||
fx: &'mir FunctionCx<'a, 'tcx, Bx>,
|
||||
dominators: Dominators<mir::BasicBlock>,
|
||||
non_ssa_locals: BitSet<mir::Local>,
|
||||
@ -94,7 +94,7 @@ impl<Bx: BuilderMethods<'a, 'tcx>> LocalAnalyzer<'mir, 'a, 'tcx, Bx> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'mir, 'a: 'mir, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> Visitor<'tcx>
|
||||
impl<'mir, 'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> Visitor<'tcx>
|
||||
for LocalAnalyzer<'mir, 'a, 'tcx, Bx> {
|
||||
fn visit_assign(&mut self,
|
||||
place: &mir::Place<'tcx>,
|
||||
|
@ -151,7 +151,7 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'a, 'tcx> {
|
||||
}
|
||||
|
||||
/// Codegen implementations for some terminator variants.
|
||||
impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
||||
impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
||||
/// Generates code for a `Resume` terminator.
|
||||
fn codegen_resume_terminator<'b>(
|
||||
&mut self,
|
||||
@ -788,7 +788,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
||||
impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
||||
pub fn codegen_block(
|
||||
&mut self,
|
||||
bb: mir::BasicBlock,
|
||||
|
@ -8,7 +8,7 @@ use crate::traits::*;
|
||||
|
||||
use super::FunctionCx;
|
||||
|
||||
impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
||||
impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
||||
pub fn eval_mir_constant(
|
||||
&mut self,
|
||||
constant: &mir::Constant<'tcx>,
|
||||
|
@ -23,7 +23,7 @@ use rustc::mir::traversal;
|
||||
use self::operand::{OperandRef, OperandValue};
|
||||
|
||||
/// Master context for codegenning from MIR.
|
||||
pub struct FunctionCx<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> {
|
||||
pub struct FunctionCx<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> {
|
||||
instance: Instance<'tcx>,
|
||||
|
||||
mir: &'a mir::Body<'tcx>,
|
||||
@ -87,7 +87,7 @@ pub struct FunctionCx<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> {
|
||||
va_list_ref: Option<PlaceRef<'tcx, Bx::Value>>,
|
||||
}
|
||||
|
||||
impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
||||
impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
||||
pub fn monomorphize<T>(&self, value: &T) -> T
|
||||
where T: TypeFoldable<'tcx>
|
||||
{
|
||||
@ -167,7 +167,7 @@ enum LocalRef<'tcx, V> {
|
||||
Operand(Option<OperandRef<'tcx, V>>),
|
||||
}
|
||||
|
||||
impl<'a, 'tcx: 'a, V: CodegenObject> LocalRef<'tcx, V> {
|
||||
impl<'a, 'tcx, V: CodegenObject> LocalRef<'tcx, V> {
|
||||
fn new_operand<Bx: BuilderMethods<'a, 'tcx, Value = V>>(
|
||||
bx: &mut Bx,
|
||||
layout: TyLayout<'tcx>,
|
||||
@ -185,7 +185,7 @@ impl<'a, 'tcx: 'a, V: CodegenObject> LocalRef<'tcx, V> {
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
pub fn codegen_mir<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
pub fn codegen_mir<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
cx: &'a Bx::CodegenCx,
|
||||
llfn: Bx::Value,
|
||||
mir: &'a Body<'tcx>,
|
||||
@ -351,7 +351,7 @@ pub fn codegen_mir<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
}
|
||||
}
|
||||
|
||||
fn create_funclets<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
fn create_funclets<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
mir: &'a Body<'tcx>,
|
||||
bx: &mut Bx,
|
||||
cleanup_kinds: &IndexVec<mir::BasicBlock, CleanupKind>,
|
||||
@ -420,7 +420,7 @@ fn create_funclets<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
/// Produces, for each argument, a `Value` pointing at the
|
||||
/// argument's value. As arguments are places, these are always
|
||||
/// indirect.
|
||||
fn arg_local_refs<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
fn arg_local_refs<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
bx: &mut Bx,
|
||||
fx: &FunctionCx<'a, 'tcx, Bx>,
|
||||
memory_locals: &BitSet<mir::Local>,
|
||||
|
@ -53,7 +53,7 @@ impl<V: CodegenObject> fmt::Debug for OperandRef<'tcx, V> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'tcx: 'a, V: CodegenObject> OperandRef<'tcx, V> {
|
||||
impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> {
|
||||
pub fn new_zst<Bx: BuilderMethods<'a, 'tcx, Value = V>>(
|
||||
bx: &mut Bx,
|
||||
layout: TyLayout<'tcx>
|
||||
@ -266,7 +266,7 @@ impl<'a, 'tcx: 'a, V: CodegenObject> OperandRef<'tcx, V> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'tcx: 'a, V: CodegenObject> OperandValue<V> {
|
||||
impl<'a, 'tcx, V: CodegenObject> OperandValue<V> {
|
||||
pub fn store<Bx: BuilderMethods<'a, 'tcx, Value = V>>(
|
||||
self,
|
||||
bx: &mut Bx,
|
||||
@ -376,7 +376,7 @@ impl<'a, 'tcx: 'a, V: CodegenObject> OperandValue<V> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
||||
impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
||||
fn maybe_codegen_consume_direct(
|
||||
&mut self,
|
||||
bx: &mut Bx,
|
||||
|
@ -26,7 +26,7 @@ pub struct PlaceRef<'tcx, V> {
|
||||
pub align: Align,
|
||||
}
|
||||
|
||||
impl<'a, 'tcx: 'a, V: CodegenObject> PlaceRef<'tcx, V> {
|
||||
impl<'a, 'tcx, V: CodegenObject> PlaceRef<'tcx, V> {
|
||||
pub fn new_sized(
|
||||
llval: V,
|
||||
layout: TyLayout<'tcx>,
|
||||
@ -98,7 +98,7 @@ impl<'a, 'tcx: 'a, V: CodegenObject> PlaceRef<'tcx, V> {
|
||||
|
||||
}
|
||||
|
||||
impl<'a, 'tcx: 'a, V: CodegenObject> PlaceRef<'tcx, V> {
|
||||
impl<'a, 'tcx, V: CodegenObject> PlaceRef<'tcx, V> {
|
||||
/// Access a field, at a point when the value's case is known.
|
||||
pub fn project_field<Bx: BuilderMethods<'a, 'tcx, Value = V>>(
|
||||
self, bx: &mut Bx,
|
||||
@ -386,7 +386,7 @@ impl<'a, 'tcx: 'a, V: CodegenObject> PlaceRef<'tcx, V> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
||||
impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
||||
pub fn codegen_place(
|
||||
&mut self,
|
||||
bx: &mut Bx,
|
||||
|
@ -18,7 +18,7 @@ use super::{FunctionCx, LocalRef};
|
||||
use super::operand::{OperandRef, OperandValue};
|
||||
use super::place::PlaceRef;
|
||||
|
||||
impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
||||
impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
||||
pub fn codegen_rvalue(
|
||||
&mut self,
|
||||
mut bx: Bx,
|
||||
@ -687,7 +687,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
||||
impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
||||
pub fn rvalue_creates_operand(&self, rvalue: &mir::Rvalue<'tcx>) -> bool {
|
||||
match *rvalue {
|
||||
mir::Rvalue::Ref(..) |
|
||||
@ -712,7 +712,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
||||
}
|
||||
}
|
||||
|
||||
fn cast_int_to_float<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
fn cast_int_to_float<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
bx: &mut Bx,
|
||||
signed: bool,
|
||||
x: Bx::Value,
|
||||
@ -746,7 +746,7 @@ fn cast_int_to_float<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
}
|
||||
}
|
||||
|
||||
fn cast_float_to_int<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
fn cast_float_to_int<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
bx: &mut Bx,
|
||||
signed: bool,
|
||||
x: Bx::Value,
|
||||
|
@ -6,7 +6,7 @@ use super::LocalRef;
|
||||
use super::OperandValue;
|
||||
use crate::traits::*;
|
||||
|
||||
impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
||||
impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
||||
pub fn codegen_statement(
|
||||
&mut self,
|
||||
mut bx: Bx,
|
||||
|
@ -6,7 +6,7 @@ use crate::traits::*;
|
||||
|
||||
use rustc::mir::mono::MonoItem;
|
||||
|
||||
pub trait MonoItemExt<'a, 'tcx: 'a> {
|
||||
pub trait MonoItemExt<'a, 'tcx> {
|
||||
fn define<Bx: BuilderMethods<'a, 'tcx>>(&self, cx: &'a Bx::CodegenCx);
|
||||
fn predefine<Bx: BuilderMethods<'a, 'tcx>>(
|
||||
&self,
|
||||
@ -17,7 +17,7 @@ pub trait MonoItemExt<'a, 'tcx: 'a> {
|
||||
fn to_raw_string(&self) -> String;
|
||||
}
|
||||
|
||||
impl<'a, 'tcx: 'a> MonoItemExt<'a, 'tcx> for MonoItem<'tcx> {
|
||||
impl<'a, 'tcx> MonoItemExt<'a, 'tcx> for MonoItem<'tcx> {
|
||||
fn define<Bx: BuilderMethods<'a, 'tcx>>(&self, cx: &'a Bx::CodegenCx) {
|
||||
debug!("BEGIN IMPLEMENTING '{} ({})' in cgu {}",
|
||||
self.to_string(cx.tcx(), true),
|
||||
|
@ -44,7 +44,7 @@ pub trait ExtraBackendMethods: CodegenBackend + WriteBackendMethods + Sized + Se
|
||||
mods: &mut Self::Module,
|
||||
kind: AllocatorKind,
|
||||
);
|
||||
fn compile_codegen_unit<'a, 'tcx: 'a>(&self, tcx: TyCtxt<'tcx>, cgu_name: InternedString);
|
||||
fn compile_codegen_unit<'a, 'tcx>(&self, tcx: TyCtxt<'tcx>, cgu_name: InternedString);
|
||||
// If find_features is true this won't access `sess.crate_types` by assuming
|
||||
// that `is_pie_binary` is false. When we discover LLVM target features
|
||||
// `sess.crate_types` is uninitialized so we cannot access it.
|
||||
|
@ -22,7 +22,7 @@ pub enum OverflowOp {
|
||||
Mul,
|
||||
}
|
||||
|
||||
pub trait BuilderMethods<'a, 'tcx: 'a>:
|
||||
pub trait BuilderMethods<'a, 'tcx>:
|
||||
HasCodegen<'tcx>
|
||||
+ DebugInfoBuilderMethods<'tcx>
|
||||
+ ArgTypeMethods<'tcx>
|
||||
|
@ -453,7 +453,7 @@ impl<'a> pprust::PpAnn for HygieneAnnotation<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
struct TypedAnnotation<'a, 'tcx: 'a> {
|
||||
struct TypedAnnotation<'a, 'tcx> {
|
||||
tcx: TyCtxt<'tcx>,
|
||||
tables: Cell<&'a ty::TypeckTables<'tcx>>,
|
||||
}
|
||||
|
@ -1088,7 +1088,7 @@ impl TypeAliasBounds {
|
||||
|
||||
// We use a HIR visitor to walk the type.
|
||||
use rustc::hir::intravisit::{self, Visitor};
|
||||
struct WalkAssocTypes<'a, 'db> where 'db: 'a {
|
||||
struct WalkAssocTypes<'a, 'db> where 'db {
|
||||
err: &'a mut DiagnosticBuilder<'db>
|
||||
}
|
||||
impl<'a, 'db, 'v> Visitor<'v> for WalkAssocTypes<'a, 'db> {
|
||||
|
@ -505,7 +505,7 @@ declare_lint! {
|
||||
|
||||
declare_lint_pass!(ImproperCTypes => [IMPROPER_CTYPES]);
|
||||
|
||||
struct ImproperCTypesVisitor<'a, 'tcx: 'a> {
|
||||
struct ImproperCTypesVisitor<'a, 'tcx> {
|
||||
cx: &'a LateContext<'a, 'tcx>,
|
||||
}
|
||||
|
||||
|
@ -295,7 +295,7 @@ impl<'a> CrateLoader<'a> {
|
||||
path_kind: PathKind,
|
||||
) -> Option<(LoadResult, Option<Library>)>
|
||||
where
|
||||
'a: 'b
|
||||
'a
|
||||
{
|
||||
// Use a new locator Context so trying to load a proc macro doesn't affect the error
|
||||
// message we emit
|
||||
|
@ -35,7 +35,7 @@ use syntax::ext::hygiene::Mark;
|
||||
use syntax_pos::{self, Span, BytePos, Pos, DUMMY_SP, NO_EXPANSION};
|
||||
use log::debug;
|
||||
|
||||
pub struct DecodeContext<'a, 'tcx: 'a> {
|
||||
pub struct DecodeContext<'a, 'tcx> {
|
||||
opaque: opaque::Decoder<'a>,
|
||||
cdata: Option<&'a CrateMetadata>,
|
||||
sess: Option<&'a Session>,
|
||||
@ -128,7 +128,7 @@ impl<'a, 'tcx> Metadata<'a, 'tcx> for (&'a CrateMetadata, TyCtxt<'tcx>) {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'tcx: 'a, T: Decodable> Lazy<T> {
|
||||
impl<'a, 'tcx, T: Decodable> Lazy<T> {
|
||||
pub fn decode<M: Metadata<'a, 'tcx>>(self, meta: M) -> T {
|
||||
let mut dcx = meta.decoder(self.position);
|
||||
dcx.lazy_state = LazyState::NodeStart(self.position);
|
||||
@ -136,7 +136,7 @@ impl<'a, 'tcx: 'a, T: Decodable> Lazy<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'tcx: 'a, T: Decodable> LazySeq<T> {
|
||||
impl<'a, 'tcx, T: Decodable> LazySeq<T> {
|
||||
pub fn decode<M: Metadata<'a, 'tcx>>(
|
||||
self,
|
||||
meta: M,
|
||||
|
@ -160,7 +160,7 @@ impl<'tcx> BorrowSet<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
struct GatherBorrows<'a, 'tcx: 'a> {
|
||||
struct GatherBorrows<'a, 'tcx> {
|
||||
tcx: TyCtxt<'tcx>,
|
||||
body: &'a Body<'tcx>,
|
||||
idx_vec: IndexVec<BorrowIndex, BorrowData<'tcx>>,
|
||||
|
@ -22,7 +22,7 @@ use std::fmt;
|
||||
use std::rc::Rc;
|
||||
|
||||
// (forced to be `pub` due to its use as an associated type below.)
|
||||
crate struct Flows<'b, 'tcx: 'b> {
|
||||
crate struct Flows<'b, 'tcx> {
|
||||
borrows: FlowAtLocation<'tcx, Borrows<'b, 'tcx>>,
|
||||
pub uninits: FlowAtLocation<'tcx, MaybeUninitializedPlaces<'b, 'tcx>>,
|
||||
pub ever_inits: FlowAtLocation<'tcx, EverInitializedPlaces<'b, 'tcx>>,
|
||||
|
@ -423,7 +423,7 @@ fn downgrade_if_error(diag: &mut Diagnostic) {
|
||||
}
|
||||
}
|
||||
|
||||
pub struct MirBorrowckCtxt<'cx, 'tcx: 'cx> {
|
||||
pub struct MirBorrowckCtxt<'cx, 'tcx> {
|
||||
infcx: &'cx InferCtxt<'cx, 'tcx>,
|
||||
body: &'cx Body<'tcx>,
|
||||
mir_def_id: DefId,
|
||||
@ -891,7 +891,7 @@ enum InitializationRequiringAction {
|
||||
PartialAssignment,
|
||||
}
|
||||
|
||||
struct RootPlace<'d, 'tcx: 'd> {
|
||||
struct RootPlace<'d, 'tcx> {
|
||||
place: &'d Place<'tcx>,
|
||||
is_local_mutation_allowed: LocalMutationIsAllowed,
|
||||
}
|
||||
@ -1693,7 +1693,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
||||
fn move_path_closest_to<'a>(
|
||||
&mut self,
|
||||
place: &'a Place<'tcx>,
|
||||
) -> Result<(&'a Place<'tcx>, MovePathIndex), NoMovePathFound> where 'cx: 'a {
|
||||
) -> Result<(&'a Place<'tcx>, MovePathIndex), NoMovePathFound> where 'cx {
|
||||
let mut last_prefix = place;
|
||||
for prefix in self.prefixes(place, PrefixSet::All) {
|
||||
if let Some(mpi) = self.move_path_for_place(prefix) {
|
||||
|
@ -35,7 +35,7 @@ pub(super) fn generate_constraints<'cx, 'tcx>(
|
||||
}
|
||||
|
||||
/// 'cg = the duration of the constraint generation process itself.
|
||||
struct ConstraintGeneration<'cg, 'cx: 'cg, 'tcx: 'cx> {
|
||||
struct ConstraintGeneration<'cg, 'cx, 'tcx> {
|
||||
infcx: &'cg InferCtxt<'cx, 'tcx>,
|
||||
all_facts: &'cg mut Option<AllFacts>,
|
||||
location_table: &'cg LocationTable,
|
||||
|
@ -27,7 +27,7 @@ crate fn find<'tcx>(
|
||||
uf.find()
|
||||
}
|
||||
|
||||
struct UseFinder<'cx, 'tcx: 'cx> {
|
||||
struct UseFinder<'cx, 'tcx> {
|
||||
body: &'cx Body<'tcx>,
|
||||
regioncx: &'cx Rc<RegionInferenceContext<'tcx>>,
|
||||
tcx: TyCtxt<'tcx>,
|
||||
@ -99,7 +99,7 @@ impl<'cx, 'tcx> UseFinder<'cx, 'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
struct DefUseVisitor<'cx, 'tcx: 'cx> {
|
||||
struct DefUseVisitor<'cx, 'tcx> {
|
||||
body: &'cx Body<'tcx>,
|
||||
tcx: TyCtxt<'tcx>,
|
||||
region_vid: RegionVid,
|
||||
|
@ -43,7 +43,7 @@ pub(super) fn generate_invalidates<'tcx>(
|
||||
}
|
||||
}
|
||||
|
||||
struct InvalidationGenerator<'cx, 'tcx: 'cx> {
|
||||
struct InvalidationGenerator<'cx, 'tcx> {
|
||||
tcx: TyCtxt<'tcx>,
|
||||
all_facts: &'cx mut AllFacts,
|
||||
location_table: &'cx LocationTable,
|
||||
|
@ -29,7 +29,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
struct RawConstraints<'a, 'tcx: 'a> {
|
||||
struct RawConstraints<'a, 'tcx> {
|
||||
regioncx: &'a RegionInferenceContext<'tcx>,
|
||||
}
|
||||
|
||||
@ -78,7 +78,7 @@ impl<'a, 'this, 'tcx> dot::GraphWalk<'this> for RawConstraints<'a, 'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
struct SccConstraints<'a, 'tcx: 'a> {
|
||||
struct SccConstraints<'a, 'tcx> {
|
||||
regioncx: &'a RegionInferenceContext<'tcx>,
|
||||
nodes_per_scc: IndexVec<ConstraintSccIndex, Vec<RegionVid>>,
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ use rustc::ty::subst::UnpackedKind;
|
||||
use rustc::ty::{self, TyCtxt};
|
||||
use syntax_pos::DUMMY_SP;
|
||||
|
||||
crate struct ConstraintConversion<'a, 'tcx: 'a> {
|
||||
crate struct ConstraintConversion<'a, 'tcx> {
|
||||
infcx: &'a InferCtxt<'a, 'tcx>,
|
||||
tcx: TyCtxt<'tcx>,
|
||||
universal_regions: &'a UniversalRegions<'tcx>,
|
||||
|
@ -219,7 +219,7 @@ impl UniversalRegionRelations<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
struct UniversalRegionRelationsBuilder<'this, 'tcx: 'this> {
|
||||
struct UniversalRegionRelationsBuilder<'this, 'tcx> {
|
||||
infcx: &'this InferCtxt<'this, 'tcx>,
|
||||
param_env: ty::ParamEnv<'tcx>,
|
||||
universal_regions: Rc<UniversalRegions<'tcx>>,
|
||||
|
@ -60,9 +60,9 @@ pub(super) fn trace(
|
||||
/// Contextual state for the type-liveness generator.
|
||||
struct LivenessContext<'me, 'typeck, 'flow, 'tcx>
|
||||
where
|
||||
'typeck: 'me,
|
||||
'flow: 'me,
|
||||
'tcx: 'typeck + 'flow,
|
||||
'typeck,
|
||||
'flow,
|
||||
'tcx,
|
||||
{
|
||||
/// Current type-checker, giving us our inference context etc.
|
||||
typeck: &'me mut TypeChecker<'typeck, 'tcx>,
|
||||
@ -98,9 +98,9 @@ struct DropData<'tcx> {
|
||||
|
||||
struct LivenessResults<'me, 'typeck, 'flow, 'tcx>
|
||||
where
|
||||
'typeck: 'me,
|
||||
'flow: 'me,
|
||||
'tcx: 'typeck + 'flow,
|
||||
'typeck,
|
||||
'flow,
|
||||
'tcx,
|
||||
{
|
||||
cx: LivenessContext<'me, 'typeck, 'flow, 'tcx>,
|
||||
|
||||
|
@ -251,7 +251,7 @@ enum FieldAccessError {
|
||||
/// The sanitize_XYZ methods here take an MIR object and compute its
|
||||
/// type, calling `span_mirbug` and returning an error type if there
|
||||
/// is a problem.
|
||||
struct TypeVerifier<'a, 'b: 'a, 'tcx: 'b> {
|
||||
struct TypeVerifier<'a, 'b, 'tcx> {
|
||||
cx: &'a mut TypeChecker<'b, 'tcx>,
|
||||
body: &'b Body<'tcx>,
|
||||
last_span: Span,
|
||||
@ -830,7 +830,7 @@ impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> {
|
||||
/// constraints needed for it to be valid and well-typed. Along the
|
||||
/// way, it accrues region constraints -- these can later be used by
|
||||
/// NLL region checking.
|
||||
struct TypeChecker<'a, 'tcx: 'a> {
|
||||
struct TypeChecker<'a, 'tcx> {
|
||||
infcx: &'a InferCtxt<'a, 'tcx>,
|
||||
param_env: ty::ParamEnv<'tcx>,
|
||||
last_span: Span,
|
||||
@ -845,7 +845,7 @@ struct TypeChecker<'a, 'tcx: 'a> {
|
||||
universal_region_relations: &'a UniversalRegionRelations<'tcx>,
|
||||
}
|
||||
|
||||
struct BorrowCheckContext<'a, 'tcx: 'a> {
|
||||
struct BorrowCheckContext<'a, 'tcx> {
|
||||
universal_regions: &'a UniversalRegions<'tcx>,
|
||||
location_table: &'a LocationTable,
|
||||
all_facts: &'a mut Option<AllFacts>,
|
||||
|
@ -34,7 +34,7 @@ pub(super) fn relate_types<'tcx>(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
struct NllTypeRelatingDelegate<'me, 'bccx: 'me, 'tcx: 'bccx> {
|
||||
struct NllTypeRelatingDelegate<'me, 'bccx, 'tcx> {
|
||||
infcx: &'me InferCtxt<'me, 'tcx>,
|
||||
borrowck_context: Option<&'me mut BorrowCheckContext<'bccx, 'tcx>>,
|
||||
|
||||
|
@ -363,7 +363,7 @@ impl<'tcx> UniversalRegions<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
struct UniversalRegionsBuilder<'cx, 'tcx: 'cx> {
|
||||
struct UniversalRegionsBuilder<'cx, 'tcx> {
|
||||
infcx: &'cx InferCtxt<'cx, 'tcx>,
|
||||
mir_def_id: DefId,
|
||||
mir_hir_id: HirId,
|
||||
|
@ -36,7 +36,7 @@ impl<'tcx> IsPrefixOf<'tcx> for Place<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
pub(super) struct Prefixes<'cx, 'tcx: 'cx> {
|
||||
pub(super) struct Prefixes<'cx, 'tcx> {
|
||||
body: &'cx Body<'tcx>,
|
||||
tcx: TyCtxt<'tcx>,
|
||||
kind: PrefixSet,
|
||||
|
@ -46,7 +46,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
||||
|
||||
/// MIR visitor for collecting used mutable variables.
|
||||
/// The 'visit lifetime represents the duration of the MIR walk.
|
||||
struct GatherUsedMutsVisitor<'visit, 'cx: 'visit, 'tcx: 'cx> {
|
||||
struct GatherUsedMutsVisitor<'visit, 'cx, 'tcx> {
|
||||
temporary_used_locals: FxHashSet<Local>,
|
||||
never_initialized_mut_locals: &'visit mut FxHashSet<Local>,
|
||||
mbcx: &'visit mut MirBorrowckCtxt<'cx, 'tcx>,
|
||||
|
@ -661,7 +661,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Candidate<'pat, 'tcx: 'pat> {
|
||||
pub struct Candidate<'pat, 'tcx> {
|
||||
// span of the original pattern that gave rise to this candidate
|
||||
span: Span,
|
||||
|
||||
@ -705,7 +705,7 @@ struct Ascription<'tcx> {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct MatchPair<'pat, 'tcx: 'pat> {
|
||||
pub struct MatchPair<'pat, 'tcx> {
|
||||
// this place...
|
||||
place: Place<'tcx>,
|
||||
|
||||
@ -1691,7 +1691,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
||||
&mut self,
|
||||
block: BasicBlock,
|
||||
bindings: impl IntoIterator<Item = &'b Binding<'tcx>>,
|
||||
) where 'tcx: 'b {
|
||||
) where 'tcx {
|
||||
debug!("bind_matched_candidate_for_arm_body(block={:?})", block);
|
||||
|
||||
let re_erased = self.hir.tcx().lifetimes.re_erased;
|
||||
|
@ -241,7 +241,7 @@ impl BlockFrame {
|
||||
#[derive(Debug)]
|
||||
struct BlockContext(Vec<BlockFrame>);
|
||||
|
||||
struct Builder<'a, 'tcx: 'a> {
|
||||
struct Builder<'a, 'tcx> {
|
||||
hir: Cx<'a, 'tcx>,
|
||||
cfg: CFG<'tcx>,
|
||||
|
||||
|
@ -11,11 +11,11 @@ use crate::dataflow::BitDenotation;
|
||||
/// This is used to compute which locals are live during a yield expression for
|
||||
/// immovable generators.
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct HaveBeenBorrowedLocals<'a, 'tcx: 'a> {
|
||||
pub struct HaveBeenBorrowedLocals<'a, 'tcx> {
|
||||
body: &'a Body<'tcx>,
|
||||
}
|
||||
|
||||
impl<'a, 'tcx: 'a> HaveBeenBorrowedLocals<'a, 'tcx> {
|
||||
impl<'a, 'tcx> HaveBeenBorrowedLocals<'a, 'tcx> {
|
||||
pub fn new(body: &'a Body<'tcx>)
|
||||
-> Self {
|
||||
HaveBeenBorrowedLocals { body }
|
||||
@ -97,7 +97,7 @@ impl<'a, 'tcx> InitialFlow for HaveBeenBorrowedLocals<'a, 'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
struct BorrowedLocalsVisitor<'b, 'c: 'b> {
|
||||
struct BorrowedLocalsVisitor<'b, 'c> {
|
||||
sets: &'b mut BlockSets<'c, Local>,
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ newtype_index! {
|
||||
/// `BorrowIndex`, and maps each such index to a `BorrowData`
|
||||
/// describing the borrow. These indexes are used for representing the
|
||||
/// borrows in compact bitvectors.
|
||||
pub struct Borrows<'a, 'tcx: 'a> {
|
||||
pub struct Borrows<'a, 'tcx> {
|
||||
tcx: TyCtxt<'tcx>,
|
||||
body: &'a Body<'tcx>,
|
||||
|
||||
|
@ -63,7 +63,7 @@ pub(super) mod borrows;
|
||||
/// Similarly, at a given `drop` statement, the set-intersection
|
||||
/// between this data and `MaybeUninitializedPlaces` yields the set of
|
||||
/// places that would require a dynamic drop-flag at that statement.
|
||||
pub struct MaybeInitializedPlaces<'a, 'tcx: 'a> {
|
||||
pub struct MaybeInitializedPlaces<'a, 'tcx> {
|
||||
tcx: TyCtxt<'tcx>,
|
||||
body: &'a Body<'tcx>,
|
||||
mdpe: &'a MoveDataParamEnv<'tcx>,
|
||||
@ -114,7 +114,7 @@ impl<'a, 'tcx> HasMoveData<'tcx> for MaybeInitializedPlaces<'a, 'tcx> {
|
||||
/// Similarly, at a given `drop` statement, the set-intersection
|
||||
/// between this data and `MaybeInitializedPlaces` yields the set of
|
||||
/// places that would require a dynamic drop-flag at that statement.
|
||||
pub struct MaybeUninitializedPlaces<'a, 'tcx: 'a> {
|
||||
pub struct MaybeUninitializedPlaces<'a, 'tcx> {
|
||||
tcx: TyCtxt<'tcx>,
|
||||
body: &'a Body<'tcx>,
|
||||
mdpe: &'a MoveDataParamEnv<'tcx>,
|
||||
@ -164,19 +164,19 @@ impl<'a, 'tcx> HasMoveData<'tcx> for MaybeUninitializedPlaces<'a, 'tcx> {
|
||||
/// Similarly, at a given `drop` statement, the set-difference between
|
||||
/// this data and `MaybeInitializedPlaces` yields the set of places
|
||||
/// that would require a dynamic drop-flag at that statement.
|
||||
pub struct DefinitelyInitializedPlaces<'a, 'tcx: 'a> {
|
||||
pub struct DefinitelyInitializedPlaces<'a, 'tcx> {
|
||||
tcx: TyCtxt<'tcx>,
|
||||
body: &'a Body<'tcx>,
|
||||
mdpe: &'a MoveDataParamEnv<'tcx>,
|
||||
}
|
||||
|
||||
impl<'a, 'tcx: 'a> DefinitelyInitializedPlaces<'a, 'tcx> {
|
||||
impl<'a, 'tcx> DefinitelyInitializedPlaces<'a, 'tcx> {
|
||||
pub fn new(tcx: TyCtxt<'tcx>, body: &'a Body<'tcx>, mdpe: &'a MoveDataParamEnv<'tcx>) -> Self {
|
||||
DefinitelyInitializedPlaces { tcx: tcx, body: body, mdpe: mdpe }
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'tcx: 'a> HasMoveData<'tcx> for DefinitelyInitializedPlaces<'a, 'tcx> {
|
||||
impl<'a, 'tcx> HasMoveData<'tcx> for DefinitelyInitializedPlaces<'a, 'tcx> {
|
||||
fn move_data(&self) -> &MoveData<'tcx> { &self.mdpe.move_data }
|
||||
}
|
||||
|
||||
@ -209,13 +209,13 @@ impl<'a, 'tcx: 'a> HasMoveData<'tcx> for DefinitelyInitializedPlaces<'a, 'tcx> {
|
||||
/// c = S; // {a, b, c, d }
|
||||
/// }
|
||||
/// ```
|
||||
pub struct EverInitializedPlaces<'a, 'tcx: 'a> {
|
||||
pub struct EverInitializedPlaces<'a, 'tcx> {
|
||||
tcx: TyCtxt<'tcx>,
|
||||
body: &'a Body<'tcx>,
|
||||
mdpe: &'a MoveDataParamEnv<'tcx>,
|
||||
}
|
||||
|
||||
impl<'a, 'tcx: 'a> EverInitializedPlaces<'a, 'tcx> {
|
||||
impl<'a, 'tcx> EverInitializedPlaces<'a, 'tcx> {
|
||||
pub fn new(tcx: TyCtxt<'tcx>, body: &'a Body<'tcx>, mdpe: &'a MoveDataParamEnv<'tcx>) -> Self {
|
||||
EverInitializedPlaces { tcx: tcx, body: body, mdpe: mdpe }
|
||||
}
|
||||
|
@ -4,11 +4,11 @@ use rustc::mir::*;
|
||||
use crate::dataflow::BitDenotation;
|
||||
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct MaybeStorageLive<'a, 'tcx: 'a> {
|
||||
pub struct MaybeStorageLive<'a, 'tcx> {
|
||||
body: &'a Body<'tcx>,
|
||||
}
|
||||
|
||||
impl<'a, 'tcx: 'a> MaybeStorageLive<'a, 'tcx> {
|
||||
impl<'a, 'tcx> MaybeStorageLive<'a, 'tcx> {
|
||||
pub fn new(body: &'a Body<'tcx>)
|
||||
-> Self {
|
||||
MaybeStorageLive { body }
|
||||
|
@ -41,7 +41,7 @@ pub(crate) mod indexes {
|
||||
};
|
||||
}
|
||||
|
||||
pub(crate) struct DataflowBuilder<'a, 'tcx: 'a, BD>
|
||||
pub(crate) struct DataflowBuilder<'a, 'tcx, BD>
|
||||
where
|
||||
BD: BitDenotation<'tcx>
|
||||
{
|
||||
@ -86,7 +86,7 @@ pub(crate) trait Dataflow<'tcx, BD: BitDenotation<'tcx>> {
|
||||
fn propagate(&mut self);
|
||||
}
|
||||
|
||||
impl<'a, 'tcx: 'a, BD> Dataflow<'tcx, BD> for DataflowBuilder<'a, 'tcx, BD>
|
||||
impl<'a, 'tcx, BD> Dataflow<'tcx, BD> for DataflowBuilder<'a, 'tcx, BD>
|
||||
where
|
||||
BD: BitDenotation<'tcx>
|
||||
{
|
||||
@ -138,7 +138,7 @@ where
|
||||
flow_state.run(tcx, def_id, attributes, p)
|
||||
}
|
||||
|
||||
impl<'a, 'tcx: 'a, BD> DataflowAnalysis<'a, 'tcx, BD>
|
||||
impl<'a, 'tcx, BD> DataflowAnalysis<'a, 'tcx, BD>
|
||||
where
|
||||
BD: BitDenotation<'tcx>,
|
||||
{
|
||||
@ -179,12 +179,12 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
struct PropagationContext<'b, 'a: 'b, 'tcx: 'a, O> where O: 'b + BitDenotation<'tcx>
|
||||
struct PropagationContext<'b, 'a, 'tcx, O> where O: 'b + BitDenotation<'tcx>
|
||||
{
|
||||
builder: &'b mut DataflowAnalysis<'a, 'tcx, O>,
|
||||
}
|
||||
|
||||
impl<'a, 'tcx: 'a, BD> DataflowAnalysis<'a, 'tcx, BD> where BD: BitDenotation<'tcx>
|
||||
impl<'a, 'tcx, BD> DataflowAnalysis<'a, 'tcx, BD> where BD: BitDenotation<'tcx>
|
||||
{
|
||||
fn propagate(&mut self) {
|
||||
let mut temp = BitSet::new_empty(self.flow_state.sets.bits_per_block);
|
||||
@ -234,7 +234,7 @@ impl<'a, 'tcx: 'a, BD> DataflowAnalysis<'a, 'tcx, BD> where BD: BitDenotation<'t
|
||||
}
|
||||
}
|
||||
|
||||
impl<'b, 'a: 'b, 'tcx: 'a, BD> PropagationContext<'b, 'a, 'tcx, BD> where BD: BitDenotation<'tcx>
|
||||
impl<'b, 'a, 'tcx, BD> PropagationContext<'b, 'a, 'tcx, BD> where BD: BitDenotation<'tcx>
|
||||
{
|
||||
fn walk_cfg(&mut self, in_out: &mut BitSet<BD::Idx>) {
|
||||
let mut dirty_queue: WorkQueue<mir::BasicBlock> =
|
||||
@ -265,7 +265,7 @@ fn dataflow_path(context: &str, path: &str) -> PathBuf {
|
||||
path
|
||||
}
|
||||
|
||||
impl<'a, 'tcx: 'a, BD> DataflowBuilder<'a, 'tcx, BD> where BD: BitDenotation<'tcx>
|
||||
impl<'a, 'tcx, BD> DataflowBuilder<'a, 'tcx, BD> where BD: BitDenotation<'tcx>
|
||||
{
|
||||
fn pre_dataflow_instrumentation<P>(&self, p: P) -> io::Result<()>
|
||||
where P: Fn(&BD, BD::Idx) -> DebugFormatted
|
||||
@ -297,7 +297,7 @@ impl<'a, 'tcx: 'a, BD> DataflowBuilder<'a, 'tcx, BD> where BD: BitDenotation<'tc
|
||||
/// underlying flow analysis results, because it needs to handle cases
|
||||
/// where we are combining the results of *multiple* flow analyses
|
||||
/// (e.g., borrows + inits + uninits).
|
||||
pub(crate) trait DataflowResultsConsumer<'a, 'tcx: 'a> {
|
||||
pub(crate) trait DataflowResultsConsumer<'a, 'tcx> {
|
||||
type FlowState: FlowsAtLocation;
|
||||
|
||||
// Observation Hooks: override (at least one of) these to get analysis feedback.
|
||||
@ -387,14 +387,14 @@ pub fn state_for_location<'tcx, T: BitDenotation<'tcx>>(loc: Location,
|
||||
gen_set.to_dense()
|
||||
}
|
||||
|
||||
pub struct DataflowAnalysis<'a, 'tcx: 'a, O> where O: BitDenotation<'tcx>
|
||||
pub struct DataflowAnalysis<'a, 'tcx, O> where O: BitDenotation<'tcx>
|
||||
{
|
||||
flow_state: DataflowState<'tcx, O>,
|
||||
dead_unwinds: &'a BitSet<mir::BasicBlock>,
|
||||
body: &'a Body<'tcx>,
|
||||
}
|
||||
|
||||
impl<'a, 'tcx: 'a, O> DataflowAnalysis<'a, 'tcx, O> where O: BitDenotation<'tcx>
|
||||
impl<'a, 'tcx, O> DataflowAnalysis<'a, 'tcx, O> where O: BitDenotation<'tcx>
|
||||
{
|
||||
pub fn results(self) -> DataflowResults<'tcx, O> {
|
||||
DataflowResults(self.flow_state)
|
||||
@ -734,7 +734,7 @@ impl<'a, 'tcx, D> DataflowAnalysis<'a, 'tcx, D> where D: BitDenotation<'tcx>
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'tcx: 'a, D> DataflowAnalysis<'a, 'tcx, D> where D: BitDenotation<'tcx> {
|
||||
impl<'a, 'tcx, D> DataflowAnalysis<'a, 'tcx, D> where D: BitDenotation<'tcx> {
|
||||
/// Propagates the bits of `in_out` into all the successors of `bb`,
|
||||
/// using bitwise operator denoted by `self.operator`.
|
||||
///
|
||||
|
@ -12,7 +12,7 @@ use super::{LocationMap, MoveData, MovePath, MovePathLookup, MovePathIndex, Move
|
||||
use super::{MoveError, InitIndex, Init, InitLocation, LookupResult, InitKind};
|
||||
use super::IllegalMoveOriginKind::*;
|
||||
|
||||
struct MoveDataBuilder<'a, 'tcx: 'a> {
|
||||
struct MoveDataBuilder<'a, 'tcx> {
|
||||
body: &'a Body<'tcx>,
|
||||
tcx: TyCtxt<'tcx>,
|
||||
data: MoveData<'tcx>,
|
||||
@ -253,7 +253,7 @@ impl<'a, 'tcx> MoveDataBuilder<'a, 'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
struct Gatherer<'b, 'a: 'b, 'tcx: 'a> {
|
||||
struct Gatherer<'b, 'a, 'tcx> {
|
||||
builder: &'b mut MoveDataBuilder<'a, 'tcx>,
|
||||
loc: Location,
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user