Re-exportsยง
use std::cmp;๐use std::fmt::Write;๐use rustc_data_structures::fx::FxIndexMap;๐use rustc_hir as hir;๐use rustc_hir::HirId;๐use rustc_hir::def_id::LocalDefId;๐use rustc_macros::StableHash;๐use rustc_macros::TyDecodable;๐use rustc_macros::TyEncodable;๐use rustc_macros::TypeFoldable;๐use rustc_macros::TypeVisitable;๐use rustc_span::def_id::LocalDefIdMap;๐use rustc_span::Ident;๐use rustc_span::Span;๐use rustc_span::Symbol;๐use rustc_span::bug;๐use super::TyCtxt;๐use crate::hir::place::Place as HirPlace;๐use crate::hir::place::PlaceBase as HirPlaceBase;๐use crate::hir::place::ProjectionKind as HirProjectionKind;๐use crate::query::Providers;๐use crate::mir;๐use crate::ty;๐
Structsยง
- Capture
Info - Part of
MinCaptureInformationMap; describes the capture kind (&, &mut, move) for a particular capture as well as identifying the part of the source code that triggered this capture to occur. - Captured
Place - A composite describing a
Placethat is captured by a closure. - Closure
Type Info - UpvarId
- Upvars do not get their own
NodeId. Instead, we use the pair of the original var ID (that is, the root variable that is referenced by the upvar) and the ID of the closure expression. - Upvar
Path
Enumsยง
- Borrow
Kind - Upvar
Capture - Information describing the capture of an upvar. This is computed
during
typeck, specifically byregionck.
Constantsยง
- CAPTURE_
STRUCT_ LOCAL - Captures are represented using fields inside a structure. This represents accessing self in the closure structure
Functionsยง
- analyze_
coroutine_ closure_ captures - child_
prefix_ ๐matches_ parent_ projections - closure_
typeinfo ๐ - is_
ancestor_ or_ same_ capture - Return true if the
proj_possible_ancestorrepresents an ancestor path toproj_captureorproj_possible_ancestoris same asproj_capture, assuming they both start off of the same root variable. - place_
to_ string_ for_ capture - provide
Type Aliasesยง
- MinCapture
Information Map - Given the closure DefId this map provides a map of root variables to minimum
set of
CapturedPlaces that need to be tracked to support all captures of that closure. - MinCapture
List - Part of
MinCaptureInformationMap; List ofCapturePlaces. - Root
Variable MinCapture List - Part of
MinCaptureInformationMap; Maps a root variable to the list ofCapturedPlace. Used to track the minimum set ofPlaces that need to be captured to support all Places captured by the closure starting at a given root variable.