1
Fork 0

Auto merge of #118788 - compiler-errors:const-pretty, r=fee1-dead

Don't print host effect param in pretty `path_generic_args`

Make `own_args_no_defaults` pass back the `GenericParamDef`, so that we can pass both the args *and* param definitions into `path_generic_args`. That allows us to use the `GenericParamDef` to filter out effect params.

This allows us to filter out the host param regardless of whether it's `sym::host` or `true`/`false`.

This also renames a couple of `const_effect_param` -> `host_effect_param`, and restores `~const` pretty printing to `TraitPredPrintModifiersAndPath`.

cc #118785
r? `@fee1-dead` cc `@oli-obk`
This commit is contained in:
bors 2023-12-10 06:59:25 +00:00
commit 42dfac5e08
20 changed files with 66 additions and 58 deletions

View file

@ -500,7 +500,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
self.tcx,
eq_def_id,
sym::eq,
self.tcx.with_opt_const_effect_param(self.def_id, eq_def_id, [ty, ty]),
self.tcx.with_opt_host_effect_param(self.def_id, eq_def_id, [ty, ty]),
);
let bool_ty = self.tcx.types.bool;

View file

@ -272,7 +272,7 @@ impl<'tcx> ConstToPat<'tcx> {
ty::TraitRef::new(
tcx,
partial_eq_trait_id,
tcx.with_opt_const_effect_param(
tcx.with_opt_host_effect_param(
tcx.hir().enclosing_body_owner(self.id),
partial_eq_trait_id,
[ty, ty],