Skip to content

Commit 3d0f0e3

Browse files
committed
Auto merge of #5276 - flip1995:macro_use, r=flip1995
Rename macro_use_import -> macro_use_imports I missed this during review of #5230. We can just do this, without deprecating the old name, since this lint didn't hit nightly rustc yet. changelog: none
2 parents 23d2b21 + 57393b5 commit 3d0f0e3

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1209,7 +1209,7 @@ Released 2018-09-13
12091209
[`linkedlist`]: https://rust-lang.github.io/rust-clippy/master/index.html#linkedlist
12101210
[`logic_bug`]: https://rust-lang.github.io/rust-clippy/master/index.html#logic_bug
12111211
[`lossy_float_literal`]: https://rust-lang.github.io/rust-clippy/master/index.html#lossy_float_literal
1212-
[`macro_use_import`]: https://rust-lang.github.io/rust-clippy/master/index.html#macro_use_import
1212+
[`macro_use_imports`]: https://rust-lang.github.io/rust-clippy/master/index.html#macro_use_imports
12131213
[`main_recursion`]: https://rust-lang.github.io/rust-clippy/master/index.html#main_recursion
12141214
[`manual_memcpy`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_memcpy
12151215
[`manual_saturating_arithmetic`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_saturating_arithmetic

clippy_lints/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
600600
&loops::WHILE_IMMUTABLE_CONDITION,
601601
&loops::WHILE_LET_LOOP,
602602
&loops::WHILE_LET_ON_ITERATOR,
603-
&macro_use::MACRO_USE_IMPORT,
603+
&macro_use::MACRO_USE_IMPORTS,
604604
&main_recursion::MAIN_RECURSION,
605605
&map_clone::MAP_CLONE,
606606
&map_unit_fn::OPTION_MAP_UNIT_FN,
@@ -1014,7 +1014,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
10141014
store.register_early_pass(move || box excessive_bools::ExcessiveBools::new(max_struct_bools, max_fn_params_bools));
10151015
store.register_early_pass(|| box option_env_unwrap::OptionEnvUnwrap);
10161016
store.register_late_pass(|| box wildcard_imports::WildcardImports);
1017-
store.register_early_pass(|| box macro_use::MacroUseImport);
1017+
store.register_early_pass(|| box macro_use::MacroUseImports);
10181018

10191019
store.register_group(true, "clippy::restriction", Some("clippy_restriction"), vec![
10201020
LintId::of(&arithmetic::FLOAT_ARITHMETIC),
@@ -1082,7 +1082,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
10821082
LintId::of(&literal_representation::LARGE_DIGIT_GROUPS),
10831083
LintId::of(&loops::EXPLICIT_INTO_ITER_LOOP),
10841084
LintId::of(&loops::EXPLICIT_ITER_LOOP),
1085-
LintId::of(&macro_use::MACRO_USE_IMPORT),
1085+
LintId::of(&macro_use::MACRO_USE_IMPORTS),
10861086
LintId::of(&matches::SINGLE_MATCH_ELSE),
10871087
LintId::of(&methods::FILTER_MAP),
10881088
LintId::of(&methods::FILTER_MAP_NEXT),

clippy_lints/src/macro_use.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ declare_clippy_lint! {
1919
/// #[macro_use]
2020
/// use lazy_static;
2121
/// ```
22-
pub MACRO_USE_IMPORT,
22+
pub MACRO_USE_IMPORTS,
2323
pedantic,
2424
"#[macro_use] is no longer needed"
2525
}
2626

27-
declare_lint_pass!(MacroUseImport => [MACRO_USE_IMPORT]);
27+
declare_lint_pass!(MacroUseImports => [MACRO_USE_IMPORTS]);
2828

29-
impl EarlyLintPass for MacroUseImport {
29+
impl EarlyLintPass for MacroUseImports {
3030
fn check_item(&mut self, ecx: &EarlyContext<'_>, item: &ast::Item) {
3131
if_chain! {
3232
if ecx.sess.opts.edition == Edition::Edition2018;
@@ -40,7 +40,7 @@ impl EarlyLintPass for MacroUseImport {
4040
let help = format!("use {}::<macro name>", snippet(ecx, use_tree.span, "_"));
4141
span_lint_and_sugg(
4242
ecx,
43-
MACRO_USE_IMPORT,
43+
MACRO_USE_IMPORTS,
4444
mac_attr.span,
4545
msg,
4646
"remove the attribute and import the macro directly, try",

src/lintlist/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1016,7 +1016,7 @@ pub const ALL_LINTS: [Lint; 360] = [
10161016
module: "float_literal",
10171017
},
10181018
Lint {
1019-
name: "macro_use_import",
1019+
name: "macro_use_imports",
10201020
group: "pedantic",
10211021
desc: "#[macro_use] is no longer needed",
10221022
deprecation: None,

tests/ui/macro_use_import.rs renamed to tests/ui/macro_use_imports.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// compile-flags: --edition 2018
2-
#![warn(clippy::macro_use_import)]
2+
#![warn(clippy::macro_use_imports)]
33

44
use std::collections::HashMap;
55
#[macro_use]
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
error: `macro_use` attributes are no longer needed in the Rust 2018 edition
2-
--> $DIR/macro_use_import.rs:5:1
2+
--> $DIR/macro_use_imports.rs:5:1
33
|
44
LL | #[macro_use]
55
| ^^^^^^^^^^^^ help: remove the attribute and import the macro directly, try: `use std::prelude::<macro name>`
66
|
7-
= note: `-D clippy::macro-use-import` implied by `-D warnings`
7+
= note: `-D clippy::macro-use-imports` implied by `-D warnings`
88

99
error: aborting due to previous error
1010

0 commit comments

Comments
 (0)