Skip to content

2018 idioms: rustc-internal crates linted to be removed when they can't #56038

@alexcrichton

Description

@alexcrichton

Discovered in rust-lang/cargo#6323

#![feature(extern_crate_item_prelude)]
#![feature(rustc_private)]
#![warn(rust_2018_idioms)]

extern crate syntax;

#[allow(unused_imports)]
use syntax::ast;

fn main() {}

yields:

warning: unused extern crate
 --> src/main.rs:5:1
  |
5 | extern crate syntax;
  | ^^^^^^^^^^^^^^^^^^^^ help: remove it
  |
note: lint level defined here
 --> src/main.rs:3:9
  |
3 | #![warn(rust_2018_idioms)]
  |         ^^^^^^^^^^^^^^^^
  = note: #[warn(unused_extern_crates)] implied by #[warn(rust_2018_idioms)]

This may be fixed by #55884, but it's not clear to me at least

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-edition-2018Area: The 2018 editionA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.A-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions