[−][src]Struct rustc_passes::liveness::Liveness
Fields
ir: &'a mut IrMaps<'tcx>body_owner: LocalDefIdtypeck_results: &'a TypeckResults<'tcx>param_env: ParamEnv<'tcx>upvars: Option<&'tcx FxIndexMap<HirId, Upvar>>closure_captures: Option<&'tcx FxIndexMap<HirId, UpvarId>>successors: IndexVec<LiveNode, Option<LiveNode>>rwu_table: RWUTableclosure_ln: LiveNodeA live node representing a point of execution before closure entry & after closure exit. Used to calculate liveness of captured variables through calls to the same closure. Used for Fn & FnMut closures only.
exit_ln: LiveNodeA live node representing every 'exit' from the function, whether it be by explicit return, panic, or other means.
break_ln: HirIdMap<LiveNode>cont_ln: HirIdMap<LiveNode>Implementations
impl<'a, 'tcx> Liveness<'a, 'tcx>[src]
pub(in liveness) fn new(
ir: &'a mut IrMaps<'tcx>,
body_owner: LocalDefId
) -> Liveness<'a, 'tcx>[src]
ir: &'a mut IrMaps<'tcx>,
body_owner: LocalDefId
) -> Liveness<'a, 'tcx>
pub(in liveness) fn live_node(
&self,
hir_id: HirId,
span: Span
) -> LiveNode[src]
&self,
hir_id: HirId,
span: Span
) -> LiveNode
pub(in liveness) fn variable(
&self,
hir_id: HirId,
span: Span
) -> Variable[src]
&self,
hir_id: HirId,
span: Span
) -> Variable
pub(in liveness) fn define_bindings_in_pat(
&mut self,
pat: &Pat<'_>,
succ: LiveNode
) -> LiveNode[src]
&mut self,
pat: &Pat<'_>,
succ: LiveNode
) -> LiveNode
pub(in liveness) fn idx(
&self,
ln: LiveNode,
var: Variable
) -> usize[src]
&self,
ln: LiveNode,
var: Variable
) -> usize
pub(in liveness) fn live_on_entry(
&self,
ln: LiveNode,
var: Variable
) -> Option<LiveNodeKind>[src]
&self,
ln: LiveNode,
var: Variable
) -> Option<LiveNodeKind>
pub(in liveness) fn live_on_exit(
&self,
ln: LiveNode,
var: Variable
) -> Option<LiveNodeKind>[src]
&self,
ln: LiveNode,
var: Variable
) -> Option<LiveNodeKind>
pub(in liveness) fn used_on_entry(
&self,
ln: LiveNode,
var: Variable
) -> bool[src]
&self,
ln: LiveNode,
var: Variable
) -> bool
pub(in liveness) fn assigned_on_entry(
&self,
ln: LiveNode,
var: Variable
) -> Option<LiveNodeKind>[src]
&self,
ln: LiveNode,
var: Variable
) -> Option<LiveNodeKind>
pub(in liveness) fn assigned_on_exit(
&self,
ln: LiveNode,
var: Variable
) -> Option<LiveNodeKind>[src]
&self,
ln: LiveNode,
var: Variable
) -> Option<LiveNodeKind>
pub(in liveness) fn indices2<F>(
&mut self,
ln: LiveNode,
succ_ln: LiveNode,
op: F
) where
F: FnMut(&mut Liveness<'a, 'tcx>, usize, usize), [src]
&mut self,
ln: LiveNode,
succ_ln: LiveNode,
op: F
) where
F: FnMut(&mut Liveness<'a, 'tcx>, usize, usize),
pub(in liveness) fn write_vars<F>(
&self,
wr: &mut dyn Write,
ln: LiveNode,
test: F
) -> Result<()> where
F: FnMut(usize) -> bool, [src]
&self,
wr: &mut dyn Write,
ln: LiveNode,
test: F
) -> Result<()> where
F: FnMut(usize) -> bool,
pub(in liveness) fn ln_str(
&self,
ln: LiveNode
) -> String[src]
&self,
ln: LiveNode
) -> String
pub(in liveness) fn log_liveness(
&self,
entry_ln: LiveNode,
hir_id: HirId
)[src]
&self,
entry_ln: LiveNode,
hir_id: HirId
)
pub(in liveness) fn init_empty(
&mut self,
ln: LiveNode,
succ_ln: LiveNode
)[src]
&mut self,
ln: LiveNode,
succ_ln: LiveNode
)
pub(in liveness) fn init_from_succ(
&mut self,
ln: LiveNode,
succ_ln: LiveNode
)[src]
&mut self,
ln: LiveNode,
succ_ln: LiveNode
)
pub(in liveness) fn merge_from_succ(
&mut self,
ln: LiveNode,
succ_ln: LiveNode,
first_merge: bool
) -> bool[src]
&mut self,
ln: LiveNode,
succ_ln: LiveNode,
first_merge: bool
) -> bool
pub(in liveness) fn define(
&mut self,
writer: LiveNode,
var: Variable
)[src]
&mut self,
writer: LiveNode,
var: Variable
)
pub(in liveness) fn acc(
&mut self,
ln: LiveNode,
var: Variable,
acc: u32
)[src]
&mut self,
ln: LiveNode,
var: Variable,
acc: u32
)
pub(in liveness) fn compute(
&mut self,
body: &Body<'_>,
hir_id: HirId
) -> LiveNode[src]
&mut self,
body: &Body<'_>,
hir_id: HirId
) -> LiveNode
pub(in liveness) fn propagate_through_block(
&mut self,
blk: &Block<'_>,
succ: LiveNode
) -> LiveNode[src]
&mut self,
blk: &Block<'_>,
succ: LiveNode
) -> LiveNode
pub(in liveness) fn propagate_through_stmt(
&mut self,
stmt: &Stmt<'_>,
succ: LiveNode
) -> LiveNode[src]
&mut self,
stmt: &Stmt<'_>,
succ: LiveNode
) -> LiveNode
pub(in liveness) fn propagate_through_exprs(
&mut self,
exprs: &[Expr<'_>],
succ: LiveNode
) -> LiveNode[src]
&mut self,
exprs: &[Expr<'_>],
succ: LiveNode
) -> LiveNode
pub(in liveness) fn propagate_through_opt_expr(
&mut self,
opt_expr: Option<&Expr<'_>>,
succ: LiveNode
) -> LiveNode[src]
&mut self,
opt_expr: Option<&Expr<'_>>,
succ: LiveNode
) -> LiveNode
pub(in liveness) fn propagate_through_expr(
&mut self,
expr: &Expr<'_>,
succ: LiveNode
) -> LiveNode[src]
&mut self,
expr: &Expr<'_>,
succ: LiveNode
) -> LiveNode
pub(in liveness) fn propagate_through_place_components(
&mut self,
expr: &Expr<'_>,
succ: LiveNode
) -> LiveNode[src]
&mut self,
expr: &Expr<'_>,
succ: LiveNode
) -> LiveNode
pub(in liveness) fn write_place(
&mut self,
expr: &Expr<'_>,
succ: LiveNode,
acc: u32
) -> LiveNode[src]
&mut self,
expr: &Expr<'_>,
succ: LiveNode,
acc: u32
) -> LiveNode
pub(in liveness) fn access_var(
&mut self,
hir_id: HirId,
var_hid: HirId,
succ: LiveNode,
acc: u32,
span: Span
) -> LiveNode[src]
&mut self,
hir_id: HirId,
var_hid: HirId,
succ: LiveNode,
acc: u32,
span: Span
) -> LiveNode
pub(in liveness) fn access_path(
&mut self,
hir_id: HirId,
path: &Path<'_>,
succ: LiveNode,
acc: u32
) -> LiveNode[src]
&mut self,
hir_id: HirId,
path: &Path<'_>,
succ: LiveNode,
acc: u32
) -> LiveNode
pub(in liveness) fn propagate_through_loop(
&mut self,
expr: &Expr<'_>,
body: &Block<'_>,
succ: LiveNode
) -> LiveNode[src]
&mut self,
expr: &Expr<'_>,
body: &Block<'_>,
succ: LiveNode
) -> LiveNode
impl<'tcx, '_> Liveness<'_, 'tcx>[src]
pub(in liveness) fn check_place(
&mut self,
expr: &'tcx Expr<'tcx>
)[src]
&mut self,
expr: &'tcx Expr<'tcx>
)
pub(in liveness) fn should_warn(
&self,
var: Variable
) -> Option<String>[src]
&self,
var: Variable
) -> Option<String>
pub(in liveness) fn warn_about_unused_upvars(
&self,
entry_ln: LiveNode
)[src]
&self,
entry_ln: LiveNode
)
pub(in liveness) fn warn_about_unused_args(
&self,
body: &Body<'_>,
entry_ln: LiveNode
)[src]
&self,
body: &Body<'_>,
entry_ln: LiveNode
)
pub(in liveness) fn check_unused_vars_in_pat(
&self,
pat: &Pat<'_>,
entry_ln: Option<LiveNode>,
on_used_on_entry: impl Fn(Vec<Span>, HirId, LiveNode, Variable)
)[src]
&self,
pat: &Pat<'_>,
entry_ln: Option<LiveNode>,
on_used_on_entry: impl Fn(Vec<Span>, HirId, LiveNode, Variable)
)
pub(in liveness) fn report_unused(
&self,
hir_ids_and_spans: Vec<(HirId, Span)>,
ln: LiveNode,
var: Variable
)[src]
&self,
hir_ids_and_spans: Vec<(HirId, Span)>,
ln: LiveNode,
var: Variable
)
pub(in liveness) fn warn_about_dead_assign(
&self,
spans: Vec<Span>,
hir_id: HirId,
ln: LiveNode,
var: Variable
)[src]
&self,
spans: Vec<Span>,
hir_id: HirId,
ln: LiveNode,
var: Variable
)
pub(in liveness) fn report_unsed_assign(
&self,
hir_id: HirId,
spans: Vec<Span>,
var: Variable,
message: impl Fn(&str) -> String
)[src]
&self,
hir_id: HirId,
spans: Vec<Span>,
var: Variable,
message: impl Fn(&str) -> String
)
Trait Implementations
impl<'a, 'tcx> Visitor<'tcx> for Liveness<'a, 'tcx>[src]
type Map = ErasedMap<'tcx>
pub fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map>[src]
pub fn visit_local(&mut self, local: &'tcx Local<'tcx>)[src]
pub fn visit_expr(&mut self, ex: &'tcx Expr<'tcx>)[src]
pub fn visit_arm(&mut self, arm: &'tcx Arm<'tcx>)[src]
pub fn visit_nested_item(&mut self, id: ItemId)[src]
pub fn visit_nested_trait_item(&mut self, id: TraitItemId)[src]
pub fn visit_nested_impl_item(&mut self, id: ImplItemId)[src]
pub fn visit_nested_body(&mut self, id: BodyId)[src]
pub fn visit_param(&mut self, param: &'v Param<'v>)[src]
pub fn visit_item(&mut self, i: &'v Item<'v>)[src]
pub fn visit_body(&mut self, b: &'v Body<'v>)[src]
pub fn as_deep_visitor(&mut self) -> DeepVisitor<'_, Self>[src]
pub fn visit_id(&mut self, _hir_id: HirId)[src]
pub fn visit_name(&mut self, _span: Span, _name: Symbol)[src]
pub fn visit_ident(&mut self, ident: Ident)[src]
pub fn visit_mod(&mut self, m: &'v Mod<'v>, _s: Span, n: HirId)[src]
pub fn visit_foreign_item(&mut self, i: &'v ForeignItem<'v>)[src]
pub fn visit_block(&mut self, b: &'v Block<'v>)[src]
pub fn visit_stmt(&mut self, s: &'v Stmt<'v>)[src]
pub fn visit_pat(&mut self, p: &'v Pat<'v>)[src]
pub fn visit_anon_const(&mut self, c: &'v AnonConst)[src]
pub fn visit_ty(&mut self, t: &'v Ty<'v>)[src]
pub fn visit_generic_param(&mut self, p: &'v GenericParam<'v>)[src]
pub fn visit_generics(&mut self, g: &'v Generics<'v>)[src]
pub fn visit_where_predicate(&mut self, predicate: &'v WherePredicate<'v>)[src]
pub fn visit_fn_decl(&mut self, fd: &'v FnDecl<'v>)[src]
pub fn visit_fn(
&mut self,
fk: FnKind<'v>,
fd: &'v FnDecl<'v>,
b: BodyId,
s: Span,
id: HirId
)[src]
&mut self,
fk: FnKind<'v>,
fd: &'v FnDecl<'v>,
b: BodyId,
s: Span,
id: HirId
)
pub fn visit_use(&mut self, path: &'v Path<'v>, hir_id: HirId)[src]
pub fn visit_trait_item(&mut self, ti: &'v TraitItem<'v>)[src]
pub fn visit_trait_item_ref(&mut self, ii: &'v TraitItemRef)[src]
pub fn visit_impl_item(&mut self, ii: &'v ImplItem<'v>)[src]
pub fn visit_impl_item_ref(&mut self, ii: &'v ImplItemRef<'v>)[src]
pub fn visit_trait_ref(&mut self, t: &'v TraitRef<'v>)[src]
pub fn visit_param_bound(&mut self, bounds: &'v GenericBound<'v>)[src]
pub fn visit_poly_trait_ref(
&mut self,
t: &'v PolyTraitRef<'v>,
m: TraitBoundModifier
)[src]
&mut self,
t: &'v PolyTraitRef<'v>,
m: TraitBoundModifier
)
pub fn visit_variant_data(
&mut self,
s: &'v VariantData<'v>,
Symbol,
&'v Generics<'v>,
_parent_id: HirId,
Span
)[src]
&mut self,
s: &'v VariantData<'v>,
Symbol,
&'v Generics<'v>,
_parent_id: HirId,
Span
)
pub fn visit_struct_field(&mut self, s: &'v StructField<'v>)[src]
pub fn visit_enum_def(
&mut self,
enum_definition: &'v EnumDef<'v>,
generics: &'v Generics<'v>,
item_id: HirId,
Span
)[src]
&mut self,
enum_definition: &'v EnumDef<'v>,
generics: &'v Generics<'v>,
item_id: HirId,
Span
)
pub fn visit_variant(
&mut self,
v: &'v Variant<'v>,
g: &'v Generics<'v>,
item_id: HirId
)[src]
&mut self,
v: &'v Variant<'v>,
g: &'v Generics<'v>,
item_id: HirId
)
pub fn visit_label(&mut self, label: &'v Label)[src]
pub fn visit_generic_arg(&mut self, generic_arg: &'v GenericArg<'v>)[src]
pub fn visit_lifetime(&mut self, lifetime: &'v Lifetime)[src]
pub fn visit_qpath(&mut self, qpath: &'v QPath<'v>, id: HirId, span: Span)[src]
pub fn visit_path(&mut self, path: &'v Path<'v>, _id: HirId)[src]
pub fn visit_path_segment(
&mut self,
path_span: Span,
path_segment: &'v PathSegment<'v>
)[src]
&mut self,
path_span: Span,
path_segment: &'v PathSegment<'v>
)
pub fn visit_generic_args(
&mut self,
path_span: Span,
generic_args: &'v GenericArgs<'v>
)[src]
&mut self,
path_span: Span,
generic_args: &'v GenericArgs<'v>
)
pub fn visit_assoc_type_binding(&mut self, type_binding: &'v TypeBinding<'v>)[src]
pub fn visit_attribute(&mut self, _attr: &'v Attribute)[src]
pub fn visit_macro_def(&mut self, macro_def: &'v MacroDef<'v>)[src]
pub fn visit_vis(&mut self, vis: &'v Spanned<VisibilityKind<'v>>)[src]
pub fn visit_associated_item_kind(&mut self, kind: &'v AssocItemKind)[src]
pub fn visit_defaultness(&mut self, defaultness: &'v Defaultness)[src]
Auto Trait Implementations
impl<'a, 'tcx> !RefUnwindSafe for Liveness<'a, 'tcx>
impl<'a, 'tcx> !Send for Liveness<'a, 'tcx>
impl<'a, 'tcx> !Sync for Liveness<'a, 'tcx>
impl<'a, 'tcx> Unpin for Liveness<'a, 'tcx> where
'tcx: 'a,
'tcx: 'a,
impl<'a, 'tcx> !UnwindSafe for Liveness<'a, 'tcx>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,