Skip to content

Commit

Permalink
Add rust_2018_idioms lint group
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Mar 9, 2018
1 parent 6679732 commit a08cfc4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/librustc_lint/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1263,7 +1263,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnionsWithDropFields {
pub struct UnreachablePub;

declare_lint! {
UNREACHABLE_PUB,
pub UNREACHABLE_PUB,
Allow,
"`pub` items not reachable from crate root"
}
Expand Down
6 changes: 6 additions & 0 deletions src/librustc_lint/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ extern crate rustc_mir;
extern crate syntax_pos;

use rustc::lint;
use rustc::lint::builtin::BARE_TRAIT_OBJECT;
use rustc::session;
use rustc::util;

Expand Down Expand Up @@ -177,6 +178,11 @@ pub fn register_builtins(store: &mut lint::LintStore, sess: Option<&Session>) {
UNUSED_FEATURES,
UNUSED_PARENS);

add_lint_group!(sess,
"rust_2018_idioms",
BARE_TRAIT_OBJECT,
UNREACHABLE_PUB);

// Guidelines for creating a future incompatibility lint:
//
// - Create a lint defaulting to warn as normal, with ideally the same error
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/inference-variable-behind-raw-pointer.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ LL | if data.is_null() {}
| ^^^^^^^
|
= note: #[warn(tyvar_behind_raw_pointer)] on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 epoch!
= note: for more information, see issue #46906 <https://github.com/rust-lang/rust/issues/46906>

0 comments on commit a08cfc4

Please sign in to comment.