File tree 7 files changed +10
-6
lines changed
7 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -435,7 +435,7 @@ impl TypeId {
435
435
/// assert_eq!(is_string(&"cookie monster".to_string()), true);
436
436
/// ```
437
437
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
438
- #[ rustc_const_stable ( feature = "const_type_id" , since = "1.46.0 " ) ]
438
+ #[ rustc_const_unstable ( feature = "const_type_id" , issue = "77125 " ) ]
439
439
pub const fn of < T : ?Sized + ' static > ( ) -> TypeId {
440
440
TypeId { t : intrinsics:: type_id :: < T > ( ) }
441
441
}
Original file line number Diff line number Diff line change @@ -807,7 +807,7 @@ extern "rust-intrinsic" {
807
807
/// crate it is invoked in.
808
808
///
809
809
/// The stabilized version of this intrinsic is [`crate::any::TypeId::of`].
810
- #[ rustc_const_stable ( feature = "const_type_id" , since = "1.46.0 " ) ]
810
+ #[ rustc_const_unstable ( feature = "const_type_id" , issue = "77125 " ) ]
811
811
pub fn type_id < T : ?Sized + ' static > ( ) -> u64 ;
812
812
813
813
/// A guard for unsafe functions that cannot ever be executed if `T` is uninhabited:
Original file line number Diff line number Diff line change 92
92
#![ feature( const_slice_ptr_len) ]
93
93
#![ feature( const_size_of_val) ]
94
94
#![ feature( const_align_of_val) ]
95
+ #![ feature( const_type_id) ]
95
96
#![ feature( const_type_name) ]
96
97
#![ feature( const_likely) ]
97
98
#![ feature( const_unreachable_unchecked) ]
Original file line number Diff line number Diff line change 1
1
// run-pass
2
+ #![ feature( const_type_id) ]
2
3
#![ feature( core_intrinsics) ]
3
4
4
5
use std:: any:: TypeId ;
Original file line number Diff line number Diff line change 5
5
// will be properly rejected. This test will ensure that monomorphic use of these
6
6
// would not be wrongly rejected in patterns.
7
7
8
+ #![ feature( const_type_id) ]
8
9
#![ feature( const_type_name) ]
9
10
10
11
use std:: any:: { self , TypeId } ;
Original file line number Diff line number Diff line change 5
5
// This test case should either run-pass or be rejected at compile time.
6
6
// Currently we just disallow this usage and require pattern is monomorphic.
7
7
8
+ #![ feature( const_type_id) ]
8
9
#![ feature( const_type_name) ]
9
10
10
11
use std:: any:: { self , TypeId } ;
Original file line number Diff line number Diff line change 1
1
error: constant pattern depends on a generic parameter
2
- --> $DIR/issue-73976-polymorphic.rs:19 :37
2
+ --> $DIR/issue-73976-polymorphic.rs:20 :37
3
3
|
4
4
LL | matches!(GetTypeId::<T>::VALUE, GetTypeId::<T>::VALUE)
5
5
| ^^^^^^^^^^^^^^^^^^^^^
6
6
7
7
error: constant pattern depends on a generic parameter
8
- --> $DIR/issue-73976-polymorphic.rs:31 :42
8
+ --> $DIR/issue-73976-polymorphic.rs:32 :42
9
9
|
10
10
LL | matches!(GetTypeNameLen::<T>::VALUE, GetTypeNameLen::<T>::VALUE)
11
11
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
12
12
13
13
error: constant pattern depends on a generic parameter
14
- --> $DIR/issue-73976-polymorphic.rs:19 :37
14
+ --> $DIR/issue-73976-polymorphic.rs:20 :37
15
15
|
16
16
LL | matches!(GetTypeId::<T>::VALUE, GetTypeId::<T>::VALUE)
17
17
| ^^^^^^^^^^^^^^^^^^^^^
18
18
19
19
error: constant pattern depends on a generic parameter
20
- --> $DIR/issue-73976-polymorphic.rs:31 :42
20
+ --> $DIR/issue-73976-polymorphic.rs:32 :42
21
21
|
22
22
LL | matches!(GetTypeNameLen::<T>::VALUE, GetTypeNameLen::<T>::VALUE)
23
23
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
You can’t perform that action at this time.
0 commit comments