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:
commit
1dbd49fc2a
@ -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")
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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() {
|
||||
}
|
||||
|
@ -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() {
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user