1
Fork 0

when an intrinsic has a const-stable fallback body, we can easily expose it on stable

This commit is contained in:
Ralf Jung 2024-11-02 08:49:49 +01:00
parent 5069434c81
commit a741b33c14
5 changed files with 37 additions and 8 deletions

View file

@ -1789,8 +1789,7 @@ pub fn intrinsic_raw(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Option<ty::Intrinsi
Some(ty::IntrinsicDef {
name: tcx.item_name(def_id.into()),
must_be_overridden: tcx.has_attr(def_id, sym::rustc_intrinsic_must_be_overridden),
const_stable: tcx.has_attr(def_id, sym::rustc_const_stable_intrinsic)
|| tcx.lookup_const_stability(def_id).is_some_and(|s| s.is_const_stable()),
const_stable: tcx.has_attr(def_id, sym::rustc_const_stable_intrinsic),
})
} else {
None