Add several lints into unused lint group

Remove a couple of obsolete lints
This commit is contained in:
Vadim Petrochenkov 2017-10-21 00:00:57 +03:00
parent 690ff04594
commit bf0cdb52f2
22 changed files with 53 additions and 55 deletions

View file

@ -12,6 +12,7 @@
#![feature(plugin_registrar, rustc_private)]
#![feature(box_syntax)]
#![feature(macro_vis_matcher)]
#[macro_use] extern crate rustc;
extern crate rustc_plugin;

View file

@ -12,6 +12,7 @@
#![feature(plugin_registrar)]
#![feature(box_syntax, rustc_private)]
#![feature(macro_vis_matcher)]
// Load rustc as a plugin to get macros
#[macro_use]

View file

@ -12,6 +12,7 @@
#![feature(plugin_registrar)]
#![feature(box_syntax, rustc_private)]
#![feature(macro_vis_matcher)]
extern crate syntax;

View file

@ -82,7 +82,7 @@ const VALS_I64: (i64, i64, i64, i64) =
);
const VALS_U8: (u8, u8, u8, u8) =
( //~ WARN constant evaluation error: attempt to subtract with overflow.
( //~ WARN constant evaluation error: attempt to subtract with overflow
-(u8::MIN as i8) as u8,
u8::MIN - 1,
//~^ ERROR constant evaluation error
@ -96,7 +96,7 @@ const VALS_U8: (u8, u8, u8, u8) =
);
const VALS_U16: (u16, u16, u16, u16) =
( //~ WARN constant evaluation error: attempt to subtract with overflow.
( //~ WARN constant evaluation error: attempt to subtract with overflow
-(u16::MIN as i16) as u16,
u16::MIN - 1,
//~^ ERROR constant evaluation error
@ -110,7 +110,7 @@ const VALS_U16: (u16, u16, u16, u16) =
);
const VALS_U32: (u32, u32, u32, u32) =
( //~ WARN constant evaluation error: attempt to subtract with overflow.
( //~ WARN constant evaluation error: attempt to subtract with overflow
-(u32::MIN as i32) as u32,
u32::MIN - 1,
//~^ ERROR constant evaluation error
@ -124,7 +124,7 @@ const VALS_U32: (u32, u32, u32, u32) =
);
const VALS_U64: (u64, u64, u64, u64) =
( //~ WARN constant evaluation error: attempt to subtract with overflow.
( //~ WARN constant evaluation error: attempt to subtract with overflow
-(u64::MIN as i64) as u64,
u64::MIN - 1,
//~^ ERROR constant evaluation error

View file

@ -12,6 +12,7 @@
#![feature(plugin_registrar, rustc_private)]
#![feature(box_syntax)]
#![feature(macro_vis_matcher)]
#[macro_use] extern crate rustc;
extern crate rustc_plugin;

View file

@ -8,6 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(box_syntax, plugin, plugin_registrar, rustc_private)]
#![feature(macro_vis_matcher)]
#![crate_type = "dylib"]
#[macro_use]

View file

@ -12,6 +12,7 @@
#![feature(plugin_registrar)]
#![feature(box_syntax, rustc_private)]
#![feature(macro_vis_matcher)]
// Load rustc as a plugin to get macros
#[macro_use]

View file

@ -12,6 +12,7 @@
#![feature(plugin_registrar)]
#![feature(box_syntax, rustc_private)]
#![feature(macro_vis_matcher)]
extern crate syntax;

View file

@ -1,4 +1,4 @@
warning: constant evaluation error: attempt to subtract with overflow. This will become a HARD ERROR in the future
warning: constant evaluation error: attempt to subtract with overflow
--> $DIR/issue-43197.rs:18:20
|
18 | const X: u32 = 0-1;
@ -6,7 +6,7 @@ warning: constant evaluation error: attempt to subtract with overflow. This will
|
= note: #[warn(const_err)] on by default
warning: constant evaluation error: attempt to subtract with overflow. This will become a HARD ERROR in the future
warning: constant evaluation error: attempt to subtract with overflow
--> $DIR/issue-43197.rs:19:20
|
19 | const Y: u32 = foo(0-1);

View file

@ -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`

View file

@ -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

View file

@ -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`

View file

@ -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}

View file

@ -4,7 +4,12 @@ warning: unnecessary parentheses around `return` value
18 | return (<T as ToString>::to_string(&arg)); //~WARN unnecessary parentheses around `return` value
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove these parentheses
|
= note: #[warn(unused_parens)] on by default
note: lint level defined here
--> $DIR/path-lookahead.rs:13:9
|
13 | #![warn(unused)]
| ^^^^^^
= note: #[warn(unused_parens)] implied by #[warn(unused)]
warning: function is never used: `with_parens`
--> $DIR/path-lookahead.rs:17:1