Update E0453 to new error format

Fixes #35929.
Part of #35233.

r? @jonathandturner
This commit is contained in:
Mohit Agarwal 2016-08-25 19:09:48 +05:30
parent f5499a001d
commit 88e4def9c7
No known key found for this signature in database
GPG Key ID: 8BE9D15D0B0D06EB
4 changed files with 15 additions and 7 deletions

View File

@ -606,11 +606,12 @@ pub trait LintContext: Sized {
"{}({}) overruled by outer forbid({})",
level.as_str(), lint_name,
lint_name);
diag_builder.span_label(span, &format!("overruled by previous forbid"));
match now_source {
LintSource::Default => &mut diag_builder,
LintSource::Node(forbid_source_span) => {
diag_builder.span_note(forbid_source_span,
"`forbid` lint level set here")
diag_builder.span_label(forbid_source_span,
&format!("`forbid` level set here"))
},
LintSource::CommandLine => {
diag_builder.note("`forbid` lint level was set on command line")

View File

@ -15,11 +15,13 @@
#![plugin(lint_plugin_test)]
#![forbid(test_lint)]
//~^ NOTE lint level defined here
//~| NOTE `forbid` lint level set here
//~| NOTE `forbid` level set here
fn lintme() { } //~ ERROR item is named 'lintme'
#[allow(test_lint)] //~ ERROR allow(test_lint) overruled by outer forbid(test_lint)
#[allow(test_lint)]
//~^ ERROR allow(test_lint) overruled by outer forbid(test_lint)
//~| NOTE overruled by previous forbid
pub fn main() {
lintme();
}

View File

@ -9,7 +9,10 @@
// except according to those terms.
#![forbid(non_snake_case)]
//~^ NOTE `forbid` level set here
#[allow(non_snake_case)] //~ ERROR E0453
#[allow(non_snake_case)]
//~^ ERROR allow(non_snake_case) overruled by outer forbid(non_snake_case)
//~| NOTE overruled by previous forbid
fn main() {
}

View File

@ -9,8 +9,10 @@
// except according to those terms.
#![forbid(deprecated)]
//~^ NOTE `forbid` lint level set here
//~^ NOTE `forbid` level set here
#[allow(deprecated)] //~ ERROR allow(deprecated) overruled by outer forbid(deprecated)
#[allow(deprecated)]
//~^ ERROR allow(deprecated) overruled by outer forbid(deprecated)
//~| NOTE overruled by previous forbid
fn main() {
}