Skip to main content

Module util

Module util 

Source
Expand description

Miscellaneous type-system utilities that are too small to deserve their own modules.

Re-exportsยง

use std::fmt; ๐Ÿ”’
use std::iter; ๐Ÿ”’
use rustc_abi::Float; ๐Ÿ”’
use rustc_abi::Integer; ๐Ÿ”’
use rustc_abi::IntegerType; ๐Ÿ”’
use rustc_abi::Size; ๐Ÿ”’
use rustc_apfloat::Float as _; ๐Ÿ”’
use rustc_attr_ir::NotableTraitColor; ๐Ÿ”’
use rustc_attr_ir::find_attr; ๐Ÿ”’
use rustc_data_structures::fx::FxHashMap; ๐Ÿ”’
use rustc_data_structures::fx::FxHashSet; ๐Ÿ”’
use rustc_data_structures::stable_hash::StableHash; ๐Ÿ”’
use rustc_data_structures::stable_hash::StableHasher; ๐Ÿ”’
use rustc_errors::ErrorGuaranteed; ๐Ÿ”’
use rustc_hashes::Hash128; ๐Ÿ”’
use rustc_hir as hir; ๐Ÿ”’
use rustc_hir::def::CtorOf; ๐Ÿ”’
use rustc_hir::def::DefKind; ๐Ÿ”’
use rustc_hir::def::Res; ๐Ÿ”’
use rustc_hir::def_id::CrateNum; ๐Ÿ”’
use rustc_hir::def_id::DefId; ๐Ÿ”’
use rustc_hir::def_id::LocalDefId; ๐Ÿ”’
use rustc_index::bit_set::GrowableBitSet; ๐Ÿ”’
use rustc_macros::StableHash; ๐Ÿ”’
use rustc_macros::TyDecodable; ๐Ÿ”’
use rustc_macros::TyEncodable; ๐Ÿ”’
use rustc_macros::extension; ๐Ÿ”’
use rustc_span::bug; ๐Ÿ”’
use rustc_span::span_bug; ๐Ÿ”’
use rustc_span::sym; ๐Ÿ”’
use rustc_structures::Limit; ๐Ÿ”’
use rustc_type_ir::PredicateProxy; ๐Ÿ”’
use rustc_type_ir::solve::SizedTraitKind; ๐Ÿ”’
use smallvec::SmallVec; ๐Ÿ”’
use smallvec::smallvec; ๐Ÿ”’
use tracing::debug; ๐Ÿ”’
use tracing::instrument; ๐Ÿ”’
use tracing::instrument; ๐Ÿ”’
use super::TypingEnv; ๐Ÿ”’
use crate::middle::codegen_fn_attrs::CodegenFnAttrFlags; ๐Ÿ”’
use crate::mir; ๐Ÿ”’
use crate::query::Providers; ๐Ÿ”’
use crate::traits::ObligationCause; ๐Ÿ”’
use crate::ty::layout::FloatExt; ๐Ÿ”’
use crate::ty::layout::IntegerExt; ๐Ÿ”’
use crate::ty; ๐Ÿ”’
use crate::ty::Asyncness; ๐Ÿ”’
use crate::ty::FallibleTypeFolder; ๐Ÿ”’
use crate::ty::GenericArgKind; ๐Ÿ”’
use crate::ty::GenericArgs; ๐Ÿ”’
use crate::ty::Ty; ๐Ÿ”’
use crate::ty::TyCtxt; ๐Ÿ”’
use crate::ty::TypeFoldable; ๐Ÿ”’
use crate::ty::TypeFoldable; ๐Ÿ”’
use crate::ty::TypeFolder; ๐Ÿ”’
use crate::ty::TypeSuperFoldable; ๐Ÿ”’
use crate::ty::TypeVisitableExt; ๐Ÿ”’
use crate::ty::Unnormalized; ๐Ÿ”’

Structsยง

AlwaysRequiresDrop
Discr
FreeAliasTypeExpander ๐Ÿ”’
OpaqueTypeExpander ๐Ÿ”’

Enumsยง

CheckRegions
Used as an input to TyCtxt::uses_unique_generic_params.
NotUniqueParam

Traitsยง

IntTypeExt

Functionsยง

doc_notable_trait
Determines whether an item is annotated with doc(notable_trait).
fold_list
Does the equivalent of
intrinsic_raw
Determines whether an item is an intrinsic (which may be via Abi or via the rustc_intrinsic attribute).
is_doc_hidden ๐Ÿ”’
Determines whether an item is directly annotated with doc(hidden).
needs_drop_components
Returns a list of types such that the given type needs drop if and only if any of the returned types need drop. Returns Err(AlwaysRequiresDrop) if this type always needs drop.
needs_drop_components_with_async
Returns a list of types such that the given type needs drop if and only if any of the returned types need drop. Returns Err(AlwaysRequiresDrop) if this type always needs drop.
provide
reveal_opaque_types_in_bounds
Reveals all opaque types in the given value, replacing them with their underlying types.
try_fold_list
Does the equivalent of