@@ -22,6 +22,7 @@ use rustc_hir::def_id::DefId;
22
22
use rustc_hir:: hir_id:: HirId ;
23
23
use rustc_hir:: lang_items:: LangItem ;
24
24
use rustc_infer:: infer:: TyCtxtInferExt ;
25
+ use rustc_metadata:: creader:: CStore ;
25
26
use rustc_middle:: {
26
27
metadata:: ModChild ,
27
28
ty:: {
@@ -1149,51 +1150,50 @@ fn diff_trait_impls<'tcx>(
1149
1150
let structural_peq_def_id = tcx. require_lang_item ( LangItem :: StructuralPeq , None ) ;
1150
1151
let structural_trait_def_ids = [ structural_peq_def_id, structural_teq_def_id] ;
1151
1152
1152
- for ( old_impl_def_id , _ ) in tcx
1153
- . all_trait_implementations ( id_mapping . get_old_crate ( ) )
1154
- . iter ( )
1153
+ let cstore = CStore :: from_tcx ( tcx) ;
1154
+ for ( old_impl_def_id , _ ) in
1155
+ cstore . trait_impls_in_crate_untracked ( id_mapping . get_old_crate ( ) )
1155
1156
{
1156
- let old_trait_def_id = tcx. impl_trait_ref ( * old_impl_def_id) . unwrap ( ) . def_id ;
1157
+ let old_trait_def_id = tcx. impl_trait_ref ( old_impl_def_id) . unwrap ( ) . def_id ;
1157
1158
1158
1159
if structural_trait_def_ids. contains ( & old_trait_def_id) {
1159
1160
continue ;
1160
1161
}
1161
1162
1162
- if !to_new. can_translate ( old_trait_def_id) || !is_impl_trait_public ( tcx, * old_impl_def_id) {
1163
+ if !to_new. can_translate ( old_trait_def_id) || !is_impl_trait_public ( tcx, old_impl_def_id) {
1163
1164
continue ;
1164
1165
}
1165
1166
1166
- if !match_trait_impl ( tcx, & to_new, * old_impl_def_id) {
1167
+ if !match_trait_impl ( tcx, & to_new, old_impl_def_id) {
1167
1168
changes. new_change_impl (
1168
- * old_impl_def_id,
1169
- tcx. def_path_str ( * old_impl_def_id) ,
1170
- tcx. def_span ( * old_impl_def_id) ,
1169
+ old_impl_def_id,
1170
+ tcx. def_path_str ( old_impl_def_id) ,
1171
+ tcx. def_span ( old_impl_def_id) ,
1171
1172
) ;
1172
- changes. add_change ( ChangeType :: TraitImplTightened , * old_impl_def_id, None ) ;
1173
+ changes. add_change ( ChangeType :: TraitImplTightened , old_impl_def_id, None ) ;
1173
1174
}
1174
1175
}
1175
1176
1176
- for ( new_impl_def_id, _) in tcx
1177
- . all_trait_implementations ( id_mapping. get_new_crate ( ) )
1178
- . iter ( )
1177
+ for ( new_impl_def_id, _) in
1178
+ cstore. trait_impls_in_crate_untracked ( id_mapping. get_new_crate ( ) )
1179
1179
{
1180
- let new_trait_def_id = tcx. impl_trait_ref ( * new_impl_def_id) . unwrap ( ) . def_id ;
1180
+ let new_trait_def_id = tcx. impl_trait_ref ( new_impl_def_id) . unwrap ( ) . def_id ;
1181
1181
1182
1182
if structural_trait_def_ids. contains ( & new_trait_def_id) {
1183
1183
continue ;
1184
1184
}
1185
1185
1186
- if !to_old. can_translate ( new_trait_def_id) || !is_impl_trait_public ( tcx, * new_impl_def_id) {
1186
+ if !to_old. can_translate ( new_trait_def_id) || !is_impl_trait_public ( tcx, new_impl_def_id) {
1187
1187
continue ;
1188
1188
}
1189
1189
1190
- if !match_trait_impl ( tcx, & to_old, * new_impl_def_id) {
1190
+ if !match_trait_impl ( tcx, & to_old, new_impl_def_id) {
1191
1191
changes. new_change_impl (
1192
- * new_impl_def_id,
1193
- tcx. def_path_str ( * new_impl_def_id) ,
1194
- tcx. def_span ( * new_impl_def_id) ,
1192
+ new_impl_def_id,
1193
+ tcx. def_path_str ( new_impl_def_id) ,
1194
+ tcx. def_span ( new_impl_def_id) ,
1195
1195
) ;
1196
- changes. add_change ( ChangeType :: TraitImplLoosened , * new_impl_def_id, None ) ;
1196
+ changes. add_change ( ChangeType :: TraitImplLoosened , new_impl_def_id, None ) ;
1197
1197
}
1198
1198
}
1199
1199
}
0 commit comments