Revert "Don't print host effect param in pretty path_generic_args"

This reverts commit f1bf874fb1.
This commit is contained in:
Deadbeef
2023-12-10 10:17:28 +00:00
parent 2f457d9d60
commit d1f4bc5a19
11 changed files with 41 additions and 45 deletions

View File

@@ -320,11 +320,9 @@ impl<'tcx> Generics {
&'tcx self,
tcx: TyCtxt<'tcx>,
args: &'tcx [ty::GenericArg<'tcx>],
) -> (&'tcx [ty::GenericArg<'tcx>], &'tcx [ty::GenericParamDef]) {
let mut own_args = self.parent_count..self.count();
let mut own_params = 0..self.params.len();
) -> &'tcx [ty::GenericArg<'tcx>] {
let mut own_params = self.parent_count..self.count();
if self.has_self && self.parent.is_none() {
own_args.start = 1;
own_params.start = 1;
}
@@ -334,7 +332,7 @@ impl<'tcx> Generics {
// of semantic equivalence. While not ideal, that's
// good enough for now as this should only be used
// for diagnostics anyways.
let num_default_params = self
own_params.end -= self
.params
.iter()
.rev()
@@ -346,10 +344,8 @@ impl<'tcx> Generics {
|| matches!(param.kind, GenericParamDefKind::Const { is_host_effect: true, .. })
})
.count();
own_params.end -= num_default_params;
own_args.end -= num_default_params;
(&args[own_args], &self.params[own_params])
&args[own_params]
}
/// Returns the args corresponding to the generic parameters of this item, excluding `Self`.