@@ -35,11 +35,7 @@ use std::collections::{BTreeMap, HashSet, VecDeque};
35
35
/// The main entry point to our analysis passes.
36
36
///
37
37
/// Set up the necessary data structures and run the analysis passes and call the actual passes.
38
- pub fn run_analysis < ' a , ' tcx > (
39
- tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
40
- old : DefId ,
41
- new : DefId ,
42
- ) -> ChangeSet < ' tcx > {
38
+ pub fn run_analysis < ' tcx > ( tcx : TyCtxt < ' tcx , ' tcx > , old : DefId , new : DefId ) -> ChangeSet < ' tcx > {
43
39
let mut changes = ChangeSet :: default ( ) ;
44
40
let mut id_mapping = IdMapping :: new ( old. krate , new. krate ) ;
45
41
@@ -78,7 +74,7 @@ fn get_vis(outer_vis: Visibility, def: Export<HirId>) -> Visibility {
78
74
}
79
75
}
80
76
81
- pub fn run_traversal < ' a , ' tcx > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > , new : DefId ) {
77
+ pub fn run_traversal < ' tcx > ( tcx : TyCtxt < ' tcx , ' tcx > , new : DefId ) {
82
78
use rustc:: hir:: def:: DefKind :: * ;
83
79
let mut visited = HashSet :: new ( ) ;
84
80
let mut mod_queue = VecDeque :: new ( ) ;
@@ -125,10 +121,10 @@ pub fn run_traversal<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, new: DefId) {
125
121
/// from the two crate versions and compare for changes. Matching children get processed
126
122
/// in the same fashion.
127
123
#[ cfg_attr( feature = "cargo-clippy" , allow( clippy:: cognitive_complexity) ) ]
128
- fn diff_structure < ' a , ' tcx > (
124
+ fn diff_structure < ' tcx > (
129
125
changes : & mut ChangeSet ,
130
126
id_mapping : & mut IdMapping ,
131
- tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
127
+ tcx : TyCtxt < ' tcx , ' tcx > ,
132
128
old : DefId ,
133
129
new : DefId ,
134
130
) {
@@ -362,7 +358,7 @@ fn diff_structure<'a, 'tcx>(
362
358
}
363
359
364
360
/// Given two fn items, perform structural checks.
365
- fn diff_fn < ' a , ' tcx > ( changes : & mut ChangeSet , tcx : TyCtxt < ' a , ' tcx , ' tcx > , old : Res , new : Res ) {
361
+ fn diff_fn < ' tcx > ( changes : & mut ChangeSet , tcx : TyCtxt < ' tcx , ' tcx > , old : Res , new : Res ) {
366
362
let old_def_id = old. def_id ( ) ;
367
363
let new_def_id = new. def_id ( ) ;
368
364
@@ -381,9 +377,9 @@ fn diff_fn<'a, 'tcx>(changes: &mut ChangeSet, tcx: TyCtxt<'a, 'tcx, 'tcx>, old:
381
377
}
382
378
383
379
/// Given two method items, perform structural checks.
384
- fn diff_method < ' a , ' tcx > (
380
+ fn diff_method < ' tcx > (
385
381
changes : & mut ChangeSet ,
386
- tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
382
+ tcx : TyCtxt < ' tcx , ' tcx > ,
387
383
old : AssocItem ,
388
384
new : AssocItem ,
389
385
) {
@@ -562,10 +558,10 @@ fn diff_adts(changes: &mut ChangeSet, id_mapping: &mut IdMapping, tcx: TyCtxt, o
562
558
///
563
559
/// This establishes the needed correspondence between non-toplevel items found in the trait
564
560
/// definition.
565
- fn diff_traits < ' a , ' tcx > (
561
+ fn diff_traits < ' tcx > (
566
562
changes : & mut ChangeSet ,
567
563
id_mapping : & mut IdMapping ,
568
- tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
564
+ tcx : TyCtxt < ' tcx , ' tcx > ,
569
565
old : DefId ,
570
566
new : DefId ,
571
567
output : bool ,
@@ -833,10 +829,10 @@ fn diff_generics(
833
829
// of matching items are compared for changes.
834
830
835
831
/// Given two items, compare their types.
836
- fn diff_types < ' a , ' tcx > (
832
+ fn diff_types < ' tcx > (
837
833
changes : & mut ChangeSet < ' tcx > ,
838
834
id_mapping : & IdMapping ,
839
- tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
835
+ tcx : TyCtxt < ' tcx , ' tcx > ,
840
836
old : Res ,
841
837
new : Res ,
842
838
) {
@@ -902,10 +898,10 @@ fn diff_types<'a, 'tcx>(
902
898
}
903
899
904
900
/// Compare two types and their trait bounds, possibly registering the resulting change.
905
- fn cmp_types < ' a , ' tcx > (
901
+ fn cmp_types < ' tcx > (
906
902
changes : & mut ChangeSet < ' tcx > ,
907
903
id_mapping : & IdMapping ,
908
- tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
904
+ tcx : TyCtxt < ' tcx , ' tcx > ,
909
905
orig_def_id : DefId ,
910
906
target_def_id : DefId ,
911
907
orig : Ty < ' tcx > ,
@@ -955,10 +951,10 @@ fn cmp_types<'a, 'tcx>(
955
951
}
956
952
957
953
/// Compare the trait bounds of two items, possibly registering the resulting change.
958
- fn cmp_bounds < ' a , ' tcx > (
954
+ fn cmp_bounds < ' tcx > (
959
955
changes : & mut ChangeSet < ' tcx > ,
960
956
id_mapping : & IdMapping ,
961
- tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
957
+ tcx : TyCtxt < ' tcx , ' tcx > ,
962
958
orig_def_id : DefId ,
963
959
target_def_id : DefId ,
964
960
) {
@@ -988,10 +984,10 @@ fn cmp_bounds<'a, 'tcx>(
988
984
// their trait bounds and compared for changes, if applicable.
989
985
990
986
/// Compare the inherent implementations of all matching items.
991
- fn diff_inherent_impls < ' a , ' tcx > (
987
+ fn diff_inherent_impls < ' tcx > (
992
988
changes : & mut ChangeSet < ' tcx > ,
993
989
id_mapping : & IdMapping ,
994
- tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
990
+ tcx : TyCtxt < ' tcx , ' tcx > ,
995
991
) {
996
992
debug ! ( "diffing inherent impls" ) ;
997
993
@@ -1071,8 +1067,8 @@ fn diff_inherent_impls<'a, 'tcx>(
1071
1067
// from perfect and will cause false positives in some cases (see comment in the inner function).
1072
1068
#[ allow( clippy:: let_and_return) ]
1073
1069
#[ allow( clippy:: match_same_arms) ]
1074
- fn is_impl_trait_public < ' a , ' tcx > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > , impl_def_id : DefId ) -> bool {
1075
- fn type_visibility < ' a , ' tcx > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > , ty : Ty ) -> Visibility {
1070
+ fn is_impl_trait_public < ' tcx > ( tcx : TyCtxt < ' tcx , ' tcx > , impl_def_id : DefId ) -> bool {
1071
+ fn type_visibility < ' tcx > ( tcx : TyCtxt < ' tcx , ' tcx > , ty : Ty ) -> Visibility {
1076
1072
match ty. sty {
1077
1073
TyKind :: Adt ( def, _) => tcx. visibility ( def. did ) ,
1078
1074
@@ -1112,10 +1108,10 @@ fn is_impl_trait_public<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, impl_def_id: DefI
1112
1108
}
1113
1109
1114
1110
/// Compare the implementations of all matching traits.
1115
- fn diff_trait_impls < ' a , ' tcx > (
1111
+ fn diff_trait_impls < ' tcx > (
1116
1112
changes : & mut ChangeSet < ' tcx > ,
1117
1113
id_mapping : & IdMapping ,
1118
- tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
1114
+ tcx : TyCtxt < ' tcx , ' tcx > ,
1119
1115
) {
1120
1116
debug ! ( "diffing trait impls" ) ;
1121
1117
@@ -1165,10 +1161,10 @@ fn diff_trait_impls<'a, 'tcx>(
1165
1161
1166
1162
/// Compare an item pair in two inherent implementations and indicate whether the target one is
1167
1163
/// compatible with the original one.
1168
- fn match_inherent_impl < ' a , ' tcx > (
1164
+ fn match_inherent_impl < ' tcx > (
1169
1165
changes : & mut ChangeSet < ' tcx > ,
1170
1166
id_mapping : & IdMapping ,
1171
- tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
1167
+ tcx : TyCtxt < ' tcx , ' tcx > ,
1172
1168
orig_impl_def_id : DefId ,
1173
1169
target_impl_def_id : DefId ,
1174
1170
orig_item : AssocItem ,
@@ -1294,7 +1290,7 @@ fn match_inherent_impl<'a, 'tcx>(
1294
1290
/// Compare two implementations and indicate whether the target one is compatible with the
1295
1291
/// original one.
1296
1292
fn match_trait_impl < ' a , ' tcx > (
1297
- tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
1293
+ tcx : TyCtxt < ' tcx , ' tcx > ,
1298
1294
trans : & TranslationContext < ' a , ' tcx , ' tcx > ,
1299
1295
orig_def_id : DefId ,
1300
1296
) -> bool {
0 commit comments