Skip to main content

rustc_type_ir/
lang_items.rs

1/// Lang items used by the new trait solver. This can be mapped to whatever internal
2/// representation of `LangItem`s used in the underlying compiler implementation.
3#[derive(#[automatically_derived]impl ::core::fmt::Debug for SolverProjectionLangItem {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_c_like_enum_write_str(f,
            "AsyncFnKindUpvars AsyncFnOnceOutput CallOnceFuture CallRefFuture CoroutineReturn CoroutineYield FieldBase FieldType FutureOutput Metadata",
            match self {
                SolverProjectionLangItem::AsyncFnKindUpvars => 0usize,
                SolverProjectionLangItem::AsyncFnOnceOutput => 18usize,
                SolverProjectionLangItem::CallOnceFuture => 36usize,
                SolverProjectionLangItem::CallRefFuture => 51usize,
                SolverProjectionLangItem::CoroutineReturn => 65usize,
                SolverProjectionLangItem::CoroutineYield => 81usize,
                SolverProjectionLangItem::FieldBase => 96usize,
                SolverProjectionLangItem::FieldType => 106usize,
                SolverProjectionLangItem::FutureOutput => 116usize,
                SolverProjectionLangItem::Metadata => 129usize,
            })
    }
}Debug, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for SolverProjectionLangItem {
}
#[automatically_derived]impl ::core::clone::Clone for SolverProjectionLangItem
    {
    #[inline]
    fn clone(&self) -> Self { *self }
}Clone, #[automatically_derived]impl ::core::marker::Copy for SolverProjectionLangItem
    {
}Copy, #[automatically_derived]impl ::core::marker::StructuralPartialEq for
    SolverProjectionLangItem {
}
#[automatically_derived]impl ::core::cmp::PartialEq for
    SolverProjectionLangItem {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
            ::core::intrinsics::discriminant_value(other)
    }
}PartialEq, #[automatically_derived]impl ::core::cmp::Eq for SolverProjectionLangItem { }Eq, #[automatically_derived]impl ::core::hash::Hash for SolverProjectionLangItem {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        ::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
            state)
    }
}Hash)]
4pub enum SolverProjectionLangItem {
5    // tidy-alphabetical-start
6    AsyncFnKindUpvars,
7    AsyncFnOnceOutput,
8    CallOnceFuture,
9    CallRefFuture,
10    CoroutineReturn,
11    CoroutineYield,
12    FieldBase,
13    FieldType,
14    FutureOutput,
15    Metadata,
16    // tidy-alphabetical-end
17}
18
19#[derive(#[automatically_derived]impl ::core::fmt::Debug for SolverAdtLangItem {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                SolverAdtLangItem::DynMetadata => "DynMetadata",
                SolverAdtLangItem::Option => "Option",
                SolverAdtLangItem::OwnedBox => "OwnedBox",
                SolverAdtLangItem::Poll => "Poll",
            })
    }
}Debug, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for SolverAdtLangItem {
}
#[automatically_derived]impl ::core::clone::Clone for SolverAdtLangItem {
    #[inline]
    fn clone(&self) -> Self { *self }
}Clone, #[automatically_derived]impl ::core::marker::Copy for SolverAdtLangItem { }Copy, #[automatically_derived]impl ::core::marker::StructuralPartialEq for
    SolverAdtLangItem {
}
#[automatically_derived]impl ::core::cmp::PartialEq for SolverAdtLangItem {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
            ::core::intrinsics::discriminant_value(other)
    }
}PartialEq, #[automatically_derived]impl ::core::cmp::Eq for SolverAdtLangItem { }Eq, #[automatically_derived]impl ::core::hash::Hash for SolverAdtLangItem {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        ::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
            state)
    }
}Hash)]
20pub enum SolverAdtLangItem {
21    // tidy-alphabetical-start
22    DynMetadata,
23    Option,
24    OwnedBox,
25    Poll,
26    // tidy-alphabetical-end
27}
28
29#[derive(#[automatically_derived]impl ::core::fmt::Debug for SolverTraitLangItem {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_c_like_enum_write_str(f,
            "AsyncFn AsyncFnKindHelper AsyncFnMut AsyncFnOnce AsyncIterator BikeshedGuaranteedNoDrop Clone Copy Coroutine Destruct DiscriminantKind Drop Field Fn FnMut FnOnce FnPtrTrait Freeze FusedIterator Future Iterator MetaSized PointeeSized PointeeTrait Sized TransmuteTrait TrivialClone TryAsDyn Tuple Unpin Unsize",
            match self {
                SolverTraitLangItem::AsyncFn => 0usize,
                SolverTraitLangItem::AsyncFnKindHelper => 8usize,
                SolverTraitLangItem::AsyncFnMut => 26usize,
                SolverTraitLangItem::AsyncFnOnce => 37usize,
                SolverTraitLangItem::AsyncIterator => 49usize,
                SolverTraitLangItem::BikeshedGuaranteedNoDrop => 63usize,
                SolverTraitLangItem::Clone => 88usize,
                SolverTraitLangItem::Copy => 94usize,
                SolverTraitLangItem::Coroutine => 99usize,
                SolverTraitLangItem::Destruct => 109usize,
                SolverTraitLangItem::DiscriminantKind => 118usize,
                SolverTraitLangItem::Drop => 135usize,
                SolverTraitLangItem::Field => 140usize,
                SolverTraitLangItem::Fn => 146usize,
                SolverTraitLangItem::FnMut => 149usize,
                SolverTraitLangItem::FnOnce => 155usize,
                SolverTraitLangItem::FnPtrTrait => 162usize,
                SolverTraitLangItem::Freeze => 173usize,
                SolverTraitLangItem::FusedIterator => 180usize,
                SolverTraitLangItem::Future => 194usize,
                SolverTraitLangItem::Iterator => 201usize,
                SolverTraitLangItem::MetaSized => 210usize,
                SolverTraitLangItem::PointeeSized => 220usize,
                SolverTraitLangItem::PointeeTrait => 233usize,
                SolverTraitLangItem::Sized => 246usize,
                SolverTraitLangItem::TransmuteTrait => 252usize,
                SolverTraitLangItem::TrivialClone => 267usize,
                SolverTraitLangItem::TryAsDyn => 280usize,
                SolverTraitLangItem::Tuple => 289usize,
                SolverTraitLangItem::Unpin => 295usize,
                SolverTraitLangItem::Unsize => 301usize,
            })
    }
}Debug, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for SolverTraitLangItem {
}
#[automatically_derived]impl ::core::clone::Clone for SolverTraitLangItem {
    #[inline]
    fn clone(&self) -> Self { *self }
}Clone, #[automatically_derived]impl ::core::marker::Copy for SolverTraitLangItem { }Copy, #[automatically_derived]impl ::core::marker::StructuralPartialEq for
    SolverTraitLangItem {
}
#[automatically_derived]impl ::core::cmp::PartialEq for SolverTraitLangItem {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
            ::core::intrinsics::discriminant_value(other)
    }
}PartialEq, #[automatically_derived]impl ::core::cmp::Eq for SolverTraitLangItem { }Eq, #[automatically_derived]impl ::core::hash::Hash for SolverTraitLangItem {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        ::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
            state)
    }
}Hash)]
30pub enum SolverTraitLangItem {
31    // tidy-alphabetical-start
32    AsyncFn,
33    AsyncFnKindHelper,
34    AsyncFnMut,
35    AsyncFnOnce,
36    AsyncIterator,
37    BikeshedGuaranteedNoDrop,
38    Clone,
39    Copy,
40    Coroutine,
41    Destruct,
42    DiscriminantKind,
43    Drop,
44    Field,
45    Fn,
46    FnMut,
47    FnOnce,
48    FnPtrTrait,
49    Freeze,
50    FusedIterator,
51    Future,
52    Iterator,
53    MetaSized,
54    PointeeSized,
55    PointeeTrait,
56    Sized,
57    TransmuteTrait,
58    TrivialClone,
59    TryAsDyn,
60    Tuple,
61    Unpin,
62    Unsize,
63    // tidy-alphabetical-end
64}