File tree 1 file changed +15
-17
lines changed
1 file changed +15
-17
lines changed Original file line number Diff line number Diff line change @@ -365,28 +365,26 @@ impl<'tcx> LateLintPass<'tcx> for ArbitrarySourceItemOrdering {
365
365
continue ;
366
366
}
367
367
368
- let ident = if let Some ( ident) = item. kind . ident ( ) {
369
- ident
368
+ if let Some ( ident) = item. kind . ident ( ) {
369
+ if ident. name . as_str ( ) . starts_with ( '_' ) {
370
+ // Filters out unnamed macro-like impls for various derives,
371
+ // e.g. serde::Serialize or num_derive::FromPrimitive.
372
+ continue ;
373
+ }
374
+
375
+ if ident. name == rustc_span:: sym:: std && item. span . is_dummy ( ) {
376
+ if let ItemKind :: ExternCrate ( None , _) = item. kind {
377
+ // Filters the auto-included Rust standard library.
378
+ continue ;
379
+ }
380
+ println ! ( "Unknown item: {item:?}" ) ;
381
+ }
370
382
} else if let ItemKind :: Impl ( _) = item. kind
371
383
&& get_item_name ( item) . is_some ( )
372
384
{
373
- rustc_span :: Ident :: empty ( ) // FIXME: a bit strange, is there a better way to do it?
385
+ // keep going below
374
386
} else {
375
387
continue ;
376
- } ;
377
-
378
- if ident. name . as_str ( ) . starts_with ( '_' ) {
379
- // Filters out unnamed macro-like impls for various derives,
380
- // e.g. serde::Serialize or num_derive::FromPrimitive.
381
- continue ;
382
- }
383
-
384
- if ident. name == rustc_span:: sym:: std && item. span . is_dummy ( ) {
385
- if let ItemKind :: ExternCrate ( None , _) = item. kind {
386
- // Filters the auto-included Rust standard library.
387
- continue ;
388
- }
389
- println ! ( "Unknown item: {item:?}" ) ;
390
388
}
391
389
392
390
let item_kind = convert_module_item_kind ( & item. kind ) ;
You can’t perform that action at this time.
0 commit comments