@@ -9,7 +9,6 @@ use rustc_hir::{
9
9
Variant , VariantData ,
10
10
} ;
11
11
use rustc_lint:: { LateContext , LateLintPass , LintContext } ;
12
- use rustc_middle:: lint:: in_external_macro;
13
12
use rustc_session:: impl_lint_pass;
14
13
15
14
declare_clippy_lint ! {
@@ -248,7 +247,7 @@ impl<'tcx> LateLintPass<'tcx> for ArbitrarySourceItemOrdering {
248
247
ItemKind :: Enum ( enum_def, _generics) if self . enable_ordering_for_enum => {
249
248
let mut cur_v: Option < & Variant < ' _ > > = None ;
250
249
for variant in enum_def. variants {
251
- if in_external_macro ( cx. sess ( ) , variant . span ) {
250
+ if variant . span . in_external_macro ( cx. sess ( ) . source_map ( ) ) {
252
251
continue ;
253
252
}
254
253
@@ -263,7 +262,7 @@ impl<'tcx> LateLintPass<'tcx> for ArbitrarySourceItemOrdering {
263
262
ItemKind :: Struct ( VariantData :: Struct { fields, .. } , _generics) if self . enable_ordering_for_struct => {
264
263
let mut cur_f: Option < & FieldDef < ' _ > > = None ;
265
264
for field in * fields {
266
- if in_external_macro ( cx. sess ( ) , field . span ) {
265
+ if field . span . in_external_macro ( cx. sess ( ) . source_map ( ) ) {
267
266
continue ;
268
267
}
269
268
@@ -281,7 +280,7 @@ impl<'tcx> LateLintPass<'tcx> for ArbitrarySourceItemOrdering {
281
280
let mut cur_t: Option < & TraitItemRef > = None ;
282
281
283
282
for item in * item_ref {
284
- if in_external_macro ( cx. sess ( ) , item . span ) {
283
+ if item . span . in_external_macro ( cx. sess ( ) . source_map ( ) ) {
285
284
continue ;
286
285
}
287
286
@@ -304,7 +303,7 @@ impl<'tcx> LateLintPass<'tcx> for ArbitrarySourceItemOrdering {
304
303
let mut cur_t: Option < & ImplItemRef > = None ;
305
304
306
305
for item in trait_impl. items {
307
- if in_external_macro ( cx. sess ( ) , item . span ) {
306
+ if item . span . in_external_macro ( cx. sess ( ) . source_map ( ) ) {
308
307
continue ;
309
308
}
310
309
@@ -348,7 +347,7 @@ impl<'tcx> LateLintPass<'tcx> for ArbitrarySourceItemOrdering {
348
347
// as no sorting by source map/line of code has to be applied.
349
348
//
350
349
for item in items {
351
- if in_external_macro ( cx. sess ( ) , item . span ) {
350
+ if item . span . in_external_macro ( cx. sess ( ) . source_map ( ) ) {
352
351
continue ;
353
352
}
354
353
0 commit comments