@@ -76,23 +76,23 @@ pub type Bound<T> = Option<T>;
76
76
pub type UnitResult < ' tcx > = RelateResult < ' tcx , ( ) > ; // "unify result"
77
77
pub type FixupResult < T > = Result < T , FixupError > ; // "fixup result"
78
78
79
- /// A version of &ty::Tables which can be `Missing` (not needed),
79
+ /// A version of &ty::TypeckTables which can be `Missing` (not needed),
80
80
/// `InProgress` (during typeck) or `Interned` (result of typeck).
81
81
/// Only the `InProgress` version supports `borrow_mut`.
82
82
#[ derive( Copy , Clone ) ]
83
83
pub enum InferTables < ' a , ' gcx : ' a +' tcx , ' tcx : ' a > {
84
- Interned ( & ' a ty:: Tables < ' gcx > ) ,
85
- InProgress ( & ' a RefCell < ty:: Tables < ' tcx > > ) ,
84
+ Interned ( & ' a ty:: TypeckTables < ' gcx > ) ,
85
+ InProgress ( & ' a RefCell < ty:: TypeckTables < ' tcx > > ) ,
86
86
Missing
87
87
}
88
88
89
89
pub enum InferTablesRef < ' a , ' gcx : ' a +' tcx , ' tcx : ' a > {
90
- Interned ( & ' a ty:: Tables < ' gcx > ) ,
91
- InProgress ( Ref < ' a , ty:: Tables < ' tcx > > )
90
+ Interned ( & ' a ty:: TypeckTables < ' gcx > ) ,
91
+ InProgress ( Ref < ' a , ty:: TypeckTables < ' tcx > > )
92
92
}
93
93
94
94
impl < ' a , ' gcx , ' tcx > Deref for InferTablesRef < ' a , ' gcx , ' tcx > {
95
- type Target = ty:: Tables < ' tcx > ;
95
+ type Target = ty:: TypeckTables < ' tcx > ;
96
96
fn deref ( & self ) -> & Self :: Target {
97
97
match * self {
98
98
InferTablesRef :: Interned ( tables) => tables,
@@ -112,7 +112,7 @@ impl<'a, 'gcx, 'tcx> InferTables<'a, 'gcx, 'tcx> {
112
112
}
113
113
}
114
114
115
- pub fn expect_interned ( self ) -> & ' a ty:: Tables < ' gcx > {
115
+ pub fn expect_interned ( self ) -> & ' a ty:: TypeckTables < ' gcx > {
116
116
match self {
117
117
InferTables :: Interned ( tables) => tables,
118
118
InferTables :: InProgress ( _) => {
@@ -124,7 +124,7 @@ impl<'a, 'gcx, 'tcx> InferTables<'a, 'gcx, 'tcx> {
124
124
}
125
125
}
126
126
127
- pub fn borrow_mut ( self ) -> RefMut < ' a , ty:: Tables < ' tcx > > {
127
+ pub fn borrow_mut ( self ) -> RefMut < ' a , ty:: TypeckTables < ' tcx > > {
128
128
match self {
129
129
InferTables :: Interned ( _) => {
130
130
bug ! ( "InferTables: infcx.tables.borrow_mut() outside of type-checking" ) ;
@@ -407,51 +407,51 @@ impl fmt::Display for FixupError {
407
407
408
408
pub trait InferEnv < ' a , ' tcx > {
409
409
fn to_parts ( self , tcx : TyCtxt < ' a , ' tcx , ' tcx > )
410
- -> ( Option < & ' a ty:: Tables < ' tcx > > ,
411
- Option < ty:: Tables < ' tcx > > ,
410
+ -> ( Option < & ' a ty:: TypeckTables < ' tcx > > ,
411
+ Option < ty:: TypeckTables < ' tcx > > ,
412
412
Option < ty:: ParameterEnvironment < ' tcx > > ) ;
413
413
}
414
414
415
415
impl < ' a , ' tcx > InferEnv < ' a , ' tcx > for ( ) {
416
416
fn to_parts ( self , _: TyCtxt < ' a , ' tcx , ' tcx > )
417
- -> ( Option < & ' a ty:: Tables < ' tcx > > ,
418
- Option < ty:: Tables < ' tcx > > ,
417
+ -> ( Option < & ' a ty:: TypeckTables < ' tcx > > ,
418
+ Option < ty:: TypeckTables < ' tcx > > ,
419
419
Option < ty:: ParameterEnvironment < ' tcx > > ) {
420
420
( None , None , None )
421
421
}
422
422
}
423
423
424
424
impl < ' a , ' tcx > InferEnv < ' a , ' tcx > for ty:: ParameterEnvironment < ' tcx > {
425
425
fn to_parts ( self , _: TyCtxt < ' a , ' tcx , ' tcx > )
426
- -> ( Option < & ' a ty:: Tables < ' tcx > > ,
427
- Option < ty:: Tables < ' tcx > > ,
426
+ -> ( Option < & ' a ty:: TypeckTables < ' tcx > > ,
427
+ Option < ty:: TypeckTables < ' tcx > > ,
428
428
Option < ty:: ParameterEnvironment < ' tcx > > ) {
429
429
( None , None , Some ( self ) )
430
430
}
431
431
}
432
432
433
- impl < ' a , ' tcx > InferEnv < ' a , ' tcx > for ( & ' a ty:: Tables < ' tcx > , ty:: ParameterEnvironment < ' tcx > ) {
433
+ impl < ' a , ' tcx > InferEnv < ' a , ' tcx > for ( & ' a ty:: TypeckTables < ' tcx > , ty:: ParameterEnvironment < ' tcx > ) {
434
434
fn to_parts ( self , _: TyCtxt < ' a , ' tcx , ' tcx > )
435
- -> ( Option < & ' a ty:: Tables < ' tcx > > ,
436
- Option < ty:: Tables < ' tcx > > ,
435
+ -> ( Option < & ' a ty:: TypeckTables < ' tcx > > ,
436
+ Option < ty:: TypeckTables < ' tcx > > ,
437
437
Option < ty:: ParameterEnvironment < ' tcx > > ) {
438
438
( Some ( self . 0 ) , None , Some ( self . 1 ) )
439
439
}
440
440
}
441
441
442
- impl < ' a , ' tcx > InferEnv < ' a , ' tcx > for ( ty:: Tables < ' tcx > , ty:: ParameterEnvironment < ' tcx > ) {
442
+ impl < ' a , ' tcx > InferEnv < ' a , ' tcx > for ( ty:: TypeckTables < ' tcx > , ty:: ParameterEnvironment < ' tcx > ) {
443
443
fn to_parts ( self , _: TyCtxt < ' a , ' tcx , ' tcx > )
444
- -> ( Option < & ' a ty:: Tables < ' tcx > > ,
445
- Option < ty:: Tables < ' tcx > > ,
444
+ -> ( Option < & ' a ty:: TypeckTables < ' tcx > > ,
445
+ Option < ty:: TypeckTables < ' tcx > > ,
446
446
Option < ty:: ParameterEnvironment < ' tcx > > ) {
447
447
( None , Some ( self . 0 ) , Some ( self . 1 ) )
448
448
}
449
449
}
450
450
451
451
impl < ' a , ' tcx > InferEnv < ' a , ' tcx > for hir:: BodyId {
452
452
fn to_parts ( self , tcx : TyCtxt < ' a , ' tcx , ' tcx > )
453
- -> ( Option < & ' a ty:: Tables < ' tcx > > ,
454
- Option < ty:: Tables < ' tcx > > ,
453
+ -> ( Option < & ' a ty:: TypeckTables < ' tcx > > ,
454
+ Option < ty:: TypeckTables < ' tcx > > ,
455
455
Option < ty:: ParameterEnvironment < ' tcx > > ) {
456
456
let item_id = tcx. map . body_owner ( self ) ;
457
457
( Some ( tcx. item_tables ( tcx. map . local_def_id ( item_id) ) ) ,
@@ -466,8 +466,8 @@ impl<'a, 'tcx> InferEnv<'a, 'tcx> for hir::BodyId {
466
466
pub struct InferCtxtBuilder < ' a , ' gcx : ' a +' tcx , ' tcx : ' a > {
467
467
global_tcx : TyCtxt < ' a , ' gcx , ' gcx > ,
468
468
arena : DroplessArena ,
469
- fresh_tables : Option < RefCell < ty:: Tables < ' tcx > > > ,
470
- tables : Option < & ' a ty:: Tables < ' gcx > > ,
469
+ fresh_tables : Option < RefCell < ty:: TypeckTables < ' tcx > > > ,
470
+ tables : Option < & ' a ty:: TypeckTables < ' gcx > > ,
471
471
param_env : Option < ty:: ParameterEnvironment < ' gcx > > ,
472
472
projection_mode : Reveal ,
473
473
}
0 commit comments