Skip to content

False positive for 2018 unused extern crate in global allocator #52483

Closed
@Mark-Simulacrum

Description

@Mark-Simulacrum

Possibly macro related, not sure.

https://play.rust-lang.org/?gist=7c9846d22f310efa6ab4bec086d61d4e&version=nightly&mode=debug&edition=2018

#![deny(rust_2018_idioms)]

use alloc_system;

#[global_allocator]
static ALLOC: alloc_system::System = alloc_system::System;

fn main() {}
error: `extern crate` is not idiomatic in the new edition
 --> src/main.rs:6:1
  |
6 | static ALLOC: alloc_system::System = alloc_system::System;
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: convert it to a `use`
  |
note: lint level defined here
 --> src/main.rs:1:9
  |
1 | #![deny(rust_2018_idioms)]
  |         ^^^^^^^^^^^^^^^^
  = note: #[deny(unused_extern_crates)] implied by #[deny(rust_2018_idioms)]

cc @alexcrichton

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.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions