Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update E0453 to new error format #35989

Merged
merged 1 commit into from
Aug 28, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
6 changes: 4 additions & 2 deletions src/test/compile-fail-fulldeps/lint-plugin-forbid-attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
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() {
}