Struct AllFacts

Source
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.

Fields§

§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§

Source§

impl<T: Clone + FactTypes> Clone for AllFacts<T>
where T::Origin: Clone, T::Loan: Clone, T::Point: Clone, T::Variable: Clone, T::Path: Clone,

Source§

fn clone(&self) -> AllFacts<T>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug + FactTypes> Debug for AllFacts<T>
where T::Origin: Debug, T::Loan: Debug, T::Point: Debug, T::Variable: Debug, T::Path: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: FactTypes> Default for AllFacts<T>

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl<T> Freeze for AllFacts<T>

§

impl<T> RefUnwindSafe for AllFacts<T>

§

impl<T> Send for AllFacts<T>
where <T as FactTypes>::Origin: Send, <T as FactTypes>::Loan: Send, <T as FactTypes>::Point: Send, <T as FactTypes>::Variable: Send, <T as FactTypes>::Path: Send,

§

impl<T> Sync for AllFacts<T>
where <T as FactTypes>::Origin: Sync, <T as FactTypes>::Loan: Sync, <T as FactTypes>::Point: Sync, <T as FactTypes>::Variable: Sync, <T as FactTypes>::Path: Sync,

§

impl<T> Unpin for AllFacts<T>
where <T as FactTypes>::Origin: Unpin, <T as FactTypes>::Loan: Unpin, <T as FactTypes>::Point: Unpin, <T as FactTypes>::Variable: Unpin, <T as FactTypes>::Path: Unpin,

§

impl<T> UnwindSafe for AllFacts<T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.