10
10
11
11
use rustc:: hir:: { self , ImplItemKind , TraitItemKind } ;
12
12
use rustc:: infer:: { self , InferOk } ;
13
- use rustc:: middle:: free_region:: FreeRegionMap ;
14
- use rustc:: middle:: region;
15
13
use rustc:: ty:: { self , TyCtxt } ;
16
14
use rustc:: traits:: { self , ObligationCause , ObligationCauseCode , Reveal } ;
17
15
use rustc:: ty:: error:: { ExpectedFound , TypeError } ;
@@ -38,8 +36,7 @@ pub fn compare_impl_method<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
38
36
impl_m_span : Span ,
39
37
trait_m : & ty:: AssociatedItem ,
40
38
impl_trait_ref : ty:: TraitRef < ' tcx > ,
41
- trait_item_span : Option < Span > ,
42
- old_broken_mode : bool ) {
39
+ trait_item_span : Option < Span > ) {
43
40
debug ! ( "compare_impl_method(impl_trait_ref={:?})" ,
44
41
impl_trait_ref) ;
45
42
@@ -71,8 +68,7 @@ pub fn compare_impl_method<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
71
68
impl_m,
72
69
impl_m_span,
73
70
trait_m,
74
- impl_trait_ref,
75
- old_broken_mode) {
71
+ impl_trait_ref) {
76
72
return ;
77
73
}
78
74
}
@@ -81,8 +77,7 @@ fn compare_predicate_entailment<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
81
77
impl_m : & ty:: AssociatedItem ,
82
78
impl_m_span : Span ,
83
79
trait_m : & ty:: AssociatedItem ,
84
- impl_trait_ref : ty:: TraitRef < ' tcx > ,
85
- old_broken_mode : bool )
80
+ impl_trait_ref : ty:: TraitRef < ' tcx > )
86
81
-> Result < ( ) , ErrorReported > {
87
82
let trait_to_impl_substs = impl_trait_ref. substs ;
88
83
@@ -98,7 +93,6 @@ fn compare_predicate_entailment<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
98
93
item_name : impl_m. name ,
99
94
impl_item_def_id : impl_m. def_id ,
100
95
trait_item_def_id : trait_m. def_id ,
101
- lint_id : if !old_broken_mode { Some ( impl_m_node_id) } else { None } ,
102
96
} ,
103
97
} ;
104
98
@@ -334,22 +328,8 @@ fn compare_predicate_entailment<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
334
328
335
329
// Finally, resolve all regions. This catches wily misuses of
336
330
// lifetime parameters.
337
- if old_broken_mode {
338
- // FIXME(#18937) -- this is how the code used to
339
- // work. This is buggy because the fulfillment cx creates
340
- // region obligations that get overlooked. The right
341
- // thing to do is the code below. But we keep this old
342
- // pass around temporarily.
343
- let region_scope_tree = region:: ScopeTree :: default ( ) ;
344
- let mut free_regions = FreeRegionMap :: new ( ) ;
345
- free_regions. relate_free_regions_from_predicates ( & param_env. caller_bounds ) ;
346
- infcx. resolve_regions_and_report_errors ( impl_m. def_id ,
347
- & region_scope_tree,
348
- & free_regions) ;
349
- } else {
350
- let fcx = FnCtxt :: new ( & inh, param_env, impl_m_node_id) ;
351
- fcx. regionck_item ( impl_m_node_id, impl_m_span, & [ ] ) ;
352
- }
331
+ let fcx = FnCtxt :: new ( & inh, param_env, impl_m_node_id) ;
332
+ fcx. regionck_item ( impl_m_node_id, impl_m_span, & [ ] ) ;
353
333
354
334
Ok ( ( ) )
355
335
} )
0 commit comments