diff options
| author | xFrednet <xFrednet@gmail.com> | 2021-04-01 18:30:47 +0200 |
|---|---|---|
| committer | xFrednet <xFrednet@gmail.com> | 2021-04-05 13:35:51 +0200 |
| commit | a6f54f5dfdfdf0017ffecfbcd6f43352b8b71ca1 (patch) | |
| tree | 2ddb446dad2a9f74f64844a0de370fbe1f7563be /tests | |
| parent | 7c9e192e055f8b8a8a5f8b177c415440bc2333ce (diff) | |
| download | rust-a6f54f5dfdfdf0017ffecfbcd6f43352b8b71ca1.tar.gz rust-a6f54f5dfdfdf0017ffecfbcd6f43352b8b71ca1.zip | |
Renaming the lint to branches_sharing_code and fixing typos
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/branches_sharing_code/shared_at_bottom.rs (renamed from tests/ui/shared_code_in_if_blocks/shared_at_bot.rs) | 4 | ||||
| -rw-r--r-- | tests/ui/branches_sharing_code/shared_at_bottom.stderr (renamed from tests/ui/shared_code_in_if_blocks/shared_at_bot.stderr) | 24 | ||||
| -rw-r--r-- | tests/ui/branches_sharing_code/shared_at_top.rs (renamed from tests/ui/shared_code_in_if_blocks/shared_at_top.rs) | 4 | ||||
| -rw-r--r-- | tests/ui/branches_sharing_code/shared_at_top.stderr (renamed from tests/ui/shared_code_in_if_blocks/shared_at_top.stderr) | 6 | ||||
| -rw-r--r-- | tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs (renamed from tests/ui/shared_code_in_if_blocks/shared_at_top_and_bot.rs) | 4 | ||||
| -rw-r--r-- | tests/ui/branches_sharing_code/shared_at_top_and_bottom.stderr (renamed from tests/ui/shared_code_in_if_blocks/shared_at_top_and_bot.stderr) | 26 | ||||
| -rw-r--r-- | tests/ui/branches_sharing_code/valid_if_blocks.rs (renamed from tests/ui/shared_code_in_if_blocks/valid_if_blocks.rs) | 6 | ||||
| -rw-r--r-- | tests/ui/branches_sharing_code/valid_if_blocks.stderr (renamed from tests/ui/shared_code_in_if_blocks/valid_if_blocks.stderr) | 2 | ||||
| -rw-r--r-- | tests/ui/checked_unwrap/complex_conditionals.rs | 2 | ||||
| -rw-r--r-- | tests/ui/checked_unwrap/complex_conditionals_nested.rs | 2 | ||||
| -rw-r--r-- | tests/ui/checked_unwrap/simple_conditionals.rs | 2 | ||||
| -rw-r--r-- | tests/ui/default_numeric_fallback.rs | 2 | ||||
| -rw-r--r-- | tests/ui/if_same_then_else.rs | 2 | ||||
| -rw-r--r-- | tests/ui/if_same_then_else2.rs | 2 | ||||
| -rw-r--r-- | tests/ui/let_if_seq.rs | 2 | ||||
| -rw-r--r-- | tests/ui/needless_bool/simple.rs | 2 | ||||
| -rw-r--r-- | tests/ui/needless_return.fixed | 2 | ||||
| -rw-r--r-- | tests/ui/needless_return.rs | 2 |
18 files changed, 48 insertions, 48 deletions
diff --git a/tests/ui/shared_code_in_if_blocks/shared_at_bot.rs b/tests/ui/branches_sharing_code/shared_at_bottom.rs index 6ff362cb752..c389c243d44 100644 --- a/tests/ui/shared_code_in_if_blocks/shared_at_bot.rs +++ b/tests/ui/branches_sharing_code/shared_at_bottom.rs @@ -1,7 +1,7 @@ #![allow(dead_code)] -#![deny(clippy::if_same_then_else, clippy::shared_code_in_if_blocks)] +#![deny(clippy::if_same_then_else, clippy::branches_sharing_code)] -// This tests the shared_code_in_if_blocks lint at the end of blocks +// This tests the branches_sharing_code lint at the end of blocks fn simple_examples() { let x = 1; diff --git a/tests/ui/shared_code_in_if_blocks/shared_at_bot.stderr b/tests/ui/branches_sharing_code/shared_at_bottom.stderr index 2268d8f5365..271fcd8b6c1 100644 --- a/tests/ui/shared_code_in_if_blocks/shared_at_bot.stderr +++ b/tests/ui/branches_sharing_code/shared_at_bottom.stderr @@ -1,5 +1,5 @@ error: all if blocks contain the same code at the end - --> $DIR/shared_at_bot.rs:30:5 + --> $DIR/shared_at_bottom.rs:30:5 | LL | / let result = false; LL | | println!("Block end!"); @@ -8,10 +8,10 @@ LL | | }; | |_____^ | note: the lint level is defined here - --> $DIR/shared_at_bot.rs:2:36 + --> $DIR/shared_at_bottom.rs:2:36 | -LL | #![deny(clippy::if_same_then_else, clippy::shared_code_in_if_blocks)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #![deny(clippy::if_same_then_else, clippy::branches_sharing_code)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: The end suggestion probably needs some adjustments to use the expression result correctly help: consider moving the end statements out like this | @@ -22,7 +22,7 @@ LL | result; | error: all if blocks contain the same code at the end - --> $DIR/shared_at_bot.rs:48:5 + --> $DIR/shared_at_bottom.rs:48:5 | LL | / println!("Same end of block"); LL | | } @@ -35,7 +35,7 @@ LL | println!("Same end of block"); | error: all if blocks contain the same code at the end - --> $DIR/shared_at_bot.rs:65:5 + --> $DIR/shared_at_bottom.rs:65:5 | LL | / println!( LL | | "I'm moveable because I know: `outer_scope_value`: '{}'", @@ -54,7 +54,7 @@ LL | ); | error: all if blocks contain the same code at the end - --> $DIR/shared_at_bot.rs:77:9 + --> $DIR/shared_at_bottom.rs:77:9 | LL | / println!("Hello World"); LL | | } @@ -67,7 +67,7 @@ LL | println!("Hello World"); | error: all if blocks contain the same code at the end - --> $DIR/shared_at_bot.rs:93:5 + --> $DIR/shared_at_bottom.rs:93:5 | LL | / let later_used_value = "A string value"; LL | | println!("{}", later_used_value); @@ -84,7 +84,7 @@ LL | println!("{}", later_used_value); | error: all if blocks contain the same code at the end - --> $DIR/shared_at_bot.rs:106:5 + --> $DIR/shared_at_bottom.rs:106:5 | LL | / let simple_examples = "I now identify as a &str :)"; LL | | println!("This is the new simple_example: {}", simple_examples); @@ -100,7 +100,7 @@ LL | println!("This is the new simple_example: {}", simple_examples); | error: all if blocks contain the same code at the end - --> $DIR/shared_at_bot.rs:171:5 + --> $DIR/shared_at_bottom.rs:171:5 | LL | / x << 2 LL | | }; @@ -114,7 +114,7 @@ LL | x << 2; | error: all if blocks contain the same code at the end - --> $DIR/shared_at_bot.rs:178:5 + --> $DIR/shared_at_bottom.rs:178:5 | LL | / x * 4 LL | | } @@ -128,7 +128,7 @@ LL | x * 4 | error: all if blocks contain the same code at the end - --> $DIR/shared_at_bot.rs:190:44 + --> $DIR/shared_at_bottom.rs:190:44 | LL | if x == 17 { b = 1; a = 0x99; } else { a = 0x99; } | ^^^^^^^^^^^ diff --git a/tests/ui/shared_code_in_if_blocks/shared_at_top.rs b/tests/ui/branches_sharing_code/shared_at_top.rs index 496939f2a5e..e65bcfd7873 100644 --- a/tests/ui/shared_code_in_if_blocks/shared_at_top.rs +++ b/tests/ui/branches_sharing_code/shared_at_top.rs @@ -1,7 +1,7 @@ #![allow(dead_code, clippy::eval_order_dependence)] -#![deny(clippy::if_same_then_else, clippy::shared_code_in_if_blocks)] +#![deny(clippy::if_same_then_else, clippy::branches_sharing_code)] -// This tests the shared_code_in_if_blocks lint at the start of blocks +// This tests the branches_sharing_code lint at the start of blocks fn simple_examples() { let x = 0; diff --git a/tests/ui/shared_code_in_if_blocks/shared_at_top.stderr b/tests/ui/branches_sharing_code/shared_at_top.stderr index 76898a6ff02..15867e9ea02 100644 --- a/tests/ui/shared_code_in_if_blocks/shared_at_top.stderr +++ b/tests/ui/branches_sharing_code/shared_at_top.stderr @@ -8,8 +8,8 @@ LL | | println!("Hello World!"); note: the lint level is defined here --> $DIR/shared_at_top.rs:2:36 | -LL | #![deny(clippy::if_same_then_else, clippy::shared_code_in_if_blocks)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #![deny(clippy::if_same_then_else, clippy::branches_sharing_code)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider moving the start statements out like this | LL | println!("Hello World!"); @@ -106,7 +106,7 @@ LL | | } else { note: the lint level is defined here --> $DIR/shared_at_top.rs:2:9 | -LL | #![deny(clippy::if_same_then_else, clippy::shared_code_in_if_blocks)] +LL | #![deny(clippy::if_same_then_else, clippy::branches_sharing_code)] | ^^^^^^^^^^^^^^^^^^^^^^^^^ note: same as this --> $DIR/shared_at_top.rs:98:12 diff --git a/tests/ui/shared_code_in_if_blocks/shared_at_top_and_bot.rs b/tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs index 46a8f931aaf..deefdad32c9 100644 --- a/tests/ui/shared_code_in_if_blocks/shared_at_top_and_bot.rs +++ b/tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs @@ -1,7 +1,7 @@ #![allow(dead_code)] -#![deny(clippy::if_same_then_else, clippy::shared_code_in_if_blocks)] +#![deny(clippy::if_same_then_else, clippy::branches_sharing_code)] -// shared_code_in_if_blocks at the top and bottom of the if blocks +// branches_sharing_code at the top and bottom of the if blocks struct DataPack { id: u32, diff --git a/tests/ui/shared_code_in_if_blocks/shared_at_top_and_bot.stderr b/tests/ui/branches_sharing_code/shared_at_top_and_bottom.stderr index 75c3d397f2e..212cfb2f1d1 100644 --- a/tests/ui/shared_code_in_if_blocks/shared_at_top_and_bot.stderr +++ b/tests/ui/branches_sharing_code/shared_at_top_and_bottom.stderr @@ -1,5 +1,5 @@ error: all if blocks contain the same code at the start and the end. Here at the start - --> $DIR/shared_at_top_and_bot.rs:16:5 + --> $DIR/shared_at_top_and_bottom.rs:16:5 | LL | / if x == 7 { LL | | let t = 7; @@ -8,12 +8,12 @@ LL | | let _overlap_end = 2 * t; | |_________________________________^ | note: the lint level is defined here - --> $DIR/shared_at_top_and_bot.rs:2:36 + --> $DIR/shared_at_top_and_bottom.rs:2:36 | -LL | #![deny(clippy::if_same_then_else, clippy::shared_code_in_if_blocks)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #![deny(clippy::if_same_then_else, clippy::branches_sharing_code)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: and here at the end - --> $DIR/shared_at_top_and_bot.rs:28:5 + --> $DIR/shared_at_top_and_bottom.rs:28:5 | LL | / let _u = 9; LL | | } @@ -32,7 +32,7 @@ LL | let _u = 9; | error: all if blocks contain the same code at the start and the end. Here at the start - --> $DIR/shared_at_top_and_bot.rs:32:5 + --> $DIR/shared_at_top_and_bottom.rs:32:5 | LL | / if x == 99 { LL | | let r = 7; @@ -41,7 +41,7 @@ LL | | let _overlap_middle = r * r; | |____________________________________^ | note: and here at the end - --> $DIR/shared_at_top_and_bot.rs:43:5 + --> $DIR/shared_at_top_and_bottom.rs:43:5 | LL | / let _overlap_end = r * r * r; LL | | let z = "end"; @@ -63,7 +63,7 @@ LL | let z = "end"; | error: all if blocks contain the same code at the start and the end. Here at the start - --> $DIR/shared_at_top_and_bot.rs:61:5 + --> $DIR/shared_at_top_and_bottom.rs:61:5 | LL | / if (x > 7 && y < 13) || (x + y) % 2 == 1 { LL | | let a = 0xcafe; @@ -72,7 +72,7 @@ LL | | let e_id = gen_id(a, b); | |________________________________^ | note: and here at the end - --> $DIR/shared_at_top_and_bot.rs:81:5 + --> $DIR/shared_at_top_and_bottom.rs:81:5 | LL | / let pack = DataPack { LL | | id: e_id, @@ -101,14 +101,14 @@ LL | }; ... error: all if blocks contain the same code at the start and the end. Here at the start - --> $DIR/shared_at_top_and_bot.rs:94:5 + --> $DIR/shared_at_top_and_bottom.rs:94:5 | LL | / let _ = if x == 7 { LL | | let _ = 19; | |___________________^ | note: and here at the end - --> $DIR/shared_at_top_and_bot.rs:103:5 + --> $DIR/shared_at_top_and_bottom.rs:103:5 | LL | / x << 2 LL | | }; @@ -126,14 +126,14 @@ LL | x << 2; | error: all if blocks contain the same code at the start and the end. Here at the start - --> $DIR/shared_at_top_and_bot.rs:106:5 + --> $DIR/shared_at_top_and_bottom.rs:106:5 | LL | / if x == 9 { LL | | let _ = 17; | |___________________^ | note: and here at the end - --> $DIR/shared_at_top_and_bot.rs:115:5 + --> $DIR/shared_at_top_and_bottom.rs:115:5 | LL | / x * 4 LL | | } diff --git a/tests/ui/shared_code_in_if_blocks/valid_if_blocks.rs b/tests/ui/branches_sharing_code/valid_if_blocks.rs index e63490d5b07..0c70e3748ec 100644 --- a/tests/ui/shared_code_in_if_blocks/valid_if_blocks.rs +++ b/tests/ui/branches_sharing_code/valid_if_blocks.rs @@ -1,9 +1,9 @@ #![allow(dead_code, clippy::eval_order_dependence)] -#![deny(clippy::if_same_then_else, clippy::shared_code_in_if_blocks)] +#![deny(clippy::if_same_then_else, clippy::branches_sharing_code)] -// This tests the shared_code_in_if_blocks lint at the start of blocks +// This tests valid if blocks that shouldn't trigger the lint -// Tests with value references are includes in "shared_code_at_bot.rs" +// Tests with value references are includes in "shared_code_at_bottom.rs" fn valid_examples() { let x = 2; diff --git a/tests/ui/shared_code_in_if_blocks/valid_if_blocks.stderr b/tests/ui/branches_sharing_code/valid_if_blocks.stderr index 846581456dc..a815995e717 100644 --- a/tests/ui/shared_code_in_if_blocks/valid_if_blocks.stderr +++ b/tests/ui/branches_sharing_code/valid_if_blocks.stderr @@ -9,7 +9,7 @@ LL | | } else { note: the lint level is defined here --> $DIR/valid_if_blocks.rs:2:9 | -LL | #![deny(clippy::if_same_then_else, clippy::shared_code_in_if_blocks)] +LL | #![deny(clippy::if_same_then_else, clippy::branches_sharing_code)] | ^^^^^^^^^^^^^^^^^^^^^^^^^ note: same as this --> $DIR/valid_if_blocks.rs:105:12 diff --git a/tests/ui/checked_unwrap/complex_conditionals.rs b/tests/ui/checked_unwrap/complex_conditionals.rs index bb5b6f5ec04..ec082c73b44 100644 --- a/tests/ui/checked_unwrap/complex_conditionals.rs +++ b/tests/ui/checked_unwrap/complex_conditionals.rs @@ -1,5 +1,5 @@ #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)] -#![allow(clippy::if_same_then_else, clippy::shared_code_in_if_blocks)] +#![allow(clippy::if_same_then_else, clippy::branches_sharing_code)] fn test_complex_conditions() { let x: Result<(), ()> = Ok(()); diff --git a/tests/ui/checked_unwrap/complex_conditionals_nested.rs b/tests/ui/checked_unwrap/complex_conditionals_nested.rs index 99e8fb95466..043ea4148dc 100644 --- a/tests/ui/checked_unwrap/complex_conditionals_nested.rs +++ b/tests/ui/checked_unwrap/complex_conditionals_nested.rs @@ -1,5 +1,5 @@ #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)] -#![allow(clippy::if_same_then_else, clippy::shared_code_in_if_blocks)] +#![allow(clippy::if_same_then_else, clippy::branches_sharing_code)] fn test_nested() { fn nested() { diff --git a/tests/ui/checked_unwrap/simple_conditionals.rs b/tests/ui/checked_unwrap/simple_conditionals.rs index 0459100d88a..8f23fb28827 100644 --- a/tests/ui/checked_unwrap/simple_conditionals.rs +++ b/tests/ui/checked_unwrap/simple_conditionals.rs @@ -1,5 +1,5 @@ #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)] -#![allow(clippy::if_same_then_else, clippy::shared_code_in_if_blocks)] +#![allow(clippy::if_same_then_else, clippy::branches_sharing_code)] macro_rules! m { ($a:expr) => { diff --git a/tests/ui/default_numeric_fallback.rs b/tests/ui/default_numeric_fallback.rs index de89f806c58..43468872db0 100644 --- a/tests/ui/default_numeric_fallback.rs +++ b/tests/ui/default_numeric_fallback.rs @@ -3,7 +3,7 @@ #![allow(clippy::never_loop)] #![allow(clippy::no_effect)] #![allow(clippy::unnecessary_operation)] -#![allow(clippy::shared_code_in_if_blocks)] +#![allow(clippy::branches_sharing_code)] mod basic_expr { fn test() { diff --git a/tests/ui/if_same_then_else.rs b/tests/ui/if_same_then_else.rs index 35a2e139c11..ef956745500 100644 --- a/tests/ui/if_same_then_else.rs +++ b/tests/ui/if_same_then_else.rs @@ -6,7 +6,7 @@ clippy::no_effect, clippy::unused_unit, clippy::zero_divided_by_zero, - clippy::shared_code_in_if_blocks + clippy::branches_sharing_code )] struct Foo { diff --git a/tests/ui/if_same_then_else2.rs b/tests/ui/if_same_then_else2.rs index 8164b125570..e4dc5b647df 100644 --- a/tests/ui/if_same_then_else2.rs +++ b/tests/ui/if_same_then_else2.rs @@ -6,7 +6,7 @@ clippy::ifs_same_cond, clippy::needless_return, clippy::single_element_loop, - clippy::shared_code_in_if_blocks + clippy::branches_sharing_code )] fn if_same_then_else2() -> Result<&'static str, ()> { diff --git a/tests/ui/let_if_seq.rs b/tests/ui/let_if_seq.rs index 9fd3f875a5f..2d8f3c2f0e7 100644 --- a/tests/ui/let_if_seq.rs +++ b/tests/ui/let_if_seq.rs @@ -3,7 +3,7 @@ unused_assignments, clippy::similar_names, clippy::blacklisted_name, - clippy::shared_code_in_if_blocks + clippy::branches_sharing_code )] #![warn(clippy::useless_let_if_seq)] diff --git a/tests/ui/needless_bool/simple.rs b/tests/ui/needless_bool/simple.rs index 678040fa98b..588bb88f446 100644 --- a/tests/ui/needless_bool/simple.rs +++ b/tests/ui/needless_bool/simple.rs @@ -5,7 +5,7 @@ clippy::no_effect, clippy::if_same_then_else, clippy::needless_return, - clippy::shared_code_in_if_blocks + clippy::branches_sharing_code )] fn main() { diff --git a/tests/ui/needless_return.fixed b/tests/ui/needless_return.fixed index ebf74cfef12..82d95cc041f 100644 --- a/tests/ui/needless_return.fixed +++ b/tests/ui/needless_return.fixed @@ -4,7 +4,7 @@ #![allow( clippy::if_same_then_else, clippy::single_match, - clippy::shared_code_in_if_blocks, + clippy::branches_sharing_code, clippy::needless_bool )] #![warn(clippy::needless_return)] diff --git a/tests/ui/needless_return.rs b/tests/ui/needless_return.rs index 2bebccdabca..8a471f802e1 100644 --- a/tests/ui/needless_return.rs +++ b/tests/ui/needless_return.rs @@ -4,7 +4,7 @@ #![allow( clippy::if_same_then_else, clippy::single_match, - clippy::shared_code_in_if_blocks, + clippy::branches_sharing_code, clippy::needless_bool )] #![warn(clippy::needless_return)] |
