File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,10 @@ impl<'tcx> TyCtxt<'tcx> {
4040 /// for being called from stable `const fn`s (`min_const_fn`).
4141 ///
4242 /// Adding more intrinsics requires sign-off from @rust-lang/lang.
43+ ///
44+ /// This list differs from the list in `is_const_intrinsic` in the sense that any item on this
45+ /// list must be on the `is_const_intrinsic` list, too, because if an intrinsic is callable from
46+ /// stable, it must be callable at all.
4347 fn is_intrinsic_min_const_fn ( self , def_id : DefId ) -> bool {
4448 match self . item_name ( def_id) {
4549 | sym:: size_of
@@ -108,6 +112,11 @@ pub fn provide(providers: &mut Providers<'_>) {
108112 match tcx. item_name ( def_id) {
109113 // Keep this list in the same order as the match patterns in
110114 // `librustc_mir/interpret/intrinsics.rs`
115+
116+ // This whitelist is a list of intrinsics that have a miri-engine implementation
117+ // and can thus be called when enabling enough feature gates. The similar
118+ // whitelist in `is_intrinsic_min_const_fn` (in this file), exists for allowing
119+ // the intrinsics to be transitively called by stable const fns.
111120 | sym:: caller_location
112121
113122 | sym:: min_align_of
You can’t perform that action at this time.
0 commit comments