Warn on unused #[macro_use] imports.
This commit is contained in:
parent
2efec3c180
commit
356fa2c5db
17 changed files with 67 additions and 24 deletions
21
src/test/compile-fail/imports/unused-macro-use.rs
Normal file
21
src/test/compile-fail/imports/unused-macro-use.rs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![deny(unused)]
|
||||
|
||||
#[macro_use] //~ ERROR unused `#[macro_use]` import
|
||||
extern crate core;
|
||||
|
||||
#[macro_use(
|
||||
panic //~ ERROR unused `#[macro_use]` import
|
||||
)]
|
||||
extern crate core as core_2;
|
||||
|
||||
fn main() {}
|
||||
|
|
@ -26,8 +26,6 @@ extern crate rand; // no error, the use marks it as used
|
|||
|
||||
extern crate lint_unused_extern_crate as other; // no error, the use * marks it as used
|
||||
|
||||
#[macro_use] extern crate core; // no error, the `#[macro_use]` marks it as used
|
||||
|
||||
#[allow(unused_imports)]
|
||||
use rand::isaac::IsaacRng;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue