Type Alias rustc_borrowck::consumers::PoloniusInput

source ·
pub type PoloniusInput = AllFacts<RustcFacts>;

Aliased Type§

struct PoloniusInput {
Show 18 fields pub loan_issued_at: Vec<(PoloniusRegionVid, BorrowIndex, LocationIndex)>, pub universal_region: Vec<PoloniusRegionVid>, pub cfg_edge: Vec<(LocationIndex, LocationIndex)>, pub loan_killed_at: Vec<(BorrowIndex, LocationIndex)>, pub subset_base: Vec<(PoloniusRegionVid, PoloniusRegionVid, LocationIndex)>, pub loan_invalidated_at: Vec<(LocationIndex, BorrowIndex)>, pub var_used_at: Vec<(Local, LocationIndex)>, pub var_defined_at: Vec<(Local, LocationIndex)>, pub var_dropped_at: Vec<(Local, LocationIndex)>, pub use_of_var_derefs_origin: Vec<(Local, PoloniusRegionVid)>, pub drop_of_var_derefs_origin: Vec<(Local, PoloniusRegionVid)>, pub child_path: Vec<(MovePathIndex, MovePathIndex)>, pub path_is_var: Vec<(MovePathIndex, Local)>, pub path_assigned_at_base: Vec<(MovePathIndex, LocationIndex)>, pub path_moved_at_base: Vec<(MovePathIndex, LocationIndex)>, pub path_accessed_at_base: Vec<(MovePathIndex, LocationIndex)>, pub known_placeholder_subset: Vec<(PoloniusRegionVid, PoloniusRegionVid)>, pub placeholder: Vec<(PoloniusRegionVid, BorrowIndex)>,


§loan_issued_at: Vec<(PoloniusRegionVid, BorrowIndex, LocationIndex)>

loan_issued_at(origin, loan, point) indicates that the loan was “issued” at the given point, creating a reference with the origin. Effectively, origin may refer to data from loan starting at point (this is usually the point after a borrow rvalue).

§universal_region: Vec<PoloniusRegionVid>

universal_region(origin) – this is a “free region” within fn body

§cfg_edge: Vec<(LocationIndex, LocationIndex)>

cfg_edge(point1, point2) for each edge point1 -> point2 in the control flow

§loan_killed_at: Vec<(BorrowIndex, LocationIndex)>

loan_killed_at(loan, point) when some prefix of the path borrowed at loan is assigned at point. Indicates that the path borrowed by the loan has changed in some way that the loan no longer needs to be tracked. (In particular, mutations to the path that was borrowed no longer invalidate the loan)

§subset_base: Vec<(PoloniusRegionVid, PoloniusRegionVid, LocationIndex)>

subset_base(origin1, origin2, point) when we require origin1@point: origin2@point. Indicates that origin1 <= origin2 – i.e., the set of loans in origin1 are a subset of those in origin2.

§loan_invalidated_at: Vec<(LocationIndex, BorrowIndex)>

loan_invalidated_at(point, loan) indicates that the loan is invalidated by some action taking place at point; if any origin that references this loan is live, this is an error.

§var_used_at: Vec<(Local, LocationIndex)>

var_used_at(var, point) when the variable var is used for anything but a drop at point

§var_defined_at: Vec<(Local, LocationIndex)>

var_defined_at(var, point) when the variable var is overwritten at point

§var_dropped_at: Vec<(Local, LocationIndex)>

var_dropped_at(var, point) when the variable var is used in a drop at point

§use_of_var_derefs_origin: Vec<(Local, PoloniusRegionVid)>

use_of_var_derefs_origin(variable, origin): References with the given origin may be dereferenced when the variable is used.

In rustc, we generate this whenever the type of the variable includes the given origin.

§drop_of_var_derefs_origin: Vec<(Local, PoloniusRegionVid)>

drop_of_var_derefs_origin(var, origin) when the type of var includes the origin and uses it when dropping

§child_path: Vec<(MovePathIndex, MovePathIndex)>

child_path(child, parent) when the path child is the direct child of parent, e.g. child_path(x.y, x), but not child_path(x.y.z, x).

§path_is_var: Vec<(MovePathIndex, Local)>

path_is_var(path, var) the root path path starting in variable var.

§path_assigned_at_base: Vec<(MovePathIndex, LocationIndex)>

path_assigned_at_base(path, point) when the path was initialized at point point. This fact is only emitted for a prefix path, and not for the implicit initialization of all of path’s children. E.g. a statement like x.y = 3 at point would give the fact path_assigned_at_base(x.y, point) (but neither path_assigned_at_base(x.y.z, point) nor path_assigned_at_base(x, point)).

§path_moved_at_base: Vec<(MovePathIndex, LocationIndex)>

path_moved_at_base(path, point) when the path was moved at point. The same logic is applied as for path_assigned_at_base above.

§path_accessed_at_base: Vec<(MovePathIndex, LocationIndex)>

path_accessed_at_base(path, point) when the path was accessed at point point. The same logic as for path_assigned_at_base and path_moved_at_base applies.

§known_placeholder_subset: Vec<(PoloniusRegionVid, PoloniusRegionVid)>

These reflect the 'a: 'b relations that are either declared by the user on function declarations or which are inferred via implied bounds. For example: fn foo<'a, 'b: 'a, 'c>(x: &'c &'a u32) would have two entries:

  • one for the user-supplied subset 'b: 'a
  • and one for the 'a: 'c implied bound from the x parameter, (note that the transitive relation 'b: 'c is not necessarily included explicitly, but rather inferred by polonius).
§placeholder: Vec<(PoloniusRegionVid, BorrowIndex)>

placeholder(origin, loan) describes a placeholder origin, with its associated placeholder loan.

Trait Implementations§


impl AllFactsExt for AllFacts


fn enabled(tcx: TyCtxt<'_>) -> bool

Returns true if there is a need to gather AllFacts given the current -Z flags.


fn write_to_dir( &self, dir: impl AsRef<Path>, location_table: &LocationTable, ) -> Result<(), Box<dyn Error>>


Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 432 bytes