From b9bca1800219b908049a5cfb7cafc0322439f9a8 Mon Sep 17 00:00:00 2001 From: Lucas Henry Date: Thu, 17 Oct 2019 19:15:42 +0200 Subject: [PATCH] Replaced warn attibute by deny --- .../lint/unused_parens_json_suggestion.fixed | 5 +- .../ui/lint/unused_parens_json_suggestion.rs | 5 +- .../lint/unused_parens_json_suggestion.stderr | 50 +++++++++++-------- 3 files changed, 34 insertions(+), 26 deletions(-) diff --git a/src/test/ui/lint/unused_parens_json_suggestion.fixed b/src/test/ui/lint/unused_parens_json_suggestion.fixed index 427407119102..7a2d9ecdc362 100644 --- a/src/test/ui/lint/unused_parens_json_suggestion.fixed +++ b/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 @@ -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(); } diff --git a/src/test/ui/lint/unused_parens_json_suggestion.rs b/src/test/ui/lint/unused_parens_json_suggestion.rs index 87192503986c..bfc649ad99c9 100644 --- a/src/test/ui/lint/unused_parens_json_suggestion.rs +++ b/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 @@ -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(); } diff --git a/src/test/ui/lint/unused_parens_json_suggestion.stderr b/src/test/ui/lint/unused_parens_json_suggestion.stderr index 256c7555c908..54baade36e6a 100644 --- a/src/test/ui/lint/unused_parens_json_suggestion.stderr +++ b/src/test/ui/lint/unused_parens_json_suggestion.stderr @@ -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 + +" +}