diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2017-10-21 00:00:57 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2017-10-29 22:14:23 +0300 |
| commit | bf0cdb52f22df2eb6a510806fa32b05ab326a93e (patch) | |
| tree | 5012f67e5c6015e0b6d8db87ac257a6157aa95f9 /src/test/ui/lint | |
| parent | 690ff045949ac3f3c5bd341e1584f90bc49f0596 (diff) | |
| download | rust-bf0cdb52f22df2eb6a510806fa32b05ab326a93e.tar.gz rust-bf0cdb52f22df2eb6a510806fa32b05ab326a93e.zip | |
Add several lints into `unused` lint group
Remove a couple of obsolete lints
Diffstat (limited to 'src/test/ui/lint')
| -rw-r--r-- | src/test/ui/lint/suggestions.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/lint/suggestions.stderr | 8 | ||||
| -rw-r--r-- | src/test/ui/lint/unused_parens_json_suggestion.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/lint/unused_parens_json_suggestion.stderr | 2 |
4 files changed, 10 insertions, 4 deletions
diff --git a/src/test/ui/lint/suggestions.rs b/src/test/ui/lint/suggestions.rs index e078056ab5e..bf2b5769bf8 100644 --- a/src/test/ui/lint/suggestions.rs +++ b/src/test/ui/lint/suggestions.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![warn(unused_mut)] // UI tests pass `-A unused`—see Issue #43896 +#![warn(unused_mut, unused_parens)] // UI tests pass `-A unused`—see Issue #43896 #![feature(no_debug)] #[no_mangle] static SHENZHOU: usize = 1; // should suggest `pub` diff --git a/src/test/ui/lint/suggestions.stderr b/src/test/ui/lint/suggestions.stderr index 7a498b56413..a0014666836 100644 --- a/src/test/ui/lint/suggestions.stderr +++ b/src/test/ui/lint/suggestions.stderr @@ -4,7 +4,11 @@ warning: unnecessary parentheses around assigned value 30 | let mut a = (1); // should suggest no `mut`, no parens | ^^^ help: remove these parentheses | - = note: #[warn(unused_parens)] on by default +note: lint level defined here + --> $DIR/suggestions.rs:11:21 + | +11 | #![warn(unused_mut, unused_parens)] // UI tests pass `-A unused`—see Issue #43896 + | ^^^^^^^^^^^^^ warning: use of deprecated attribute `no_debug`: the `#[no_debug]` attribute was an experimental feature that has been deprecated due to lack of demand. See https://github.com/rust-lang/rust/issues/29721 --> $DIR/suggestions.rs:27:1 @@ -25,7 +29,7 @@ warning: variable does not need to be mutable note: lint level defined here --> $DIR/suggestions.rs:11:9 | -11 | #![warn(unused_mut)] // UI tests pass `-A unused`—see Issue #43896 +11 | #![warn(unused_mut, unused_parens)] // UI tests pass `-A unused`—see Issue #43896 | ^^^^^^^^^^ warning: static is marked #[no_mangle], but not exported diff --git a/src/test/ui/lint/unused_parens_json_suggestion.rs b/src/test/ui/lint/unused_parens_json_suggestion.rs index 9decb0cff36..15251795d5e 100644 --- a/src/test/ui/lint/unused_parens_json_suggestion.rs +++ b/src/test/ui/lint/unused_parens_json_suggestion.rs @@ -16,6 +16,8 @@ // stripping away any starting or ending parenthesis characters—hence this // test of the JSON error format. +#![warn(unused_parens)] + fn main() { // We want to suggest the properly-balanced expression `1 / (2 + 3)`, not // the malformed `1 / (2 + 3` diff --git a/src/test/ui/lint/unused_parens_json_suggestion.stderr b/src/test/ui/lint/unused_parens_json_suggestion.stderr index 701334d8890..ae5b53da175 100644 --- a/src/test/ui/lint/unused_parens_json_suggestion.stderr +++ b/src/test/ui/lint/unused_parens_json_suggestion.stderr @@ -1 +1 @@ -{"message":"unnecessary parentheses around assigned value","code":null,"level":"warning","spans":[{"file_name":"$DIR/unused_parens_json_suggestion.rs","byte_start":976,"byte_end":989,"line_start":22,"line_end":22,"column_start":14,"column_end":27,"is_primary":true,"text":[{"text":" let _a = (1 / (2 + 3));","highlight_start":14,"highlight_end":27}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[{"message":"#[warn(unused_parens)] on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"remove these parentheses","code":null,"level":"help","spans":[{"file_name":"$DIR/unused_parens_json_suggestion.rs","byte_start":976,"byte_end":989,"line_start":22,"line_end":22,"column_start":14,"column_end":27,"is_primary":true,"text":[{"text":" let _a = (1 / (2 + 3));","highlight_start":14,"highlight_end":27}],"label":null,"suggested_replacement":"1 / (2 + 3)","expansion":null}],"children":[],"rendered":null}],"rendered":null} +{"message":"unnecessary parentheses around assigned value","code":null,"level":"warning","spans":[{"file_name":"$DIR/unused_parens_json_suggestion.rs","byte_start":1001,"byte_end":1014,"line_start":24,"line_end":24,"column_start":14,"column_end":27,"is_primary":true,"text":[{"text":" let _a = (1 / (2 + 3));","highlight_start":14,"highlight_end":27}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[{"message":"lint level defined here","code":null,"level":"note","spans":[{"file_name":"$DIR/unused_parens_json_suggestion.rs","byte_start":847,"byte_end":860,"line_start":19,"line_end":19,"column_start":9,"column_end":22,"is_primary":true,"text":[{"text":"#![warn(unused_parens)]","highlight_start":9,"highlight_end":22}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[],"rendered":null},{"message":"remove these parentheses","code":null,"level":"help","spans":[{"file_name":"$DIR/unused_parens_json_suggestion.rs","byte_start":1001,"byte_end":1014,"line_start":24,"line_end":24,"column_start":14,"column_end":27,"is_primary":true,"text":[{"text":" let _a = (1 / (2 + 3));","highlight_start":14,"highlight_end":27}],"label":null,"suggested_replacement":"1 / (2 + 3)","expansion":null}],"children":[],"rendered":null}],"rendered":null} |
