Skip to main content

Module user_ty

Module user_ty 

Source
Expand description

Helper code for building a linked list of user-type projections on the stack while visiting a THIR pattern.

This avoids having to repeatedly clone a partly-built UserTypeProjections at every step of the traversal, which is what the previous code was doing.

Re-exportsΒ§

use std::assert_matches; πŸ”’
use std::iter; πŸ”’
use rustc_abi::FieldIdx; πŸ”’
use rustc_abi::VariantIdx; πŸ”’
use rustc_data_structures::smallvec::SmallVec; πŸ”’
use rustc_middle::mir::ProjectionElem; πŸ”’
use rustc_middle::mir::UserTypeProjection; πŸ”’
use rustc_middle::mir::UserTypeProjections; πŸ”’
use rustc_middle::ty::AdtDef; πŸ”’
use rustc_middle::ty::UserTypeAnnotationIndex; πŸ”’
use rustc_span::Symbol; πŸ”’

EnumsΒ§

ProjectedUserTypesNode πŸ”’
ProjectedUserTypesOp πŸ”’
One of a list of β€œoperations” that can be used to lazily build projections of user-specified types.

Type AliasesΒ§

UserTypeIndices πŸ”’
A single thir::Pat node should almost never have more than 0-2 user types. We can store up to 4 inline in the same size as an ordinary Vec.