@@ -2874,11 +2874,12 @@ pub const unsafe fn size_of_val<T: ?Sized>(ptr: *const T) -> usize;
28742874pub const unsafe fn align_of_val < T : ?Sized > ( ptr : * const T ) -> usize ;
28752875
28762876#[ rustc_intrinsic]
2877+ #[ rustc_comptime]
28772878#[ unstable( feature = "core_intrinsics" , issue = "none" ) ]
28782879/// Check if a type represented by a `TypeId` implements a trait represented by a `TypeId`.
28792880/// It can only be called at compile time, the backends do
28802881/// not implement it. If it implements the trait the dyn metadata gets returned for vtable access.
2881- pub const fn type_id_vtable (
2882+ pub fn type_id_vtable (
28822883 _id : crate :: any:: TypeId ,
28832884 _trait : crate :: any:: TypeId ,
28842885) -> Option < ptr:: DynMetadata < * const ( ) > > {
@@ -2922,7 +2923,8 @@ pub const fn type_name<T: ?Sized>() -> &'static str;
29222923#[ rustc_nounwind]
29232924#[ unstable( feature = "core_intrinsics" , issue = "none" ) ]
29242925#[ rustc_intrinsic]
2925- pub const fn type_id < T : ?Sized > ( ) -> crate :: any:: TypeId ;
2926+ #[ rustc_comptime]
2927+ pub fn type_id < T : ?Sized > ( ) -> crate :: any:: TypeId ;
29262928
29272929/// Tests (at compile-time) if two [`crate::any::TypeId`] instances identify the
29282930/// same type. This is necessary because at const-eval time the actual discriminating
@@ -2944,7 +2946,8 @@ pub const fn type_id_eq(a: crate::any::TypeId, b: crate::any::TypeId) -> bool {
29442946/// The more user-friendly version of this intrinsic is [`core::any::TypeId::size`].
29452947#[ rustc_intrinsic]
29462948#[ unstable( feature = "core_intrinsics" , issue = "none" ) ]
2947- pub const fn size_of_type_id ( _id : crate :: any:: TypeId ) -> Option < usize > {
2949+ #[ rustc_comptime]
2950+ pub fn size_of_type_id ( _id : crate :: any:: TypeId ) -> Option < usize > {
29482951 panic ! ( "`TypeId::size` can only be called at compile-time" )
29492952}
29502953
@@ -2953,7 +2956,8 @@ pub const fn size_of_type_id(_id: crate::any::TypeId) -> Option<usize> {
29532956/// The more user-friendly version of this intrinsic is [`core::any::TypeId::variants`].
29542957#[ rustc_intrinsic]
29552958#[ unstable( feature = "core_intrinsics" , issue = "none" ) ]
2956- pub const fn type_id_variants ( _id : crate :: any:: TypeId ) -> usize {
2959+ #[ rustc_comptime]
2960+ pub fn type_id_variants ( _id : crate :: any:: TypeId ) -> usize {
29572961 panic ! ( "`TypeId::variants` can only be called at compile-time" )
29582962}
29592963
@@ -2962,7 +2966,8 @@ pub const fn type_id_variants(_id: crate::any::TypeId) -> usize {
29622966/// The more user-friendly version of this intrinsic is [`core::any::TypeId::fields`].
29632967#[ rustc_intrinsic]
29642968#[ unstable( feature = "core_intrinsics" , issue = "none" ) ]
2965- pub const fn type_id_fields ( _id : crate :: any:: TypeId , _variant_index : usize ) -> usize {
2969+ #[ rustc_comptime]
2970+ pub fn type_id_fields ( _id : crate :: any:: TypeId , _variant_index : usize ) -> usize {
29662971 panic ! ( "`TypeId::fields` can only be called at compile-time" )
29672972}
29682973
@@ -2973,7 +2978,8 @@ pub const fn type_id_fields(_id: crate::any::TypeId, _variant_index: usize) -> u
29732978/// [`FieldRepresentingType`]: crate::field::FieldRepresentingType
29742979#[ rustc_intrinsic]
29752980#[ unstable( feature = "core_intrinsics" , issue = "none" ) ]
2976- pub const fn type_id_field_representing_type (
2981+ #[ rustc_comptime]
2982+ pub fn type_id_field_representing_type (
29772983 _id : crate :: any:: TypeId ,
29782984 _variant_index : usize ,
29792985 _field_index : usize ,
@@ -2988,7 +2994,8 @@ pub const fn type_id_field_representing_type(
29882994/// [`FieldRepresentingType`]: crate::field::FieldRepresentingType
29892995#[ rustc_intrinsic]
29902996#[ unstable( feature = "core_intrinsics" , issue = "none" ) ]
2991- pub const fn field_representing_type_actual_type_id (
2997+ #[ rustc_comptime]
2998+ pub fn field_representing_type_actual_type_id (
29922999 _frt_type_id : crate :: any:: TypeId ,
29933000) -> crate :: any:: TypeId {
29943001 panic ! ( "`FieldId::type_id` can only be called at compile-time" )
0 commit comments