lower impl const to bind to host effect param
This commit is contained in:
parent
4f7bb9890c
commit
92f4c59e48
24 changed files with 236 additions and 137 deletions
|
@ -1963,9 +1963,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))
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -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!("!");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue