diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2018-03-08 13:23:52 -0800 |
|---|---|---|
| committer | Manish Goregaokar <manishsmail@gmail.com> | 2018-03-08 17:10:06 -0800 |
| commit | a08cfc4cb6020164372a52080b64280c711d1bd5 (patch) | |
| tree | 72f1be9f0590c3d97d6742773be897dd1aba019d | |
| parent | 667973204d5ff01a92eef35c54d004797413b8a2 (diff) | |
| download | rust-a08cfc4cb6020164372a52080b64280c711d1bd5.tar.gz rust-a08cfc4cb6020164372a52080b64280c711d1bd5.zip | |
Add rust_2018_idioms lint group
| -rw-r--r-- | src/librustc_lint/builtin.rs | 2 | ||||
| -rw-r--r-- | src/librustc_lint/lib.rs | 6 | ||||
| -rw-r--r-- | src/test/ui/inference-variable-behind-raw-pointer.stderr | 2 |
3 files changed, 8 insertions, 2 deletions
diff --git a/src/librustc_lint/builtin.rs b/src/librustc_lint/builtin.rs index 831d4fc755f..d39e00ab18f 100644 --- a/src/librustc_lint/builtin.rs +++ b/src/librustc_lint/builtin.rs @@ -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" } diff --git a/src/librustc_lint/lib.rs b/src/librustc_lint/lib.rs index 98751b4c12e..81609db6292 100644 --- a/src/librustc_lint/lib.rs +++ b/src/librustc_lint/lib.rs @@ -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; @@ -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 diff --git a/src/test/ui/inference-variable-behind-raw-pointer.stderr b/src/test/ui/inference-variable-behind-raw-pointer.stderr index e1d4df85c2f..eb40151615d 100644 --- a/src/test/ui/inference-variable-behind-raw-pointer.stderr +++ b/src/test/ui/inference-variable-behind-raw-pointer.stderr @@ -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> |
