Skip to content

Commit

Permalink
Show clearer error message when #![deny(warnings)] escalates a warning
Browse files Browse the repository at this point in the history
Addresses #30730
  • Loading branch information
vagrant committed Jan 9, 2016
1 parent d70ab2b commit cd8de54
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/librustc/lint/context.rs
Expand Up @@ -451,9 +451,14 @@ pub trait LintContext: Sized {

fn level_src(&self, lint: &'static Lint) -> Option<LevelSource> {
self.lints().levels.get(&LintId::of(lint)).map(|ls| match ls {
&(Warn, src) => {
&(Warn, _) => {
let lint_id = LintId::of(builtin::WARNINGS);
(self.lints().get_level_source(lint_id).0, src)
let warn_src = self.lints().get_level_source(lint_id);
if warn_src.0 != Warn {
warn_src
} else {
*ls
}
}
_ => *ls
})
Expand Down

0 comments on commit cd8de54

Please sign in to comment.