1
Fork 0

Rip out old effects var handling code from traits

This commit is contained in:
Michael Goulet 2024-10-20 13:39:52 +00:00
parent bfab34af4c
commit 6f6f91ab82
14 changed files with 34 additions and 491 deletions

View file

@ -454,12 +454,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
};
let eq_def_id = self.tcx.require_lang_item(LangItem::PartialEq, Some(source_info.span));
let method = trait_method(
self.tcx,
eq_def_id,
sym::eq,
self.tcx.with_opt_host_effect_param(self.def_id, eq_def_id, [compare_ty, compare_ty]),
);
let method = trait_method(self.tcx, eq_def_id, sym::eq, [compare_ty, compare_ty]);
let bool_ty = self.tcx.types.bool;
let eq_result = self.temp(bool_ty, source_info.span);

View file

@ -43,7 +43,6 @@ impl<'a, 'tcx> PatCtxt<'a, 'tcx> {
}
struct ConstToPat<'tcx> {
id: hir::HirId,
span: Span,
param_env: ty::ParamEnv<'tcx>,
@ -62,7 +61,6 @@ impl<'tcx> ConstToPat<'tcx> {
) -> Self {
trace!(?pat_ctxt.typeck_results.hir_owner);
ConstToPat {
id,
span,
infcx,
param_env: pat_ctxt.param_env,
@ -149,15 +147,7 @@ impl<'tcx> ConstToPat<'tcx> {
tcx,
ObligationCause::dummy(),
self.param_env,
ty::TraitRef::new_from_args(
tcx,
partial_eq_trait_id,
tcx.with_opt_host_effect_param(
tcx.hir().enclosing_body_owner(self.id),
partial_eq_trait_id,
[ty, ty],
),
),
ty::TraitRef::new(tcx, partial_eq_trait_id, [ty, ty]),
);
// This *could* accept a type that isn't actually `PartialEq`, because region bounds get