1
Fork 0

Fix an ICE that I just made worse

This commit is contained in:
Oli Scherer 2022-11-17 15:30:42 +00:00
parent a9f3c2209c
commit 4d9451b1d1
3 changed files with 29 additions and 9 deletions

View file

@ -1,7 +1,6 @@
use rustc_errors::DelayDm;
use rustc_hir as hir;
use rustc_index::vec::Idx;
use rustc_infer::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
use rustc_infer::infer::{InferCtxt, TyCtxtInferExt};
use rustc_middle::mir::{self, Field};
use rustc_middle::thir::{FieldPat, Pat, PatKind};
@ -227,13 +226,6 @@ impl<'tcx> ConstToPat<'tcx> {
// using `PartialEq::eq` in this scenario in the past.)
let partial_eq_trait_id =
self.tcx().require_lang_item(hir::LangItem::PartialEq, Some(self.span));
let any_ty = self
.infcx
.next_ty_var(TypeVariableOrigin {
kind: TypeVariableOriginKind::MiscVariable,
span: self.span,
})
.into();
let obligation: PredicateObligation<'_> = predicate_for_trait_def(
self.tcx(),
self.param_env,
@ -241,7 +233,7 @@ impl<'tcx> ConstToPat<'tcx> {
partial_eq_trait_id,
0,
ty,
[any_ty],
[ty.into()],
);
// FIXME: should this call a `predicate_must_hold` variant instead?