Skip to content

Commit fa46ce0

Browse files
committed
trait_sel: don't require predicates of aliases hold
No longer require that we prove that the predicates of aliases hold when checking the well-formedness of the alias. This permits more uses of GATs and changes the output of yet more tests.
1 parent fe4aaff commit fa46ce0

19 files changed

+81
-792
lines changed

compiler/rustc_trait_selection/src/traits/select/confirmation.rs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
144144
obligation: &PolyTraitObligation<'tcx>,
145145
idx: usize,
146146
) -> Result<PredicateObligations<'tcx>, SelectionError<'tcx>> {
147-
let tcx = self.tcx();
148-
149147
let placeholder_trait_predicate =
150148
self.infcx.enter_forall_and_leak_universe(obligation.predicate).trait_ref;
151149
let placeholder_self_ty = self.infcx.shallow_resolve(placeholder_trait_predicate.self_ty());
@@ -194,28 +192,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
194192
.map_err(|_| SelectionError::Unimplemented)?,
195193
);
196194

197-
// FIXME(compiler-errors): I don't think this is needed.
198-
if let ty::Alias(ty::Projection, alias_ty) = placeholder_self_ty.kind() {
199-
let predicates = tcx.predicates_of(alias_ty.def_id).instantiate_own(tcx, alias_ty.args);
200-
for (predicate, _) in predicates {
201-
let normalized = normalize_with_depth_to(
202-
self,
203-
obligation.param_env,
204-
obligation.cause.clone(),
205-
obligation.recursion_depth + 1,
206-
predicate,
207-
&mut obligations,
208-
);
209-
obligations.push(Obligation::with_depth(
210-
self.tcx(),
211-
obligation.cause.clone(),
212-
obligation.recursion_depth + 1,
213-
obligation.param_env,
214-
normalized,
215-
));
216-
}
217-
}
218-
219195
Ok(obligations)
220196
}
221197

tests/ui/async-await/higher-ranked-auto-trait-14.no_assumptions.stderr

Lines changed: 0 additions & 33 deletions
This file was deleted.

tests/ui/async-await/higher-ranked-auto-trait-14.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//@ revisions: assumptions no_assumptions
44
//@[assumptions] compile-flags: -Zhigher-ranked-assumptions
55
//@[assumptions] check-pass
6-
//@[no_assumptions] known-bug: #110338
6+
//@[no_assumptions] check-pass
77

88
use std::collections::HashSet;
99
use std::future::Future;

tests/ui/async-await/higher-ranked-auto-trait-2.no_assumptions.stderr

Lines changed: 0 additions & 49 deletions
This file was deleted.

tests/ui/async-await/higher-ranked-auto-trait-2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//@ revisions: assumptions no_assumptions
44
//@[assumptions] compile-flags: -Zhigher-ranked-assumptions
55
//@[assumptions] check-pass
6-
//@[no_assumptions] known-bug: #110338
6+
//@[no_assumptions] check-pass
77

88
use std::future::Future;
99

0 commit comments

Comments
 (0)