提交 cd8de542 编写于 作者: V vagrant

Show clearer error message when #![deny(warnings)] escalates a warning

Addresses #30730
上级 d70ab2bd
......@@ -451,9 +451,14 @@ fn current_level(&self, lint: &'static Lint) -> Level {
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
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册