Skip to main content

RefDecodable

Trait RefDecodable 

Source
pub trait RefDecodable<'tcx>: PointeeSized {
    // Required method
    fn decode(d: &mut impl TyDecoder<'tcx>) -> &'tcx Self;
}
Expand description

Trait for decoding to a reference.

This is a separate trait from Decodable so that we can easily implement it for upstream types, such as FxHashSet.

The TyDecodable derive macro will use this trait for fields that are references (and don’t use a type alias to hide that).

Decodable can still be implemented in cases where Decodable is required by a trait bound; see impl_decodable_via_ref_decodable_for_local_types! for examples.

Implementations of this trait will typically allocate into an arena or interner, e.g. see impl_ref_decodable_into_arena! in rustc_middle::arena.

Required Methods§

Source

fn decode(d: &mut impl TyDecoder<'tcx>) -> &'tcx Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'tcx> RefDecodable<'tcx> for (Clause<'tcx>, Span)

Source§

fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self

Source§

impl<'tcx> RefDecodable<'tcx> for (ExportedSymbol<'tcx>, SymbolExportInfo)

Source§

fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self

Source§

impl<'tcx> RefDecodable<'tcx> for (PolyTraitRef<'tcx>, Span)

Source§

fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self

Source§

impl<'tcx> RefDecodable<'tcx> for Attribute

Source§

fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self

Source§

impl<'tcx> RefDecodable<'tcx> for DefId

Source§

fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self

Source§

impl<'tcx> RefDecodable<'tcx> for Ident

Source§

fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self

Source§

impl<'tcx> RefDecodable<'tcx> for IndexVec<Promoted, Body<'tcx>>

Source§

fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self

Source§

impl<'tcx> RefDecodable<'tcx> for InlineAsmTemplatePiece

Source§

fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self

Source§

impl<'tcx> RefDecodable<'tcx> for LocalDefId

Source§

fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self

Source§

impl<'tcx> RefDecodable<'tcx> for Span

Source§

fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self

Source§

impl<'tcx> RefDecodable<'tcx> for Spanned<MonoItem<'tcx>>

Source§

fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self

Source§

impl<'tcx> RefDecodable<'tcx> for TokenStream

Source§

fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self

Source§

impl<'tcx> RefDecodable<'tcx> for UnordMap<DefId, EarlyBinder<'tcx, Ty<'tcx>>>

Source§

fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self

Source§

impl<'tcx> RefDecodable<'tcx> for UnordSet<LocalDefId>

Source§

fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self

Source§

impl<'tcx> RefDecodable<'tcx> for [(Clause<'tcx>, Span)]

Source§

fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self

Source§

impl<'tcx> RefDecodable<'tcx> for [(ExportedSymbol<'tcx>, SymbolExportInfo)]

Source§

fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self

Source§

impl<'tcx> RefDecodable<'tcx> for [(PolyTraitRef<'tcx>, Span)]

Source§

fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self

Source§

impl<'tcx> RefDecodable<'tcx> for [Attribute]

Source§

fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self

Source§

impl<'tcx> RefDecodable<'tcx> for [Body<'tcx>]

Source§

fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self

Source§

impl<'tcx> RefDecodable<'tcx> for [DeducedParamAttrs]

Source§

fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self

Source§

impl<'tcx> RefDecodable<'tcx> for [DefId]

Source§

fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self

Source§

impl<'tcx> RefDecodable<'tcx> for [Graph]

Source§

fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self

Source§

impl<'tcx> RefDecodable<'tcx> for [Ident]

Source§

fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self

Source§

impl<'tcx> RefDecodable<'tcx> for [ImplSource<'tcx, ()>]

Source§

fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self

Source§

impl<'tcx> RefDecodable<'tcx> for [IndexVec<Promoted, Body<'tcx>>]

Source§

fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self

Source§

impl<'tcx> RefDecodable<'tcx> for [InlineAsmTemplatePiece]

Source§

fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self

Source§

impl<'tcx> RefDecodable<'tcx> for [LocalDefId]

Source§

fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self

Source§

impl<'tcx> RefDecodable<'tcx> for [Span]

Source§

fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self

Source§

impl<'tcx> RefDecodable<'tcx> for [Spanned<MonoItem<'tcx>>]

Source§

fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self

Source§

impl<'tcx> RefDecodable<'tcx> for [TokenStream]

Source§

fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self

Source§

impl<'tcx> RefDecodable<'tcx> for [TypeckResults<'tcx>]

Source§

fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self

Source§

impl<'tcx> RefDecodable<'tcx> for [UnordMap<DefId, EarlyBinder<'tcx, Ty<'tcx>>>]

Source§

fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self

Source§

impl<'tcx> RefDecodable<'tcx> for [UnordSet<LocalDefId>]

Source§

fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self

Source§

impl<'tcx> RefDecodable<'tcx> for [Variance]

Source§

fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self

Implementors§

Source§

impl<'tcx> RefDecodable<'tcx> for Body<'tcx>

Source§

impl<'tcx> RefDecodable<'tcx> for DeducedParamAttrs

Source§

impl<'tcx> RefDecodable<'tcx> for Graph

Source§

impl<'tcx> RefDecodable<'tcx> for ImplSource<'tcx, ()>

Source§

impl<'tcx> RefDecodable<'tcx> for List<BoundVariableKind<'tcx>>

Source§

impl<'tcx> RefDecodable<'tcx> for List<Const<'tcx>>

Source§

impl<'tcx> RefDecodable<'tcx> for List<Pattern<'tcx>>

Source§

impl<'tcx> RefDecodable<'tcx> for List<PolyExistentialPredicate<'tcx>>

Source§

impl<'tcx> RefDecodable<'tcx> for List<Ty<'tcx>>

Source§

impl<'tcx> RefDecodable<'tcx> for ListWithCachedTypeInfo<Clause<'tcx>>

Source§

impl<'tcx> RefDecodable<'tcx> for TypeckResults<'tcx>

Source§

impl<'tcx> RefDecodable<'tcx> for Variance