@@ -7,19 +7,21 @@ pub use self::SubregionOrigin::*;
77pub use self :: ValuePairs :: * ;
88pub use crate :: ty:: IntVarValue ;
99
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 ;
1610use 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 } ;
2325
2426use rustc_data_structures:: fx:: { FxHashMap , FxHashSet } ;
2527use rustc_data_structures:: sync:: Lrc ;
@@ -40,7 +42,6 @@ use self::outlives::env::OutlivesEnvironment;
4042use self :: region_constraints:: { GenericKind , RegionConstraintData , VarInfos , VerifyBound } ;
4143use self :: region_constraints:: { RegionConstraintCollector , RegionSnapshot } ;
4244use self :: type_variable:: { TypeVariableOrigin , TypeVariableOriginKind } ;
43- use self :: unify_key:: { ConstVariableOrigin , ConstVariableOriginKind , ToType } ;
4445
4546pub mod at;
4647pub mod canonical;
@@ -61,8 +62,8 @@ pub mod region_constraints;
6162pub mod resolve;
6263mod sub;
6364pub mod type_variable;
64- mod types ;
65- pub mod unify_key;
65+
66+ pub use rustc :: infer :: unify_key;
6667
6768#[ must_use]
6869#[ derive( Debug ) ]
@@ -524,8 +525,12 @@ pub struct InferCtxtBuilder<'tcx> {
524525 fresh_tables : Option < RefCell < ty:: TypeckTables < ' tcx > > > ,
525526}
526527
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 > {
529534 InferCtxtBuilder { global_tcx : self , fresh_tables : None }
530535 }
531536}
0 commit comments