rust/tests/ui/string_lit_chars_any.stderr

59 lines
2.8 KiB
Plaintext
Raw Normal View History

2023-06-30 14:39:17 -05:00
error: usage of `.chars().any(...)` to check if a char matches any from a string literal
2023-07-27 06:40:22 -05:00
--> $DIR/string_lit_chars_any.rs:18:5
2023-06-30 14:39:17 -05:00
|
LL | "\\.+*?()|[]{}^$#&-~".chars().any(|x| x == c);
2023-06-30 14:39:17 -05:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::string-lit-chars-any` implied by `-D warnings`
help: use `matches!(...)` instead
|
LL | matches!(c, '\\' | '.' | '+' | '*' | '?' | '(' | ')' | '|' | '[' | ']' | '{' | '}' | '^' | '$' | '#' | '&' | '-' | '~');
2023-06-30 14:39:17 -05:00
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: usage of `.chars().any(...)` to check if a char matches any from a string literal
2023-07-27 06:40:22 -05:00
--> $DIR/string_lit_chars_any.rs:19:5
2023-06-30 14:39:17 -05:00
|
LL | r#"\.+*?()|[]{}^$#&-~"#.chars().any(|x| x == c);
2023-06-30 14:39:17 -05:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: use `matches!(...)` instead
|
LL | matches!(c, '\\' | '.' | '+' | '*' | '?' | '(' | ')' | '|' | '[' | ']' | '{' | '}' | '^' | '$' | '#' | '&' | '-' | '~');
2023-06-30 14:39:17 -05:00
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: usage of `.chars().any(...)` to check if a char matches any from a string literal
2023-07-27 06:40:22 -05:00
--> $DIR/string_lit_chars_any.rs:20:5
2023-06-30 14:39:17 -05:00
|
LL | "\\.+*?()|[]{}^$#&-~".chars().any(|x| c == x);
2023-06-30 14:39:17 -05:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: use `matches!(...)` instead
|
LL | matches!(c, '\\' | '.' | '+' | '*' | '?' | '(' | ')' | '|' | '[' | ']' | '{' | '}' | '^' | '$' | '#' | '&' | '-' | '~');
2023-06-30 14:39:17 -05:00
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: usage of `.chars().any(...)` to check if a char matches any from a string literal
2023-07-27 06:40:22 -05:00
--> $DIR/string_lit_chars_any.rs:21:5
2023-06-30 14:39:17 -05:00
|
LL | r#"\.+*?()|[]{}^$#&-~"#.chars().any(|x| c == x);
2023-06-30 14:39:17 -05:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: use `matches!(...)` instead
|
LL | matches!(c, '\\' | '.' | '+' | '*' | '?' | '(' | ')' | '|' | '[' | ']' | '{' | '}' | '^' | '$' | '#' | '&' | '-' | '~');
2023-06-30 14:39:17 -05:00
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: usage of `.chars().any(...)` to check if a char matches any from a string literal
2023-07-27 06:40:22 -05:00
--> $DIR/string_lit_chars_any.rs:23:5
2023-06-30 14:39:17 -05:00
|
LL | "\\.+*?()|[]{}^$#&-~".chars().any(|x| { x == c });
2023-06-30 14:39:17 -05:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: use `matches!(...)` instead
|
LL | matches!(c, '\\' | '.' | '+' | '*' | '?' | '(' | ')' | '|' | '[' | ']' | '{' | '}' | '^' | '$' | '#' | '&' | '-' | '~');
2023-06-30 14:39:17 -05:00
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 5 previous errors