diff options
| author | flip1995 <hello@philkrones.com> | 2018-10-01 11:11:58 +0200 |
|---|---|---|
| committer | flip1995 <hello@philkrones.com> | 2018-10-01 11:11:58 +0200 |
| commit | e68db042888f6b3cb6164a5cc5bfc3a79faa851c (patch) | |
| tree | 042cbcc9d435ee33b5d567454322cefe2d7eb605 | |
| parent | f55129d0037c112a80276ee1de0c2245ddc6462c (diff) | |
| download | rust-e68db042888f6b3cb6164a5cc5bfc3a79faa851c.tar.gz rust-e68db042888f6b3cb6164a5cc5bfc3a79faa851c.zip | |
Add nightly check for tool_lints warning
cc #54358
| -rw-r--r-- | src/librustc/lint/levels.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/librustc/lint/levels.rs b/src/librustc/lint/levels.rs index 80365a56102..87d33e473e7 100644 --- a/src/librustc/lint/levels.rs +++ b/src/librustc/lint/levels.rs @@ -18,7 +18,7 @@ use lint::context::CheckLintNameResult; use lint::{self, Lint, LintId, Level, LintSource}; use rustc_data_structures::stable_hasher::{HashStable, ToStableHashKey, StableHasher, StableHasherResult}; -use session::Session; +use session::{config::nightly_options, Session}; use syntax::ast; use syntax::attr; use syntax::source_map::MultiSpan; @@ -299,7 +299,13 @@ impl<'a> LintLevelsBuilder<'a> { "change it to", new_lint_name.to_string(), Applicability::MachineApplicable, - ).emit(); + ); + + if nightly_options::is_nightly_build() { + err.emit(); + } else { + err.cancel(); + } let src = LintSource::Node(Symbol::intern(&new_lint_name), li.span); for id in ids { |
