Skip to content

Commit 27534b3

Browse files
committed
Fix rebase
1 parent 852073a commit 27534b3

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed

compiler/rustc_trait_selection/src/traits/project.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -916,8 +916,8 @@ fn assemble_candidates_from_object_ty<'cx, 'tcx>(
916916

917917
let self_ty = obligation_trait_ref.self_ty();
918918
let object_ty = selcx.infcx().shallow_resolve(self_ty);
919-
let data = match object_ty.kind {
920-
ty::Dynamic(ref data, ..) => data,
919+
let data = match object_ty.kind() {
920+
ty::Dynamic(data, ..) => data,
921921
ty::Infer(ty::TyVar(_)) => {
922922
// If the self-type is an inference variable, then it MAY wind up
923923
// being an object type, so induce an ambiguity.

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
126126
let tcx = self.tcx();
127127

128128
let bound_self_ty = self.infcx.shallow_resolve(obligation.self_ty());
129-
let (def_id, substs) = match bound_self_ty.skip_binder().kind {
129+
let (def_id, substs) = match *bound_self_ty.skip_binder().kind() {
130130
ty::Projection(proj) => (proj.item_def_id, proj.substs),
131131
ty::Opaque(def_id, substs) => (def_id, substs),
132132
_ => bug!("projection candidate for unexpected type: {:?}", bound_self_ty),
@@ -158,7 +158,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
158158
}),
159159
);
160160

161-
if let ty::Projection(..) = bound_self_ty.skip_binder().kind {
161+
if let ty::Projection(..) = bound_self_ty.skip_binder().kind() {
162162
for predicate in tcx.predicates_of(def_id).instantiate_own(tcx, substs).predicates {
163163
let normalized = normalize_with_depth_to(
164164
self,

compiler/rustc_traits/src/chalk/db.rs

+11-5
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,11 @@ impl<'tcx> chalk_solve::RustIrDatabase<RustInterner<'tcx>> for RustIrDatabase<'t
7777
let where_clauses = self.where_clauses_for(def_id, bound_vars);
7878

7979
let bounds = self
80+
.interner
8081
.tcx
8182
.explicit_item_bounds(def_id)
8283
.iter()
83-
.map(|(bound, _)| bound.subst(self.tcx, &bound_vars))
84+
.map(|(bound, _)| bound.subst(self.interner.tcx, &bound_vars))
8485
.filter_map(|bound| {
8586
LowerInto::<
8687
Option<chalk_solve::rust_ir::QuantifiedInlineBound<RustInterner<'tcx>>>,
@@ -453,14 +454,19 @@ impl<'tcx> chalk_solve::RustIrDatabase<RustInterner<'tcx>> for RustIrDatabase<'t
453454
let binders = binders_for(&self.interner, bound_vars);
454455
let where_clauses = self.where_clauses_for(opaque_ty_id.0, bound_vars);
455456

456-
let bounds: Vec<_> = predicates
457+
let bounds: Vec<_> = self
458+
.interner
459+
.tcx
460+
.explicit_item_bounds(opaque_ty_id.0)
457461
.iter()
458-
.map(|(bound, _)| bound.subst(self.tcx, &bound_vars))
459-
.filter_map(|bound| LowerInto::<Option<chalk_ir::QuantifiedWhereClause<RustInterner<'tcx>>>>::lower_into(bound, &self.interner))
462+
.map(|(bound, _)| bound.subst(self.interner.tcx, &bound_vars))
463+
.filter_map(|bound| {
464+
LowerInto::<Option<chalk_ir::QuantifiedWhereClause<RustInterner<'tcx>>>>::lower_into(bound, &self.interner)
465+
})
460466
.collect();
461467

462468
let value = chalk_solve::rust_ir::OpaqueTyDatumBound {
463-
bounds: chalk_ir::Binders::new(binders, bounds),
469+
bounds: chalk_ir::Binders::new(binders.clone(), bounds),
464470
where_clauses: chalk_ir::Binders::new(binders, where_clauses),
465471
};
466472

compiler/rustc_typeck/src/collect.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2141,7 +2141,7 @@ fn explicit_predicates_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::GenericPredicat
21412141
// substs are the same as the trait's.
21422142
// * It must be an associated type for this trait (*not* a
21432143
// supertrait).
2144-
if let ty::Projection(projection) = ty.kind {
2144+
if let ty::Projection(projection) = ty.kind() {
21452145
if projection.substs == trait_identity_substs
21462146
&& tcx.associated_item(projection.item_def_id).container.id() == def_id
21472147
{

0 commit comments

Comments
 (0)