@@ -25,7 +25,7 @@ use syntax_pos::{self, Span};
25
25
use traits:: { self , ObligationCause , PredicateObligations , TraitEngine } ;
26
26
use ty:: error:: { ExpectedFound , TypeError , UnconstrainedNumeric } ;
27
27
use ty:: fold:: TypeFoldable ;
28
- use ty:: relate:: { RelateResult , TraitObjectMode } ;
28
+ use ty:: relate:: RelateResult ;
29
29
use ty:: subst:: { Kind , Substs } ;
30
30
use ty:: { self , GenericParamDefKind , Ty , TyCtxt , CtxtInterners } ;
31
31
use ty:: { FloatVid , IntVid , TyVid } ;
@@ -171,9 +171,6 @@ pub struct InferCtxt<'a, 'gcx: 'a + 'tcx, 'tcx: 'a> {
171
171
// This flag is true while there is an active snapshot.
172
172
in_snapshot : Cell < bool > ,
173
173
174
- // The TraitObjectMode used here,
175
- trait_object_mode : TraitObjectMode ,
176
-
177
174
// A set of constraints that regionck must validate. Each
178
175
// constraint has the form `T:'a`, meaning "some type `T` must
179
176
// outlive the lifetime 'a". These constraints derive from
@@ -465,7 +462,6 @@ pub struct InferCtxtBuilder<'a, 'gcx: 'a + 'tcx, 'tcx: 'a> {
465
462
arena : SyncDroplessArena ,
466
463
interners : Option < CtxtInterners < ' tcx > > ,
467
464
fresh_tables : Option < RefCell < ty:: TypeckTables < ' tcx > > > ,
468
- trait_object_mode : TraitObjectMode ,
469
465
}
470
466
471
467
impl < ' a , ' gcx , ' tcx > TyCtxt < ' a , ' gcx , ' gcx > {
@@ -475,7 +471,6 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'gcx> {
475
471
arena : SyncDroplessArena :: default ( ) ,
476
472
interners : None ,
477
473
fresh_tables : None ,
478
- trait_object_mode : TraitObjectMode :: NoSquash ,
479
474
}
480
475
}
481
476
}
@@ -488,12 +483,6 @@ impl<'a, 'gcx, 'tcx> InferCtxtBuilder<'a, 'gcx, 'tcx> {
488
483
self
489
484
}
490
485
491
- pub fn with_trait_object_mode ( mut self , mode : TraitObjectMode ) -> Self {
492
- debug ! ( "with_trait_object_mode: setting mode to {:?}" , mode) ;
493
- self . trait_object_mode = mode;
494
- self
495
- }
496
-
497
486
/// Given a canonical value `C` as a starting point, create an
498
487
/// inference context that contains each of the bound values
499
488
/// within instantiated as a fresh variable. The `f` closure is
@@ -520,7 +509,6 @@ impl<'a, 'gcx, 'tcx> InferCtxtBuilder<'a, 'gcx, 'tcx> {
520
509
pub fn enter < R > ( & ' tcx mut self , f : impl for < ' b > FnOnce ( InferCtxt < ' b , ' gcx , ' tcx > ) -> R ) -> R {
521
510
let InferCtxtBuilder {
522
511
global_tcx,
523
- trait_object_mode,
524
512
ref arena,
525
513
ref mut interners,
526
514
ref fresh_tables,
@@ -532,7 +520,6 @@ impl<'a, 'gcx, 'tcx> InferCtxtBuilder<'a, 'gcx, 'tcx> {
532
520
f ( InferCtxt {
533
521
tcx,
534
522
in_progress_tables,
535
- trait_object_mode,
536
523
projection_cache : Default :: default ( ) ,
537
524
type_variables : RefCell :: new ( type_variable:: TypeVariableTable :: new ( ) ) ,
538
525
int_unification_table : RefCell :: new ( ut:: UnificationTable :: new ( ) ) ,
@@ -614,10 +601,6 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
614
601
self . in_snapshot . get ( )
615
602
}
616
603
617
- pub fn trait_object_mode ( & self ) -> TraitObjectMode {
618
- self . trait_object_mode
619
- }
620
-
621
604
pub fn freshen < T : TypeFoldable < ' tcx > > ( & self , t : T ) -> T {
622
605
t. fold_with ( & mut self . freshener ( ) )
623
606
}
0 commit comments