Make is_intrinsic query return the intrinsic name

This commit is contained in:
Oli Scherer
2024-01-30 14:20:22 +00:00
parent de4d615e6b
commit 0eee945680
22 changed files with 38 additions and 43 deletions

View File

@@ -49,7 +49,7 @@ fn constness(tcx: TyCtxt<'_>, def_id: LocalDefId) -> hir::Constness {
hir::Node::ForeignItem(hir::ForeignItem { kind: hir::ForeignItemKind::Fn(..), .. }) => {
// Intrinsics use `rustc_const_{un,}stable` attributes to indicate constness. All other
// foreign items cannot be evaluated at compile-time.
let is_const = if tcx.is_intrinsic(def_id) {
let is_const = if tcx.intrinsic(def_id).is_some() {
tcx.lookup_const_stability(def_id).is_some()
} else {
false