Replaced warn attibute by deny
This commit is contained in:
parent
a16dca337d
commit
b9bca18002
3 changed files with 34 additions and 26 deletions
|
|
@ -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
|
||||
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
@ -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
|
||||
}
|
||||
|
|
@ -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
|
||||
}
|
||||
|
|
@ -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
|
||||
|
||||
"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue