1
Fork 0

Auto merge of #114545 - fee1-dead-contrib:lower-impl-effect, r=oli-obk

correctly lower `impl const` to bind to host effect param

r? `@oli-obk`
This commit is contained in:
bors 2023-08-08 19:23:41 +00:00
commit f88a8b71ce
64 changed files with 465 additions and 373 deletions

View file

@ -2041,9 +2041,9 @@ impl<'tcx> TyCtxt<'tcx> {
matches!(
node,
hir::Node::Item(hir::Item {
kind: hir::ItemKind::Impl(hir::Impl { constness: hir::Constness::Const, .. }),
kind: hir::ItemKind::Impl(hir::Impl { generics, .. }),
..
})
}) if generics.params.iter().any(|p| self.has_attr(p.def_id, sym::rustc_host))
)
}

View file

@ -2841,6 +2841,11 @@ define_print_and_forward_display! {
ty::TraitPredicate<'tcx> {
p!(print(self.trait_ref.self_ty()), ": ");
if let Some(idx) = cx.tcx().generics_of(self.trait_ref.def_id).host_effect_index {
if self.trait_ref.args.const_at(idx) != cx.tcx().consts.true_ {
p!("~const ");
}
}
// FIXME(effects) print `~const` here
if let ty::ImplPolarity::Negative = self.polarity {
p!("!");