@@ -9,7 +9,6 @@ use rustc_hir::{
99 Variant , VariantData ,
1010} ;
1111use rustc_lint:: { LateContext , LateLintPass , LintContext } ;
12- use rustc_middle:: lint:: in_external_macro;
1312use rustc_session:: impl_lint_pass;
1413
1514declare_clippy_lint ! {
@@ -248,7 +247,7 @@ impl<'tcx> LateLintPass<'tcx> for ArbitrarySourceItemOrdering {
248247 ItemKind :: Enum ( enum_def, _generics) if self . enable_ordering_for_enum => {
249248 let mut cur_v: Option < & Variant < ' _ > > = None ;
250249 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 ( ) ) {
252251 continue ;
253252 }
254253
@@ -263,7 +262,7 @@ impl<'tcx> LateLintPass<'tcx> for ArbitrarySourceItemOrdering {
263262 ItemKind :: Struct ( VariantData :: Struct { fields, .. } , _generics) if self . enable_ordering_for_struct => {
264263 let mut cur_f: Option < & FieldDef < ' _ > > = None ;
265264 for field in * fields {
266- if in_external_macro ( cx. sess ( ) , field . span ) {
265+ if field . span . in_external_macro ( cx. sess ( ) . source_map ( ) ) {
267266 continue ;
268267 }
269268
@@ -281,7 +280,7 @@ impl<'tcx> LateLintPass<'tcx> for ArbitrarySourceItemOrdering {
281280 let mut cur_t: Option < & TraitItemRef > = None ;
282281
283282 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 ( ) ) {
285284 continue ;
286285 }
287286
@@ -304,7 +303,7 @@ impl<'tcx> LateLintPass<'tcx> for ArbitrarySourceItemOrdering {
304303 let mut cur_t: Option < & ImplItemRef > = None ;
305304
306305 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 ( ) ) {
308307 continue ;
309308 }
310309
@@ -348,7 +347,7 @@ impl<'tcx> LateLintPass<'tcx> for ArbitrarySourceItemOrdering {
348347 // as no sorting by source map/line of code has to be applied.
349348 //
350349 for item in items {
351- if in_external_macro ( cx. sess ( ) , item . span ) {
350+ if item . span . in_external_macro ( cx. sess ( ) . source_map ( ) ) {
352351 continue ;
353352 }
354353
0 commit comments