Rollup merge of #35989 - 0xmohit:pr/error-code-E0453, r=jonathandturner

Update E0453 to new error format

Fixes #35929.
Part of #35233.

r? @jonathandturner
This commit is contained in:
Jonathan Turner 2016-08-27 12:43:31 -07:00 committed by GitHub
commit 1dbd49fc2a
4 changed files with 15 additions and 7 deletions

View File

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

View File

@ -15,11 +15,13 @@
#![plugin(lint_plugin_test)] #![plugin(lint_plugin_test)]
#![forbid(test_lint)] #![forbid(test_lint)]
//~^ NOTE lint level defined here //~^ NOTE lint level defined here
//~| NOTE `forbid` lint level set here //~| NOTE `forbid` level set here
fn lintme() { } //~ ERROR item is named 'lintme' 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() { pub fn main() {
lintme(); lintme();
} }

View File

@ -9,7 +9,10 @@
// except according to those terms. // except according to those terms.
#![forbid(non_snake_case)] #![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() { fn main() {
} }

View File

@ -9,8 +9,10 @@
// except according to those terms. // except according to those terms.
#![forbid(deprecated)] #![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() { fn main() {
} }