Struct polonius_engine::AllFacts[][src]

pub struct AllFacts<T: FactTypes> {
Show 18 fields pub loan_issued_at: Vec<(T::Origin, T::Loan, T::Point)>, pub universal_region: Vec<T::Origin>, pub cfg_edge: Vec<(T::Point, T::Point)>, pub loan_killed_at: Vec<(T::Loan, T::Point)>, pub subset_base: Vec<(T::Origin, T::Origin, T::Point)>, pub loan_invalidated_at: Vec<(T::Point, T::Loan)>, pub var_used_at: Vec<(T::Variable, T::Point)>, pub var_defined_at: Vec<(T::Variable, T::Point)>, pub var_dropped_at: Vec<(T::Variable, T::Point)>, pub use_of_var_derefs_origin: Vec<(T::Variable, T::Origin)>, pub drop_of_var_derefs_origin: Vec<(T::Variable, T::Origin)>, pub child_path: Vec<(T::Path, T::Path)>, pub path_is_var: Vec<(T::Path, T::Variable)>, pub path_assigned_at_base: Vec<(T::Path, T::Point)>, pub path_moved_at_base: Vec<(T::Path, T::Point)>, pub path_accessed_at_base: Vec<(T::Path, T::Point)>, pub known_placeholder_subset: Vec<(T::Origin, T::Origin)>, pub placeholder: Vec<(T::Origin, T::Loan)>,
Expand description

The “facts” which are the basis of the NLL borrow analysis.


loan_issued_at: Vec<(T::Origin, T::Loan, T::Point)>

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<T::Origin>

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

cfg_edge: Vec<(T::Point, T::Point)>

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

loan_killed_at: Vec<(T::Loan, T::Point)>

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<(T::Origin, T::Origin, T::Point)>

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<(T::Point, T::Loan)>

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<(T::Variable, T::Point)>

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

var_defined_at: Vec<(T::Variable, T::Point)>

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

var_dropped_at: Vec<(T::Variable, T::Point)>

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

use_of_var_derefs_origin: Vec<(T::Variable, T::Origin)>

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<(T::Variable, T::Origin)>

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

child_path: Vec<(T::Path, T::Path)>

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<(T::Path, T::Variable)>

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

path_assigned_at_base: Vec<(T::Path, T::Point)>

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<(T::Path, T::Point)>

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<(T::Path, T::Point)>

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<(T::Origin, T::Origin)>

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<(T::Origin, T::Loan)>

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

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.