@@ -13,11 +13,11 @@ use rustc::infer::canonical::{Canonical, CanonicalVarValues};
13
13
use rustc:: infer:: unify_key:: { ConstVarValue , ConstVariableValue } ;
14
14
use rustc:: infer:: unify_key:: { ConstVariableOrigin , ConstVariableOriginKind , ToType } ;
15
15
use rustc:: middle:: free_region:: RegionRelations ;
16
- use rustc:: middle:: lang_items;
17
16
use rustc:: middle:: region;
18
17
use rustc:: mir;
19
18
use rustc:: mir:: interpret:: ConstEvalResult ;
20
19
use rustc:: session:: config:: BorrowckMode ;
20
+ use rustc:: traits:: select;
21
21
use rustc:: ty:: error:: { ExpectedFound , TypeError , UnconstrainedNumeric } ;
22
22
use rustc:: ty:: fold:: { TypeFoldable , TypeFolder } ;
23
23
use rustc:: ty:: relate:: RelateResult ;
@@ -58,7 +58,6 @@ pub mod lattice;
58
58
mod lexical_region_resolve;
59
59
mod lub;
60
60
pub mod nll_relate;
61
- pub mod opaque_types;
62
61
pub mod outlives;
63
62
pub mod region_constraints;
64
63
pub mod resolve;
@@ -215,10 +214,10 @@ pub struct InferCtxt<'a, 'tcx> {
215
214
216
215
/// Caches the results of trait selection. This cache is used
217
216
/// 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 > ,
219
218
220
219
/// Caches the results of trait evaluation.
221
- pub evaluation_cache : traits :: EvaluationCache < ' tcx > ,
220
+ pub evaluation_cache : select :: EvaluationCache < ' tcx > ,
222
221
223
222
/// the set of predicates on which errors have been reported, to
224
223
/// avoid reporting the same error twice.
@@ -1474,27 +1473,6 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
1474
1473
. verify_generic_bound ( origin, kind, a, bound) ;
1475
1474
}
1476
1475
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
-
1498
1476
/// Obtains the latest type of the given closure; this may be a
1499
1477
/// closure in the current function, in which case its
1500
1478
/// `ClosureKind` may not yet be known.
@@ -1518,30 +1496,6 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
1518
1496
closure_sig_ty. fn_sig ( self . tcx )
1519
1497
}
1520
1498
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
-
1545
1499
/// Clears the selection, evaluation, and projection caches. This is useful when
1546
1500
/// repeatedly attempting to select an `Obligation` while changing only
1547
1501
/// its `ParamEnv`, since `FulfillmentContext` doesn't use probing.
0 commit comments