@@ -65,13 +65,12 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
6565 pub fn leak_check (
6666 & mut self ,
6767 tcx : TyCtxt < ' tcx > ,
68- overly_polymorphic : bool ,
6968 max_universe : ty:: UniverseIndex ,
7069 snapshot : & CombinedSnapshot < ' tcx > ,
7170 ) -> RelateResult < ' tcx , ( ) > {
7271 debug ! (
73- "leak_check(max_universe={:?}, snapshot.universe={:?}, overly_polymorphic={:?} )" ,
74- max_universe, snapshot. universe, overly_polymorphic
72+ "leak_check(max_universe={:?}, snapshot.universe={:?})" ,
73+ max_universe, snapshot. universe
7574 ) ;
7675
7776 assert ! ( UndoLogs :: <super :: UndoLog <' _>>:: in_snapshot( & self . undo_log) ) ;
@@ -84,14 +83,8 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
8483 let mini_graph =
8584 & MiniGraph :: new ( tcx, self . undo_log . region_constraints ( ) , & self . storage . data . verifys ) ;
8685
87- let mut leak_check = LeakCheck :: new (
88- tcx,
89- universe_at_start_of_snapshot,
90- max_universe,
91- overly_polymorphic,
92- mini_graph,
93- self ,
94- ) ;
86+ let mut leak_check =
87+ LeakCheck :: new ( tcx, universe_at_start_of_snapshot, max_universe, mini_graph, self ) ;
9588 leak_check. assign_placeholder_values ( ) ?;
9689 leak_check. propagate_scc_value ( ) ?;
9790 Ok ( ( ) )
@@ -101,8 +94,6 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
10194struct LeakCheck < ' me , ' tcx > {
10295 tcx : TyCtxt < ' tcx > ,
10396 universe_at_start_of_snapshot : ty:: UniverseIndex ,
104- /// Only used when reporting region errors.
105- overly_polymorphic : bool ,
10697 mini_graph : & ' me MiniGraph < ' tcx > ,
10798 rcc : & ' me RegionConstraintCollector < ' me , ' tcx > ,
10899
@@ -132,15 +123,13 @@ impl<'me, 'tcx> LeakCheck<'me, 'tcx> {
132123 tcx : TyCtxt < ' tcx > ,
133124 universe_at_start_of_snapshot : ty:: UniverseIndex ,
134125 max_universe : ty:: UniverseIndex ,
135- overly_polymorphic : bool ,
136126 mini_graph : & ' me MiniGraph < ' tcx > ,
137127 rcc : & ' me RegionConstraintCollector < ' me , ' tcx > ,
138128 ) -> Self {
139129 let dummy_scc_universe = SccUniverse { universe : max_universe, region : None } ;
140130 Self {
141131 tcx,
142132 universe_at_start_of_snapshot,
143- overly_polymorphic,
144133 mini_graph,
145134 rcc,
146135 scc_placeholders : IndexVec :: from_elem_n ( None , mini_graph. sccs . num_sccs ( ) ) ,
@@ -289,11 +278,7 @@ impl<'me, 'tcx> LeakCheck<'me, 'tcx> {
289278 other_region : ty:: Region < ' tcx > ,
290279 ) -> TypeError < ' tcx > {
291280 debug ! ( "error: placeholder={:?}, other_region={:?}" , placeholder, other_region) ;
292- if self . overly_polymorphic {
293- TypeError :: RegionsOverlyPolymorphic ( placeholder. bound . kind , other_region)
294- } else {
295- TypeError :: RegionsInsufficientlyPolymorphic ( placeholder. bound . kind , other_region)
296- }
281+ TypeError :: RegionsInsufficientlyPolymorphic ( placeholder. bound . kind , other_region)
297282 }
298283}
299284
0 commit comments