@@ -7,19 +7,21 @@ pub use self::SubregionOrigin::*;
7
7
pub use self :: ValuePairs :: * ;
8
8
pub use crate :: ty:: IntVarValue ;
9
9
10
- use crate :: infer:: canonical:: { Canonical , CanonicalVarValues } ;
11
- use crate :: infer:: unify_key:: { ConstVarValue , ConstVariableValue } ;
12
- use crate :: middle:: free_region:: RegionRelations ;
13
- use crate :: middle:: lang_items;
14
- use crate :: middle:: region;
15
- use crate :: session:: config:: BorrowckMode ;
16
10
use crate :: traits:: { self , ObligationCause , PredicateObligations , TraitEngine } ;
17
- use crate :: ty:: error:: { ExpectedFound , TypeError , UnconstrainedNumeric } ;
18
- use crate :: ty:: fold:: { TypeFoldable , TypeFolder } ;
19
- use crate :: ty:: relate:: RelateResult ;
20
- use crate :: ty:: subst:: { GenericArg , InternalSubsts , SubstsRef } ;
21
- use crate :: ty:: { self , GenericParamDefKind , InferConst , Ty , TyCtxt } ;
22
- use crate :: ty:: { ConstVid , FloatVid , IntVid , TyVid } ;
11
+
12
+ use rustc:: infer:: canonical:: { Canonical , CanonicalVarValues } ;
13
+ use rustc:: infer:: unify_key:: { ConstVarValue , ConstVariableValue } ;
14
+ use rustc:: infer:: unify_key:: { ConstVariableOrigin , ConstVariableOriginKind , ToType } ;
15
+ use rustc:: middle:: free_region:: RegionRelations ;
16
+ use rustc:: middle:: lang_items;
17
+ use rustc:: middle:: region;
18
+ use rustc:: session:: config:: BorrowckMode ;
19
+ use rustc:: ty:: error:: { ExpectedFound , TypeError , UnconstrainedNumeric } ;
20
+ use rustc:: ty:: fold:: { TypeFoldable , TypeFolder } ;
21
+ use rustc:: ty:: relate:: RelateResult ;
22
+ use rustc:: ty:: subst:: { GenericArg , InternalSubsts , SubstsRef } ;
23
+ use rustc:: ty:: { self , GenericParamDefKind , InferConst , Ty , TyCtxt } ;
24
+ use rustc:: ty:: { ConstVid , FloatVid , IntVid , TyVid } ;
23
25
24
26
use rustc_data_structures:: fx:: { FxHashMap , FxHashSet } ;
25
27
use rustc_data_structures:: sync:: Lrc ;
@@ -40,7 +42,6 @@ use self::outlives::env::OutlivesEnvironment;
40
42
use self :: region_constraints:: { GenericKind , RegionConstraintData , VarInfos , VerifyBound } ;
41
43
use self :: region_constraints:: { RegionConstraintCollector , RegionSnapshot } ;
42
44
use self :: type_variable:: { TypeVariableOrigin , TypeVariableOriginKind } ;
43
- use self :: unify_key:: { ConstVariableOrigin , ConstVariableOriginKind , ToType } ;
44
45
45
46
pub mod at;
46
47
pub mod canonical;
@@ -61,8 +62,8 @@ pub mod region_constraints;
61
62
pub mod resolve;
62
63
mod sub;
63
64
pub mod type_variable;
64
- mod types ;
65
- pub mod unify_key;
65
+
66
+ pub use rustc :: infer :: unify_key;
66
67
67
68
#[ must_use]
68
69
#[ derive( Debug ) ]
@@ -524,8 +525,12 @@ pub struct InferCtxtBuilder<'tcx> {
524
525
fresh_tables : Option < RefCell < ty:: TypeckTables < ' tcx > > > ,
525
526
}
526
527
527
- impl TyCtxt < ' tcx > {
528
- pub fn infer_ctxt ( self ) -> InferCtxtBuilder < ' tcx > {
528
+ pub trait TyCtxtInferExt < ' tcx > {
529
+ fn infer_ctxt ( self ) -> InferCtxtBuilder < ' tcx > ;
530
+ }
531
+
532
+ impl TyCtxtInferExt < ' tcx > for TyCtxt < ' tcx > {
533
+ fn infer_ctxt ( self ) -> InferCtxtBuilder < ' tcx > {
529
534
InferCtxtBuilder { global_tcx : self , fresh_tables : None }
530
535
}
531
536
}
0 commit comments