File tree 1 file changed +9
-4
lines changed
src/librustc_mir/transform
1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -919,9 +919,17 @@ This does not pose a problem by itself because they can't be accessed directly."
919
919
Abi :: PlatformIntrinsic => {
920
920
assert ! ( !self . tcx. is_const_fn( def_id) ) ;
921
921
match & self . tcx . item_name ( def_id) . as_str ( ) [ ..] {
922
+ // Do not add anything to this list without consulting
923
+ // @eddyb, @oli-obk and @nikomatsakis
922
924
| "size_of"
923
925
| "min_align_of"
924
- | "type_id"
926
+ | "type_id" => {
927
+ is_const_fn = Some ( def_id) ;
928
+ promotable = true ;
929
+ } ,
930
+ // When adding something to this list, make sure to also implement
931
+ // the corresponding entry in the `call_intrinsic` method in
932
+ // rustc_mir::interpret::const_eval
925
933
| "bswap"
926
934
| "ctpop"
927
935
| "cttz"
@@ -935,9 +943,6 @@ This does not pose a problem by itself because they can't be accessed directly."
935
943
936
944
_ => { }
937
945
}
938
- // we can always mark intrinsics as promotable as they are inherently
939
- // unstable
940
- promotable = true ;
941
946
}
942
947
_ => {
943
948
if self . tcx . is_const_fn ( def_id) {
You can’t perform that action at this time.
0 commit comments