提交 4b868411 编写于 作者: B bors

Auto merge of #30804 - shssoichiro:deny-warnings-msg, r=nrc

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

Addresses #30730
......@@ -489,9 +489,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
})
......
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![deny(warnings)] //~ NOTE: lint level defined here
use std::thread; //~ ERROR: unused import
fn main() {}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册