Rollup merge of #92191 - jackh726:issue-89352, r=nikomatsakis
Prefer projection candidates instead of param_env candidates for Sized predicates Fixes #89352 Also includes some drive by logging and verbose printing changes that I found useful when debugging this, but I can remove this if needed. This is a little hacky - but imo no more than the rest of `candidate_should_be_dropped_in_favor_of`. Importantly, in a Chalk-like world, both candidates should be completely compatible. r? ```@nikomatsakis```
This commit is contained in:
commit
64716825b0
13 changed files with 84 additions and 34 deletions
|
@ -188,6 +188,11 @@ pub trait Printer<'tcx>: Sized {
|
|||
own_params.start = 1;
|
||||
}
|
||||
|
||||
// If we're in verbose mode, then print default-equal args too
|
||||
if self.tcx().sess.verbose() {
|
||||
return &substs[own_params];
|
||||
}
|
||||
|
||||
// Don't print args that are the defaults of their respective parameters.
|
||||
own_params.end -= generics
|
||||
.params
|
||||
|
|
|
@ -1784,10 +1784,11 @@ impl<'tcx, F: fmt::Write> Printer<'tcx> for FmtPrinter<'_, 'tcx, F> {
|
|||
self = print_prefix(self)?;
|
||||
|
||||
// Don't print `'_` if there's no unerased regions.
|
||||
let print_regions = args.iter().any(|arg| match arg.unpack() {
|
||||
GenericArgKind::Lifetime(r) => *r != ty::ReErased,
|
||||
_ => false,
|
||||
});
|
||||
let print_regions = self.tcx.sess.verbose()
|
||||
|| args.iter().any(|arg| match arg.unpack() {
|
||||
GenericArgKind::Lifetime(r) => *r != ty::ReErased,
|
||||
_ => false,
|
||||
});
|
||||
let args = args.iter().cloned().filter(|arg| match arg.unpack() {
|
||||
GenericArgKind::Lifetime(_) => print_regions,
|
||||
_ => true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue