Merge attrs, better validation

This commit is contained in:
Michael Goulet 2023-06-16 23:45:01 +00:00
parent 91e5c3f2e5
commit ca68cf0d46
16 changed files with 140 additions and 73 deletions

View file

@ -1586,6 +1586,10 @@ fn assemble_candidates_from_object_ty<'cx, 'tcx>(
let tcx = selcx.tcx();
if !tcx.trait_def(obligation.predicate.trait_def_id(tcx)).implement_via_object {
return;
}
let self_ty = obligation.predicate.self_ty();
let object_ty = selcx.infcx.shallow_resolve(self_ty);
let data = match object_ty.kind() {

View file

@ -554,6 +554,10 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
"assemble_candidates_from_object_ty",
);
if !self.tcx().trait_def(obligation.predicate.def_id()).implement_via_object {
return;
}
self.infcx.probe(|_snapshot| {
if obligation.has_non_region_late_bound() {
return;