Skip to content

Commit

Permalink
Replaced warn attibute by deny
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Henry committed Oct 17, 2019
1 parent a16dca3 commit b9bca18
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 26 deletions.
5 changes: 2 additions & 3 deletions src/test/ui/lint/unused_parens_json_suggestion.fixed
@@ -1,5 +1,4 @@
// compile-flags: --error-format pretty-json -Zunstable-options
// build-pass (FIXME(62277): could be check-pass?)
// run-rustfix

// The output for humans should just highlight the whole span without showing
Expand All @@ -8,13 +7,13 @@
// stripping away any starting or ending parenthesis characters—hence this
// test of the JSON error format.

#![warn(unused_parens)]
#![deny(unused_parens)]
#![allow(unreachable_code)]

fn main() {
// We want to suggest the properly-balanced expression `1 / (2 + 3)`, not
// the malformed `1 / (2 + 3`
let _a = 1 / (2 + 3);
let _a = 1 / (2 + 3); //~ERROR unused parentheses wrap expression
f();
}

Expand Down
5 changes: 2 additions & 3 deletions src/test/ui/lint/unused_parens_json_suggestion.rs
@@ -1,5 +1,4 @@
// compile-flags: --error-format pretty-json -Zunstable-options
// build-pass (FIXME(62277): could be check-pass?)
// run-rustfix

// The output for humans should just highlight the whole span without showing
Expand All @@ -8,13 +7,13 @@
// stripping away any starting or ending parenthesis characters—hence this
// test of the JSON error format.

#![warn(unused_parens)]
#![deny(unused_parens)]
#![allow(unreachable_code)]

fn main() {
// We want to suggest the properly-balanced expression `1 / (2 + 3)`, not
// the malformed `1 / (2 + 3`
let _a = (1 / (2 + 3));
let _a = (1 / (2 + 3)); //~ERROR unused parentheses wrap expression
f();
}

Expand Down
50 changes: 30 additions & 20 deletions src/test/ui/lint/unused_parens_json_suggestion.stderr
Expand Up @@ -4,20 +4,20 @@
"code": "unused_parens",
"explanation": null
},
"level": "warning",
"level": "error",
"spans": [
{
"file_name": "$DIR/unused_parens_json_suggestion.rs",
"byte_start": 654,
"byte_end": 667,
"line_start": 17,
"line_end": 17,
"byte_start": 603,
"byte_end": 616,
"line_start": 16,
"line_end": 16,
"column_start": 14,
"column_end": 27,
"is_primary": true,
"text": [
{
"text": " let _a = (1 / (2 + 3));",
"text": " let _a = (1 / (2 + 3));
"highlight_start": 14,
"highlight_end": 27
}
Expand All @@ -36,16 +36,16 @@
"spans": [
{
"file_name": "$DIR/unused_parens_json_suggestion.rs",
"byte_start": 472,
"byte_end": 485,
"line_start": 11,
"line_end": 11,
"byte_start": 421,
"byte_end": 434,
"line_start": 10,
"line_end": 10,
"column_start": 9,
"column_end": 22,
"is_primary": true,
"text": [
{
"text": "#![warn(unused_parens)]",
"text": "#![deny(unused_parens)]",
"highlight_start": 9,
"highlight_end": 22
}
Expand All @@ -66,16 +66,16 @@
"spans": [
{
"file_name": "$DIR/unused_parens_json_suggestion.rs",
"byte_start": 654,
"byte_end": 667,
"line_start": 17,
"line_end": 17,
"byte_start": 603,
"byte_end": 616,
"line_start": 16,
"line_end": 16,
"column_start": 14,
"column_end": 27,
"is_primary": true,
"text": [
{
"text": " let _a = (1 / (2 + 3));",
"text": " let _a = (1 / (2 + 3));
"highlight_start": 14,
"highlight_end": 27
}
Expand All @@ -90,17 +90,27 @@
"rendered": null
}
],
"rendered": "warning: unnecessary parentheses around assigned value
--> $DIR/unused_parens_json_suggestion.rs:17:14
"rendered": "error: unnecessary parentheses around assigned value
--> $DIR/unused_parens_json_suggestion.rs:16:14
|
LL | let _a = (1 / (2 + 3));
| ^^^^^^^^^^^^^ help: remove these parentheses
|
note: lint level defined here
--> $DIR/unused_parens_json_suggestion.rs:11:9
--> $DIR/unused_parens_json_suggestion.rs:10:9
|
LL | #![warn(unused_parens)]
LL | #![deny(unused_parens)]
| ^^^^^^^^^^^^^

"
}
{
"message": "aborting due to previous error",
"code": null,
"level": "error",
"spans": [],
"children": [],
"rendered": "error: aborting due to previous error

"
}

0 comments on commit b9bca18

Please sign in to comment.