@@ -13,11 +13,11 @@ use rustc::infer::canonical::{Canonical, CanonicalVarValues};
1313use rustc:: infer:: unify_key:: { ConstVarValue , ConstVariableValue } ;
1414use rustc:: infer:: unify_key:: { ConstVariableOrigin , ConstVariableOriginKind , ToType } ;
1515use rustc:: middle:: free_region:: RegionRelations ;
16- use rustc:: middle:: lang_items;
1716use rustc:: middle:: region;
1817use rustc:: mir;
1918use rustc:: mir:: interpret:: ConstEvalResult ;
2019use rustc:: session:: config:: BorrowckMode ;
20+ use rustc:: traits:: select;
2121use rustc:: ty:: error:: { ExpectedFound , TypeError , UnconstrainedNumeric } ;
2222use rustc:: ty:: fold:: { TypeFoldable , TypeFolder } ;
2323use rustc:: ty:: relate:: RelateResult ;
@@ -58,7 +58,6 @@ pub mod lattice;
5858mod lexical_region_resolve;
5959mod lub;
6060pub mod nll_relate;
61- pub mod opaque_types;
6261pub mod outlives;
6362pub mod region_constraints;
6463pub mod resolve;
@@ -215,10 +214,10 @@ pub struct InferCtxt<'a, 'tcx> {
215214
216215 /// Caches the results of trait selection. This cache is used
217216 /// for things that have to do with the parameters in scope.
218- pub selection_cache : traits :: SelectionCache < ' tcx > ,
217+ pub selection_cache : select :: SelectionCache < ' tcx > ,
219218
220219 /// Caches the results of trait evaluation.
221- pub evaluation_cache : traits :: EvaluationCache < ' tcx > ,
220+ pub evaluation_cache : select :: EvaluationCache < ' tcx > ,
222221
223222 /// the set of predicates on which errors have been reported, to
224223 /// avoid reporting the same error twice.
@@ -1474,27 +1473,6 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
14741473 . verify_generic_bound ( origin, kind, a, bound) ;
14751474 }
14761475
1477- pub fn type_is_copy_modulo_regions (
1478- & self ,
1479- param_env : ty:: ParamEnv < ' tcx > ,
1480- ty : Ty < ' tcx > ,
1481- span : Span ,
1482- ) -> bool {
1483- let ty = self . resolve_vars_if_possible ( & ty) ;
1484-
1485- if !( param_env, ty) . has_local_value ( ) {
1486- return ty. is_copy_modulo_regions ( self . tcx , param_env, span) ;
1487- }
1488-
1489- let copy_def_id = self . tcx . require_lang_item ( lang_items:: CopyTraitLangItem , None ) ;
1490-
1491- // This can get called from typeck (by euv), and `moves_by_default`
1492- // rightly refuses to work with inference variables, but
1493- // moves_by_default has a cache, which we want to use in other
1494- // cases.
1495- traits:: type_known_to_meet_bound_modulo_regions ( self , param_env, ty, copy_def_id, span)
1496- }
1497-
14981476 /// Obtains the latest type of the given closure; this may be a
14991477 /// closure in the current function, in which case its
15001478 /// `ClosureKind` may not yet be known.
@@ -1518,30 +1496,6 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
15181496 closure_sig_ty. fn_sig ( self . tcx )
15191497 }
15201498
1521- /// Normalizes associated types in `value`, potentially returning
1522- /// new obligations that must further be processed.
1523- pub fn partially_normalize_associated_types_in < T > (
1524- & self ,
1525- span : Span ,
1526- body_id : hir:: HirId ,
1527- param_env : ty:: ParamEnv < ' tcx > ,
1528- value : & T ,
1529- ) -> InferOk < ' tcx , T >
1530- where
1531- T : TypeFoldable < ' tcx > ,
1532- {
1533- debug ! ( "partially_normalize_associated_types_in(value={:?})" , value) ;
1534- let mut selcx = traits:: SelectionContext :: new ( self ) ;
1535- let cause = ObligationCause :: misc ( span, body_id) ;
1536- let traits:: Normalized { value, obligations } =
1537- traits:: normalize ( & mut selcx, param_env, cause, value) ;
1538- debug ! (
1539- "partially_normalize_associated_types_in: result={:?} predicates={:?}" ,
1540- value, obligations
1541- ) ;
1542- InferOk { value, obligations }
1543- }
1544-
15451499 /// Clears the selection, evaluation, and projection caches. This is useful when
15461500 /// repeatedly attempting to select an `Obligation` while changing only
15471501 /// its `ParamEnv`, since `FulfillmentContext` doesn't use probing.
0 commit comments