Skip to content

Commit b9bca18

Browse files
author
Lucas Henry
committed
Replaced warn attibute by deny
1 parent a16dca3 commit b9bca18

File tree

3 files changed

+34
-26
lines changed

3 files changed

+34
-26
lines changed

src/test/ui/lint/unused_parens_json_suggestion.fixed

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// compile-flags: --error-format pretty-json -Zunstable-options
2-
// build-pass (FIXME(62277): could be check-pass?)
32
// run-rustfix
43

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

11-
#![warn(unused_parens)]
10+
#![deny(unused_parens)]
1211
#![allow(unreachable_code)]
1312

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

src/test/ui/lint/unused_parens_json_suggestion.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// compile-flags: --error-format pretty-json -Zunstable-options
2-
// build-pass (FIXME(62277): could be check-pass?)
32
// run-rustfix
43

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

11-
#![warn(unused_parens)]
10+
#![deny(unused_parens)]
1211
#![allow(unreachable_code)]
1312

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

src/test/ui/lint/unused_parens_json_suggestion.stderr

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@
44
"code": "unused_parens",
55
"explanation": null
66
},
7-
"level": "warning",
7+
"level": "error",
88
"spans": [
99
{
1010
"file_name": "$DIR/unused_parens_json_suggestion.rs",
11-
"byte_start": 654,
12-
"byte_end": 667,
13-
"line_start": 17,
14-
"line_end": 17,
11+
"byte_start": 603,
12+
"byte_end": 616,
13+
"line_start": 16,
14+
"line_end": 16,
1515
"column_start": 14,
1616
"column_end": 27,
1717
"is_primary": true,
1818
"text": [
1919
{
20-
"text": " let _a = (1 / (2 + 3));",
20+
"text": " let _a = (1 / (2 + 3));
2121
"highlight_start": 14,
2222
"highlight_end": 27
2323
}
@@ -36,16 +36,16 @@
3636
"spans": [
3737
{
3838
"file_name": "$DIR/unused_parens_json_suggestion.rs",
39-
"byte_start": 472,
40-
"byte_end": 485,
41-
"line_start": 11,
42-
"line_end": 11,
39+
"byte_start": 421,
40+
"byte_end": 434,
41+
"line_start": 10,
42+
"line_end": 10,
4343
"column_start": 9,
4444
"column_end": 22,
4545
"is_primary": true,
4646
"text": [
4747
{
48-
"text": "#![warn(unused_parens)]",
48+
"text": "#![deny(unused_parens)]",
4949
"highlight_start": 9,
5050
"highlight_end": 22
5151
}
@@ -66,16 +66,16 @@
6666
"spans": [
6767
{
6868
"file_name": "$DIR/unused_parens_json_suggestion.rs",
69-
"byte_start": 654,
70-
"byte_end": 667,
71-
"line_start": 17,
72-
"line_end": 17,
69+
"byte_start": 603,
70+
"byte_end": 616,
71+
"line_start": 16,
72+
"line_end": 16,
7373
"column_start": 14,
7474
"column_end": 27,
7575
"is_primary": true,
7676
"text": [
7777
{
78-
"text": " let _a = (1 / (2 + 3));",
78+
"text": " let _a = (1 / (2 + 3));
7979
"highlight_start": 14,
8080
"highlight_end": 27
8181
}
@@ -90,17 +90,27 @@
9090
"rendered": null
9191
}
9292
],
93-
"rendered": "warning: unnecessary parentheses around assigned value
94-
--> $DIR/unused_parens_json_suggestion.rs:17:14
93+
"rendered": "error: unnecessary parentheses around assigned value
94+
--> $DIR/unused_parens_json_suggestion.rs:16:14
9595
|
9696
LL | let _a = (1 / (2 + 3));
9797
| ^^^^^^^^^^^^^ help: remove these parentheses
9898
|
9999
note: lint level defined here
100-
--> $DIR/unused_parens_json_suggestion.rs:11:9
100+
--> $DIR/unused_parens_json_suggestion.rs:10:9
101101
|
102-
LL | #![warn(unused_parens)]
102+
LL | #![deny(unused_parens)]
103103
| ^^^^^^^^^^^^^
104104

105105
"
106106
}
107+
{
108+
"message": "aborting due to previous error",
109+
"code": null,
110+
"level": "error",
111+
"spans": [],
112+
"children": [],
113+
"rendered": "error: aborting due to previous error
114+
115+
"
116+
}

0 commit comments

Comments
 (0)