Skip to content

rustc: Trim down the rust_2018_idioms lint group #52926

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Aug 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions src/librustc_lint/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ use rustc::lint::{LateContext, LateLintPass, LintPass, LintArray};
use rustc::lint::builtin::{
BARE_TRAIT_OBJECTS,
ABSOLUTE_PATHS_NOT_STARTING_WITH_CRATE,
MACRO_USE_EXTERN_CRATE,
ELIDED_LIFETIMES_IN_PATHS,
parser::QUESTION_MARK_MACRO_SEP
};
Expand Down Expand Up @@ -195,11 +194,18 @@ pub fn register_builtins(store: &mut lint::LintStore, sess: Option<&Session>) {
add_lint_group!(sess,
"rust_2018_idioms",
BARE_TRAIT_OBJECTS,
UNREACHABLE_PUB,
UNUSED_EXTERN_CRATES,
MACRO_USE_EXTERN_CRATE,
ELIDED_LIFETIMES_IN_PATHS,
ELLIPSIS_INCLUSIVE_RANGE_PATTERNS);
ELLIPSIS_INCLUSIVE_RANGE_PATTERNS,
ELIDED_LIFETIMES_IN_PATHS

// FIXME(#52665, #47816) not always applicable and not all
// macros are ready for this yet.
// UNREACHABLE_PUB,

// FIXME macro crates are not up for this yet, too much
// breakage is seen if we try to encourage this lint.
// MACRO_USE_EXTERN_CRATE,
);

// Guidelines for creating a future incompatibility lint:
//
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/rust-2018/macro-use-warned-against.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// aux-build:macro-use-warned-against2.rs
// compile-pass

#![warn(rust_2018_idioms, unused)]
#![warn(macro_use_extern_crate, unused)]
#![feature(use_extern_macros)]

#[macro_use] //~ WARN should be replaced at use sites with a `use` statement
Expand Down
11 changes: 5 additions & 6 deletions src/test/ui/rust-2018/macro-use-warned-against.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ LL | #[macro_use] //~ WARN should be replaced at use sites with a `use` statemen
note: lint level defined here
--> $DIR/macro-use-warned-against.rs:15:9
|
LL | #![warn(rust_2018_idioms, unused)]
| ^^^^^^^^^^^^^^^^
= note: #[warn(macro_use_extern_crate)] implied by #[warn(rust_2018_idioms)]
LL | #![warn(macro_use_extern_crate, unused)]
| ^^^^^^^^^^^^^^^^^^^^^^

warning: unused `#[macro_use]` import
--> $DIR/macro-use-warned-against.rs:20:1
Expand All @@ -18,9 +17,9 @@ LL | #[macro_use] //~ WARN unused `#[macro_use]`
| ^^^^^^^^^^^^
|
note: lint level defined here
--> $DIR/macro-use-warned-against.rs:15:27
--> $DIR/macro-use-warned-against.rs:15:33
|
LL | #![warn(rust_2018_idioms, unused)]
| ^^^^^^
LL | #![warn(macro_use_extern_crate, unused)]
| ^^^^^^
= note: #[warn(unused_imports)] implied by #[warn(unused)]