Files
rust/tests/ui/branches_sharing_code/shared_at_bottom.stderr
T
Yuri Astrakhan eb3970285b fallout: fix tests to allow uninlined_format_args
In order to switch `clippy::uninlined_format_args` from pedantic to
style, all existing tests must not raise a warning. I did not want to
change the actual tests, so this is a relatively minor change that:

* add `#![allow(clippy::uninlined_format_args)]` where needed
* normalizes all allow/deny/warn attributes
   * all allow attributes are grouped together
   * sorted alphabetically
   * the `clippy::*` attributes are listed separate from the other ones.
   * deny and warn attributes are listed before the allowed ones

changelog: none
2022-10-02 15:13:22 -04:00

144 lines
3.8 KiB
Plaintext

error: all if blocks contain the same code at the end
--> $DIR/shared_at_bottom.rs:31:5
|
LL | / let result = false;
LL | | println!("Block end!");
LL | | result
LL | | };
| |_____^
|
note: the lint level is defined here
--> $DIR/shared_at_bottom.rs:1:36
|
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 these statements after the if
|
LL ~ }
LL + let result = false;
LL + println!("Block end!");
LL ~ result;
|
error: all if blocks contain the same code at the end
--> $DIR/shared_at_bottom.rs:49:5
|
LL | / println!("Same end of block");
LL | | }
| |_____^
|
help: consider moving these statements after the if
|
LL ~ }
LL + println!("Same end of block");
|
error: all if blocks contain the same code at the end
--> $DIR/shared_at_bottom.rs:66:5
|
LL | / println!(
LL | | "I'm moveable because I know: `outer_scope_value`: '{}'",
LL | | outer_scope_value
LL | | );
LL | | }
| |_____^
|
help: consider moving these statements after the if
|
LL ~ }
LL + println!(
LL + "I'm moveable because I know: `outer_scope_value`: '{}'",
LL + outer_scope_value
LL + );
|
error: all if blocks contain the same code at the end
--> $DIR/shared_at_bottom.rs:78:9
|
LL | / println!("Hello World");
LL | | }
| |_________^
|
help: consider moving these statements after the if
|
LL ~ }
LL + println!("Hello World");
|
error: all if blocks contain the same code at the end
--> $DIR/shared_at_bottom.rs:94:5
|
LL | / let later_used_value = "A string value";
LL | | println!("{}", later_used_value);
LL | | // I'm expecting a note about this
LL | | }
| |_____^
|
= warning: some moved values might need to be renamed to avoid wrong references
help: consider moving these statements after the if
|
LL ~ }
LL + let later_used_value = "A string value";
LL + println!("{}", later_used_value);
|
error: all if blocks contain the same code at the end
--> $DIR/shared_at_bottom.rs:107:5
|
LL | / let simple_examples = "I now identify as a &str :)";
LL | | println!("This is the new simple_example: {}", simple_examples);
LL | | }
| |_____^
|
= warning: some moved values might need to be renamed to avoid wrong references
help: consider moving these statements after the if
|
LL ~ }
LL + let simple_examples = "I now identify as a &str :)";
LL + println!("This is the new simple_example: {}", simple_examples);
|
error: all if blocks contain the same code at the end
--> $DIR/shared_at_bottom.rs:172:5
|
LL | / x << 2
LL | | };
| |_____^
|
= note: the end suggestion probably needs some adjustments to use the expression result correctly
help: consider moving these statements after the if
|
LL ~ }
LL ~ x << 2;
|
error: all if blocks contain the same code at the end
--> $DIR/shared_at_bottom.rs:179:5
|
LL | / x * 4
LL | | }
| |_____^
|
= note: the end suggestion probably needs some adjustments to use the expression result correctly
help: consider moving these statements after the if
|
LL ~ }
LL + x * 4
|
error: all if blocks contain the same code at the end
--> $DIR/shared_at_bottom.rs:191:44
|
LL | if x == 17 { b = 1; a = 0x99; } else { a = 0x99; }
| ^^^^^^^^^^^
|
help: consider moving these statements after the if
|
LL ~ if x == 17 { b = 1; a = 0x99; } else { }
LL + a = 0x99;
|
error: aborting due to 9 previous errors