Skip to content

Commit fbbdb0f

Browse files
No need for infer projection hack in add_item_bounds_for_hidden_type
1 parent b321edd commit fbbdb0f

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

compiler/rustc_infer/src/infer/opaque_types.rs

+2-17
Original file line numberDiff line numberDiff line change
@@ -595,23 +595,8 @@ impl<'tcx> InferCtxt<'tcx> {
595595
let predicate = predicate.fold_with(&mut BottomUpFolder {
596596
tcx,
597597
ty_op: |ty| match *ty.kind() {
598-
// We can't normalize associated types from `rustc_infer`,
599-
// but we can eagerly register inference variables for them.
600-
// FIXME(RPITIT): Don't replace RPITITs with inference vars.
601-
// FIXME(inherent_associated_types): Extend this to support `ty::Inherent`, too.
602-
ty::Alias(ty::Projection, projection_ty)
603-
if !projection_ty.has_escaping_bound_vars()
604-
&& !tcx.is_impl_trait_in_trait(projection_ty.def_id)
605-
&& !self.next_trait_solver() =>
606-
{
607-
self.infer_projection(
608-
param_env,
609-
projection_ty,
610-
cause.clone(),
611-
0,
612-
obligations,
613-
)
614-
}
598+
// FIXME(inherent_associated_types): Do we need support here for `ty::Inherent`?
599+
615600
// Replace all other mentions of the same opaque type with the hidden type,
616601
// as the bounds must hold on the hidden type after all.
617602
ty::Alias(ty::Opaque, ty::AliasTy { def_id: def_id2, args: args2, .. })

0 commit comments

Comments
 (0)