-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix suggestion output, add run-rustfix to test file, stop sorting imp…
…ort segments duh
- Loading branch information
Showing
4 changed files
with
68 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// compile-flags: --edition 2018 | ||
// aux-build:macro_rules.rs | ||
// aux-build:macro_use_helper.rs | ||
// run-rustfix | ||
|
||
#![allow(clippy::single_component_path_imports)] | ||
#![warn(clippy::macro_use_imports)] | ||
|
||
#[macro_use] | ||
extern crate macro_use_helper as mac; | ||
|
||
#[macro_use] | ||
extern crate clippy_mini_macro_test as mini_mac; | ||
|
||
mod a { | ||
use mac::{pub_macro, inner_mod_macro, function_macro, ty_macro, pub_in_private_macro}; | ||
use mac; | ||
use mini_mac::ClippyMiniMacroTest; | ||
use mini_mac; | ||
use mac::{inner::foofoo, inner::try_err}; | ||
use mac::inner; | ||
use mac::inner::nested::string_add; | ||
use mac::inner::nested; | ||
|
||
#[derive(ClippyMiniMacroTest)] | ||
struct Test; | ||
|
||
fn test() { | ||
pub_macro!(); | ||
inner_mod_macro!(); | ||
pub_in_private_macro!(_var); | ||
function_macro!(); | ||
let v: ty_macro!() = Vec::default(); | ||
|
||
inner::try_err!(); | ||
inner::foofoo!(); | ||
nested::string_add!(); | ||
} | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
error: `macro_use` attributes are no longer needed in the Rust 2018 edition | ||
--> $DIR/macro_use_imports.rs:17:5 | ||
--> $DIR/macro_use_imports.rs:18:5 | ||
| | ||
LL | #[macro_use] | ||
| ^^^^^^^^^^^^ help: remove the attribute and import the macro directly, try: `use mini_mac::ClippyMiniMacroTest` | ||
| ^^^^^^^^^^^^ help: remove the attribute and import the macro directly, try: `use mini_mac::ClippyMiniMacroTest;` | ||
| | ||
= note: `-D clippy::macro-use-imports` implied by `-D warnings` | ||
|
||
error: `macro_use` attributes are no longer needed in the Rust 2018 edition | ||
--> $DIR/macro_use_imports.rs:21:5 | ||
--> $DIR/macro_use_imports.rs:20:5 | ||
| | ||
LL | #[macro_use] | ||
| ^^^^^^^^^^^^ help: remove the attribute and import the macro directly, try: `use mac::inner::nested::string_add` | ||
| ^^^^^^^^^^^^ help: remove the attribute and import the macro directly, try: `use mac::{inner::foofoo, inner::try_err};` | ||
|
||
error: `macro_use` attributes are no longer needed in the Rust 2018 edition | ||
--> $DIR/macro_use_imports.rs:19:5 | ||
--> $DIR/macro_use_imports.rs:16:5 | ||
| | ||
LL | #[macro_use] | ||
| ^^^^^^^^^^^^ help: remove the attribute and import the macro directly, try: `use mac::{foofoo::inner, inner::try_err}` | ||
| ^^^^^^^^^^^^ help: remove the attribute and import the macro directly, try: `use mac::{pub_macro, inner_mod_macro, function_macro, ty_macro, pub_in_private_macro};` | ||
|
||
error: `macro_use` attributes are no longer needed in the Rust 2018 edition | ||
--> $DIR/macro_use_imports.rs:15:5 | ||
--> $DIR/macro_use_imports.rs:22:5 | ||
| | ||
LL | #[macro_use] | ||
| ^^^^^^^^^^^^ help: remove the attribute and import the macro directly, try: `use mac::{pub_macro, inner_mod_macro, function_macro, ty_macro, pub_in_private_macro}` | ||
| ^^^^^^^^^^^^ help: remove the attribute and import the macro directly, try: `use mac::inner::nested::string_add;` | ||
|
||
error: aborting due to 4 previous errors | ||
|