Skip to main content

Module erase

Module erase 

Source
Expand description

To improve compile times and code size for the compiler itself, query values are “erased” in some contexts (e.g. inside in-memory cache types), to reduce the number of generic instantiations created during codegen.

See https://github.com/rust-lang/rust/pull/151715 for some bootstrap-time and performance benchmarks.

Re-exports§

use std::ffi::OsStr; 🔒
use std::intrinsics::transmute_unchecked; 🔒 Experimental
use std::marker::PhantomData; 🔒
use std::mem::MaybeUninit; 🔒
use rustc_ast::tokenstream::TokenStream; 🔒
use rustc_data_structures::steal::Steal; 🔒
use rustc_data_structures::sync::DynSend; 🔒
use rustc_data_structures::sync::DynSync; 🔒
use rustc_index::Idx; 🔒
use rustc_index::IndexSlice; 🔒
use rustc_span::def_id::ModId; 🔒
use rustc_span::ErrorGuaranteed; 🔒
use rustc_span::Spanned; 🔒
use crate::mono::MonoItem; 🔒
use crate::mono::NormalizationErrorInMono; 🔒
use crate::ty; 🔒
use crate::ty::Ty; 🔒
use crate::ty::TyCtxt; 🔒
use crate::mir; 🔒
use crate::thir; 🔒
use crate::traits; 🔒

Macros§

impl_erasable_for_types_with_no_type_params 🔒

Structs§

ErasedData
Internal implementation detail of Erased.

Traits§

Erasable
Trait for types that can be erased into Erased<Self>.

Functions§

erase_val
Erases a value of type T into Erased<T>.
restore_val
Restores an erased value to its real type.

Type Aliases§

Erased
A value of T that has been “erased” into some opaque storage type.

Foreign Types§

NoAutoTraits 🔒