@@ -25,7 +25,7 @@ use syntax_pos::{self, Span};
2525use traits:: { self , ObligationCause , PredicateObligations , TraitEngine } ;
2626use ty:: error:: { ExpectedFound , TypeError , UnconstrainedNumeric } ;
2727use ty:: fold:: TypeFoldable ;
28- use ty:: relate:: { RelateResult , TraitObjectMode } ;
28+ use ty:: relate:: RelateResult ;
2929use ty:: subst:: { Kind , Substs } ;
3030use ty:: { self , GenericParamDefKind , Ty , TyCtxt , CtxtInterners } ;
3131use ty:: { FloatVid , IntVid , TyVid } ;
@@ -171,9 +171,6 @@ pub struct InferCtxt<'a, 'gcx: 'a + 'tcx, 'tcx: 'a> {
171171 // This flag is true while there is an active snapshot.
172172 in_snapshot : Cell < bool > ,
173173
174- // The TraitObjectMode used here,
175- trait_object_mode : TraitObjectMode ,
176-
177174 // A set of constraints that regionck must validate. Each
178175 // constraint has the form `T:'a`, meaning "some type `T` must
179176 // outlive the lifetime 'a". These constraints derive from
@@ -465,7 +462,6 @@ pub struct InferCtxtBuilder<'a, 'gcx: 'a + 'tcx, 'tcx: 'a> {
465462 arena : SyncDroplessArena ,
466463 interners : Option < CtxtInterners < ' tcx > > ,
467464 fresh_tables : Option < RefCell < ty:: TypeckTables < ' tcx > > > ,
468- trait_object_mode : TraitObjectMode ,
469465}
470466
471467impl < ' a , ' gcx , ' tcx > TyCtxt < ' a , ' gcx , ' gcx > {
@@ -475,7 +471,6 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'gcx> {
475471 arena : SyncDroplessArena :: default ( ) ,
476472 interners : None ,
477473 fresh_tables : None ,
478- trait_object_mode : TraitObjectMode :: NoSquash ,
479474 }
480475 }
481476}
@@ -488,12 +483,6 @@ impl<'a, 'gcx, 'tcx> InferCtxtBuilder<'a, 'gcx, 'tcx> {
488483 self
489484 }
490485
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-
497486 /// Given a canonical value `C` as a starting point, create an
498487 /// inference context that contains each of the bound values
499488 /// within instantiated as a fresh variable. The `f` closure is
@@ -520,7 +509,6 @@ impl<'a, 'gcx, 'tcx> InferCtxtBuilder<'a, 'gcx, 'tcx> {
520509 pub fn enter < R > ( & ' tcx mut self , f : impl for < ' b > FnOnce ( InferCtxt < ' b , ' gcx , ' tcx > ) -> R ) -> R {
521510 let InferCtxtBuilder {
522511 global_tcx,
523- trait_object_mode,
524512 ref arena,
525513 ref mut interners,
526514 ref fresh_tables,
@@ -532,7 +520,6 @@ impl<'a, 'gcx, 'tcx> InferCtxtBuilder<'a, 'gcx, 'tcx> {
532520 f ( InferCtxt {
533521 tcx,
534522 in_progress_tables,
535- trait_object_mode,
536523 projection_cache : Default :: default ( ) ,
537524 type_variables : RefCell :: new ( type_variable:: TypeVariableTable :: new ( ) ) ,
538525 int_unification_table : RefCell :: new ( ut:: UnificationTable :: new ( ) ) ,
@@ -614,10 +601,6 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
614601 self . in_snapshot . get ( )
615602 }
616603
617- pub fn trait_object_mode ( & self ) -> TraitObjectMode {
618- self . trait_object_mode
619- }
620-
621604 pub fn freshen < T : TypeFoldable < ' tcx > > ( & self , t : T ) -> T {
622605 t. fold_with ( & mut self . freshener ( ) )
623606 }
0 commit comments