Skip to content

Commit ad8539b

Browse files
committed
Fixed errors caused due to API changes
1 parent 58eb77e commit ad8539b

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

compiler/rustc_const_eval/src/interpret/intrinsics.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use rustc_infer::infer::TyCtxtInferExt;
1313
use rustc_middle::mir::interpret::{CTFE_ALLOC_SALT, read_target_uint, write_target_uint};
1414
use rustc_middle::mir::{self, BinOp, ConstValue, NonDivergingIntrinsic};
1515
use rustc_middle::ty::layout::TyAndLayout;
16-
use rustc_middle::ty::{FloatTy, Ty, TyCtxt, TypeFoldable, Upcast};
16+
use rustc_middle::ty::{FloatTy, Ty, TyCtxt, TypeFoldable, PolyExistentialPredicate};
1717
use rustc_middle::{bug, span_bug, ty};
1818
use rustc_span::{Symbol, sym};
1919
use rustc_trait_selection::traits::{Obligation, ObligationCause, ObligationCtxt};
@@ -22,7 +22,7 @@ use tracing::trace;
2222
use super::memory::MemoryKind;
2323
use super::util::ensure_monomorphic_enough;
2424
use super::{
25-
AllocId, Allocation, CheckInAllocMsg, ConstAllocation, ImmTy, InterpCx, InterpResult, Machine,
25+
AllocId, CheckInAllocMsg, ImmTy, InterpCx, InterpResult, Machine,
2626
OpTy, PlaceTy, Pointer, PointerArithmetic, Provenance, Scalar, err_ub_custom, err_unsup_format,
2727
interp_ok, throw_inval, throw_ub_custom, throw_ub_format,
2828
};
@@ -228,7 +228,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
228228

229229
ensure_monomorphic_enough(tcx, tp_ty)?;
230230
ensure_monomorphic_enough(tcx, result_ty)?;
231-
let ty::Dynamic(preds, _, ty::Dyn) = result_ty.kind() else {
231+
let ty::Dynamic(preds, _) = result_ty.kind() else {
232232
span_bug!(
233233
self.find_closest_untracked_caller_location(),
234234
"Invalid type provided to vtable_for::<T, U>. U must be dyn Trait, got {result_ty}."
@@ -239,7 +239,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
239239
self.tcx.infer_ctxt().build_with_typing_env(self.typing_env);
240240

241241
let ocx = ObligationCtxt::new(&infcx);
242-
ocx.register_obligations(preds.iter().map(|pred| {
242+
ocx.register_obligations(preds.iter().map(|pred: PolyExistentialPredicate<'_>| {
243243
let pred = pred.with_self_ty(tcx, tp_ty);
244244
// Lifetimes can only be 'static because of the bound on T
245245
let pred = pred.fold_with(&mut ty::BottomUpFolder {
@@ -252,7 +252,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
252252
});
253253
Obligation::new(tcx, ObligationCause::dummy(), param_env, pred)
254254
}));
255-
let type_impls_trait = ocx.select_all_or_error().is_empty();
255+
let type_impls_trait = ocx.evaluate_obligations_error_on_ambiguity().is_empty();
256256
// Since `assumed_wf_tys=[]` the choice of LocalDefId is irrelevant, so using the "default"
257257
let regions_are_valid = ocx.resolve_regions(CRATE_DEF_ID, param_env, []).is_empty();
258258

compiler/rustc_type_ir/src/predicate.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,9 +293,9 @@ impl<I: Interner> Eq for ExistentialPredicate<I> {}
293293
impl<I: Interner> ty::Binder<I, ExistentialPredicate<I>> {
294294
pub fn def_id(&self) -> I::DefId {
295295
match self.skip_binder() {
296-
ExistentialPredicate::Trait(tr) => tr.def_id,
297-
ExistentialPredicate::Projection(p) => p.def_id,
298-
ExistentialPredicate::AutoTrait(did) => did,
296+
ExistentialPredicate::Trait(tr) => tr.def_id.into(),
297+
ExistentialPredicate::Projection(p) => p.def_id.into(),
298+
ExistentialPredicate::AutoTrait(did) => did.into(),
299299
}
300300
}
301301
/// Given an existential predicate like `?Self: PartialEq<u32>` (e.g., derived from `dyn PartialEq<u32>`),

0 commit comments

Comments
 (0)