Skip to content

unused_extern_crates lint trigged after return of extern crate syntax for non-Cargo crates (alloc, etc.) #54381

Closed
@sanmai-NL

Description

@sanmai-NL

Fallout from #54116, which fixed the syntax for imports from extern crates, a temporary solution to #53166.

This code:

extern crate alloc;

Leads to an unused_extern_crates lint failure.

error: `extern crate` is not idiomatic in the new edition                                                                                     
  --> bla/src/lib.rs:31:1                                                                                                                 
   |                                                                                                                                          
31 | extern crate alloc;                                                                                                                      
   | ^^^^^^^^^^^^^^^^^^^ help: convert it to a `use`                                                                                          
   |   
note: lint level defined here                                                                                                                 
  --> bla/src/lib.rs:15:5                                                                                                                 
   |                                                                                                                                          
15 |     unused,                                                                                                                              
   |     ^^^^^^                                                                                                                               
   = note: #[deny(unused_extern_crates)] implied by #[deny(unused)]                                                         

Meta

rustc 1.30.0-nightly (20dc0c507 2018-09-19)

Metadata

Metadata

Assignees

Labels

A-edition-2018Area: The 2018 editionA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions