1
Fork 0

Add constness to TraitDef

This commit is contained in:
Deadbeef 2024-07-01 08:36:28 +00:00
parent f92a6c41e6
commit 46af987072
9 changed files with 42 additions and 31 deletions

View file

@ -625,9 +625,12 @@ impl<'hir> LoweringContext<'_, 'hir> {
_ => Const::No,
}
} else {
self.tcx
.get_attr(def_id, sym::const_trait)
.map_or(Const::No, |attr| Const::Yes(attr.span))
if self.tcx.is_const_trait(def_id) {
// FIXME(effects) span
Const::Yes(self.tcx.def_ident_span(def_id).unwrap())
} else {
Const::No
}
}
} else {
Const::No