Skip to content

Commit

Permalink
Rollup merge of rust-lang#35989 - 0xmohit:pr/error-code-E0453, r=jona…
Browse files Browse the repository at this point in the history
…thandturner

Update E0453 to new error format

Fixes rust-lang#35929.
Part of rust-lang#35233.

r? @jonathandturner
  • Loading branch information
steveklabnik authored Aug 25, 2016
2 parents eaa222d + e4871c4 commit c1c6d6c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/librustc/lint/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
5 changes: 4 additions & 1 deletion src/test/compile-fail/E0453.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
}
6 changes: 4 additions & 2 deletions src/test/compile-fail/lint-forbid-attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
}

0 comments on commit c1c6d6c

Please sign in to comment.