Skip to content

Commit b0048e1

Browse files
Only elaborate principal in object_region_bounds
1 parent ce5c754 commit b0048e1

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

compiler/rustc_hir_analysis/src/hir_ty_lowering/dyn_compatibility.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
204204
for def_ids in associated_types.values_mut() {
205205
for (projection_bound, span) in &projection_bounds {
206206
let def_id = projection_bound.projection_def_id();
207-
// FIXME(#120456) - is `swap_remove` correct?
208207
def_ids.swap_remove(&def_id);
209208
if tcx.generics_require_sized_self(def_id) {
210209
tcx.emit_node_span_lint(

compiler/rustc_trait_selection/src/traits/wf.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -970,10 +970,10 @@ pub fn object_region_bounds<'tcx>(
970970
existential_predicates: &'tcx ty::List<ty::PolyExistentialPredicate<'tcx>>,
971971
) -> Vec<ty::Region<'tcx>> {
972972
let predicates = existential_predicates.iter().filter_map(|predicate| {
973-
if let ty::ExistentialPredicate::Projection(_) = predicate.skip_binder() {
974-
None
975-
} else {
973+
if let ty::ExistentialPredicate::Trait(_) = predicate.skip_binder() {
976974
Some(predicate.with_self_ty(tcx, tcx.types.trait_object_dummy_self))
975+
} else {
976+
None
977977
}
978978
});
979979

0 commit comments

Comments
 (0)