Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move MatchAgainstFreshVars to old solver #126353

Merged
merged 1 commit into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions compiler/rustc_infer/src/infer/relate/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@

pub use rustc_middle::ty::relate::*;

pub use self::_match::MatchAgainstFreshVars;
pub use self::combine::CombineFields;
pub use self::combine::PredicateEmittingRelation;

pub mod _match;
pub(super) mod combine;
mod generalize;
mod glb;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use rustc_infer::infer::relate::{
self, structurally_relate_tys, Relate, RelateResult, TypeRelation,
};
use rustc_middle::ty::error::{ExpectedFound, TypeError};
use rustc_middle::ty::{self, InferConst, Ty, TyCtxt};
use tracing::{debug, instrument};

use super::{structurally_relate_tys, Relate, RelateResult, TypeRelation};
use crate::infer::relate;

/// A type "A" *matches* "B" if the fresh types in B could be
/// instantiated with values so as to make it equal to A. Matching is
/// intended to be used only on freshened types, and it basically
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_trait_selection/src/traits/select/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ use rustc_data_structures::stack::ensure_sufficient_stack;
use rustc_errors::{Diag, EmissionGuarantee};
use rustc_hir as hir;
use rustc_hir::def_id::DefId;
use rustc_infer::infer::relate::MatchAgainstFreshVars;
use rustc_infer::infer::relate::TypeRelation;
use rustc_infer::infer::BoundRegionConversionTime;
use rustc_infer::infer::BoundRegionConversionTime::HigherRankedType;
Expand Down Expand Up @@ -60,6 +59,7 @@ use std::ops::ControlFlow;
pub use rustc_middle::traits::select::*;
use rustc_middle::ty::print::with_no_trimmed_paths;

mod _match;
mod candidate_assembly;
mod confirmation;

Expand Down Expand Up @@ -2719,7 +2719,7 @@ impl<'tcx> SelectionContext<'_, 'tcx> {
previous: ty::PolyTraitPredicate<'tcx>,
current: ty::PolyTraitPredicate<'tcx>,
) -> bool {
let mut matcher = MatchAgainstFreshVars::new(self.tcx());
let mut matcher = _match::MatchAgainstFreshVars::new(self.tcx());
matcher.relate(previous, current).is_ok()
}

Expand Down
Loading