mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 15:01:51 +00:00
Fix rebase
This commit is contained in:
parent
852073a7d2
commit
27534b3932
@ -916,8 +916,8 @@ fn assemble_candidates_from_object_ty<'cx, 'tcx>(
|
|||||||
|
|
||||||
let self_ty = obligation_trait_ref.self_ty();
|
let self_ty = obligation_trait_ref.self_ty();
|
||||||
let object_ty = selcx.infcx().shallow_resolve(self_ty);
|
let object_ty = selcx.infcx().shallow_resolve(self_ty);
|
||||||
let data = match object_ty.kind {
|
let data = match object_ty.kind() {
|
||||||
ty::Dynamic(ref data, ..) => data,
|
ty::Dynamic(data, ..) => data,
|
||||||
ty::Infer(ty::TyVar(_)) => {
|
ty::Infer(ty::TyVar(_)) => {
|
||||||
// If the self-type is an inference variable, then it MAY wind up
|
// If the self-type is an inference variable, then it MAY wind up
|
||||||
// being an object type, so induce an ambiguity.
|
// being an object type, so induce an ambiguity.
|
||||||
|
@ -126,7 +126,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||||||
let tcx = self.tcx();
|
let tcx = self.tcx();
|
||||||
|
|
||||||
let bound_self_ty = self.infcx.shallow_resolve(obligation.self_ty());
|
let bound_self_ty = self.infcx.shallow_resolve(obligation.self_ty());
|
||||||
let (def_id, substs) = match bound_self_ty.skip_binder().kind {
|
let (def_id, substs) = match *bound_self_ty.skip_binder().kind() {
|
||||||
ty::Projection(proj) => (proj.item_def_id, proj.substs),
|
ty::Projection(proj) => (proj.item_def_id, proj.substs),
|
||||||
ty::Opaque(def_id, substs) => (def_id, substs),
|
ty::Opaque(def_id, substs) => (def_id, substs),
|
||||||
_ => bug!("projection candidate for unexpected type: {:?}", bound_self_ty),
|
_ => bug!("projection candidate for unexpected type: {:?}", bound_self_ty),
|
||||||
@ -158,7 +158,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
if let ty::Projection(..) = bound_self_ty.skip_binder().kind {
|
if let ty::Projection(..) = bound_self_ty.skip_binder().kind() {
|
||||||
for predicate in tcx.predicates_of(def_id).instantiate_own(tcx, substs).predicates {
|
for predicate in tcx.predicates_of(def_id).instantiate_own(tcx, substs).predicates {
|
||||||
let normalized = normalize_with_depth_to(
|
let normalized = normalize_with_depth_to(
|
||||||
self,
|
self,
|
||||||
|
@ -77,10 +77,11 @@ impl<'tcx> chalk_solve::RustIrDatabase<RustInterner<'tcx>> for RustIrDatabase<'t
|
|||||||
let where_clauses = self.where_clauses_for(def_id, bound_vars);
|
let where_clauses = self.where_clauses_for(def_id, bound_vars);
|
||||||
|
|
||||||
let bounds = self
|
let bounds = self
|
||||||
|
.interner
|
||||||
.tcx
|
.tcx
|
||||||
.explicit_item_bounds(def_id)
|
.explicit_item_bounds(def_id)
|
||||||
.iter()
|
.iter()
|
||||||
.map(|(bound, _)| bound.subst(self.tcx, &bound_vars))
|
.map(|(bound, _)| bound.subst(self.interner.tcx, &bound_vars))
|
||||||
.filter_map(|bound| {
|
.filter_map(|bound| {
|
||||||
LowerInto::<
|
LowerInto::<
|
||||||
Option<chalk_solve::rust_ir::QuantifiedInlineBound<RustInterner<'tcx>>>,
|
Option<chalk_solve::rust_ir::QuantifiedInlineBound<RustInterner<'tcx>>>,
|
||||||
@ -453,14 +454,19 @@ impl<'tcx> chalk_solve::RustIrDatabase<RustInterner<'tcx>> for RustIrDatabase<'t
|
|||||||
let binders = binders_for(&self.interner, bound_vars);
|
let binders = binders_for(&self.interner, bound_vars);
|
||||||
let where_clauses = self.where_clauses_for(opaque_ty_id.0, bound_vars);
|
let where_clauses = self.where_clauses_for(opaque_ty_id.0, bound_vars);
|
||||||
|
|
||||||
let bounds: Vec<_> = predicates
|
let bounds: Vec<_> = self
|
||||||
|
.interner
|
||||||
|
.tcx
|
||||||
|
.explicit_item_bounds(opaque_ty_id.0)
|
||||||
.iter()
|
.iter()
|
||||||
.map(|(bound, _)| bound.subst(self.tcx, &bound_vars))
|
.map(|(bound, _)| bound.subst(self.interner.tcx, &bound_vars))
|
||||||
.filter_map(|bound| LowerInto::<Option<chalk_ir::QuantifiedWhereClause<RustInterner<'tcx>>>>::lower_into(bound, &self.interner))
|
.filter_map(|bound| {
|
||||||
|
LowerInto::<Option<chalk_ir::QuantifiedWhereClause<RustInterner<'tcx>>>>::lower_into(bound, &self.interner)
|
||||||
|
})
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
let value = chalk_solve::rust_ir::OpaqueTyDatumBound {
|
let value = chalk_solve::rust_ir::OpaqueTyDatumBound {
|
||||||
bounds: chalk_ir::Binders::new(binders, bounds),
|
bounds: chalk_ir::Binders::new(binders.clone(), bounds),
|
||||||
where_clauses: chalk_ir::Binders::new(binders, where_clauses),
|
where_clauses: chalk_ir::Binders::new(binders, where_clauses),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2141,7 +2141,7 @@ fn explicit_predicates_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::GenericPredicat
|
|||||||
// substs are the same as the trait's.
|
// substs are the same as the trait's.
|
||||||
// * It must be an associated type for this trait (*not* a
|
// * It must be an associated type for this trait (*not* a
|
||||||
// supertrait).
|
// supertrait).
|
||||||
if let ty::Projection(projection) = ty.kind {
|
if let ty::Projection(projection) = ty.kind() {
|
||||||
if projection.substs == trait_identity_substs
|
if projection.substs == trait_identity_substs
|
||||||
&& tcx.associated_item(projection.item_def_id).container.id() == def_id
|
&& tcx.associated_item(projection.item_def_id).container.id() == def_id
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user