Skip to content

Commit 4b809b9

Browse files
Move MatchAgainstFreshVars to old solver
1 parent 1d43fbb commit 4b809b9

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

compiler/rustc_infer/src/infer/relate/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@
44
55
pub use rustc_middle::ty::relate::*;
66

7-
pub use self::_match::MatchAgainstFreshVars;
87
pub use self::combine::CombineFields;
98
pub use self::combine::PredicateEmittingRelation;
109

11-
pub mod _match;
1210
pub(super) mod combine;
1311
mod generalize;
1412
mod glb;

compiler/rustc_infer/src/infer/relate/_match.rs compiler/rustc_trait_selection/src/traits/select/_match.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
use rustc_infer::infer::relate::{
2+
self, structurally_relate_tys, Relate, RelateResult, TypeRelation,
3+
};
14
use rustc_middle::ty::error::{ExpectedFound, TypeError};
25
use rustc_middle::ty::{self, InferConst, Ty, TyCtxt};
36
use tracing::{debug, instrument};
47

5-
use super::{structurally_relate_tys, Relate, RelateResult, TypeRelation};
6-
use crate::infer::relate;
7-
88
/// A type "A" *matches* "B" if the fresh types in B could be
99
/// instantiated with values so as to make it equal to A. Matching is
1010
/// intended to be used only on freshened types, and it basically

compiler/rustc_trait_selection/src/traits/select/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ use rustc_data_structures::stack::ensure_sufficient_stack;
3232
use rustc_errors::{Diag, EmissionGuarantee};
3333
use rustc_hir as hir;
3434
use rustc_hir::def_id::DefId;
35-
use rustc_infer::infer::relate::MatchAgainstFreshVars;
3635
use rustc_infer::infer::relate::TypeRelation;
3736
use rustc_infer::infer::BoundRegionConversionTime;
3837
use rustc_infer::infer::BoundRegionConversionTime::HigherRankedType;
@@ -60,6 +59,7 @@ use std::ops::ControlFlow;
6059
pub use rustc_middle::traits::select::*;
6160
use rustc_middle::ty::print::with_no_trimmed_paths;
6261

62+
mod _match;
6363
mod candidate_assembly;
6464
mod confirmation;
6565

@@ -2719,7 +2719,7 @@ impl<'tcx> SelectionContext<'_, 'tcx> {
27192719
previous: ty::PolyTraitPredicate<'tcx>,
27202720
current: ty::PolyTraitPredicate<'tcx>,
27212721
) -> bool {
2722-
let mut matcher = MatchAgainstFreshVars::new(self.tcx());
2722+
let mut matcher = _match::MatchAgainstFreshVars::new(self.tcx());
27232723
matcher.relate(previous, current).is_ok()
27242724
}
27252725

0 commit comments

Comments
 (0)