rust-clippy/tests/ui/regex.stderr

172 lines
4.8 KiB
Text
Raw Normal View History

2018-03-13 14:02:40 +00:00
error: trivial regex
2018-10-06 16:18:06 +00:00
--> $DIR/regex.rs:26:45
2017-08-01 15:54:21 +00:00
|
2018-10-06 16:18:06 +00:00
26 | let pipe_in_wrong_position = Regex::new("|");
2017-08-01 15:54:21 +00:00
| ^^^
|
= note: `-D clippy::trivial-regex` implied by `-D warnings`
2018-03-13 14:02:40 +00:00
= help: the regex is unlikely to be useful as it is
2017-08-01 15:54:21 +00:00
2018-03-13 14:02:40 +00:00
error: trivial regex
2018-10-06 16:18:06 +00:00
--> $DIR/regex.rs:27:60
2017-08-01 15:54:21 +00:00
|
2018-10-06 16:18:06 +00:00
27 | let pipe_in_wrong_position_builder = RegexBuilder::new("|");
2017-08-01 15:54:21 +00:00
| ^^^
2018-03-13 14:02:40 +00:00
|
= help: the regex is unlikely to be useful as it is
2017-08-01 15:54:21 +00:00
2018-03-13 14:02:40 +00:00
error: regex syntax error: invalid character class range, the start must be <= the end
2018-10-06 16:18:06 +00:00
--> $DIR/regex.rs:28:42
2017-08-01 15:54:21 +00:00
|
2018-10-06 16:18:06 +00:00
28 | let wrong_char_ranice = Regex::new("[z-a]");
2018-03-13 14:02:40 +00:00
| ^^^
|
= note: `-D clippy::invalid-regex` implied by `-D warnings`
2017-08-01 15:54:21 +00:00
2018-03-13 14:02:40 +00:00
error: regex syntax error: invalid character class range, the start must be <= the end
2018-10-06 16:18:06 +00:00
--> $DIR/regex.rs:29:37
2017-08-01 15:54:21 +00:00
|
2018-10-06 16:18:06 +00:00
29 | let some_unicode = Regex::new("[é-è]");
2018-03-13 14:02:40 +00:00
| ^^^
2017-08-01 15:54:21 +00:00
2018-03-13 14:02:40 +00:00
error: regex syntax error on position 0: unclosed group
2018-10-06 16:18:06 +00:00
--> $DIR/regex.rs:31:33
2017-08-01 15:54:21 +00:00
|
2018-10-06 16:18:06 +00:00
31 | let some_regex = Regex::new(OPENING_PAREN);
2017-08-01 15:54:21 +00:00
| ^^^^^^^^^^^^^
2018-03-13 14:02:40 +00:00
error: trivial regex
2018-10-06 16:18:06 +00:00
--> $DIR/regex.rs:33:53
2017-08-01 15:54:21 +00:00
|
2018-10-06 16:18:06 +00:00
33 | let binary_pipe_in_wrong_position = BRegex::new("|");
2017-08-01 15:54:21 +00:00
| ^^^
2018-03-13 14:02:40 +00:00
|
= help: the regex is unlikely to be useful as it is
2017-08-01 15:54:21 +00:00
2018-03-13 14:02:40 +00:00
error: regex syntax error on position 0: unclosed group
2018-10-06 16:18:06 +00:00
--> $DIR/regex.rs:34:41
2017-08-01 15:54:21 +00:00
|
2018-10-06 16:18:06 +00:00
34 | let some_binary_regex = BRegex::new(OPENING_PAREN);
2017-08-01 15:54:21 +00:00
| ^^^^^^^^^^^^^
2018-03-13 14:02:40 +00:00
error: regex syntax error on position 0: unclosed group
2018-10-06 16:18:06 +00:00
--> $DIR/regex.rs:35:56
2017-08-01 15:54:21 +00:00
|
2018-10-06 16:18:06 +00:00
35 | let some_binary_regex_builder = BRegexBuilder::new(OPENING_PAREN);
2017-08-01 15:54:21 +00:00
| ^^^^^^^^^^^^^
2018-03-13 14:02:40 +00:00
error: regex syntax error on position 0: unclosed group
2018-10-06 16:18:06 +00:00
--> $DIR/regex.rs:51:9
2017-08-01 15:54:21 +00:00
|
2018-10-06 16:18:06 +00:00
51 | OPENING_PAREN,
2017-08-01 15:54:21 +00:00
| ^^^^^^^^^^^^^
2018-03-13 14:02:40 +00:00
error: regex syntax error on position 0: unclosed group
2018-10-06 16:18:06 +00:00
--> $DIR/regex.rs:55:9
2017-08-01 15:54:21 +00:00
|
2018-10-06 16:18:06 +00:00
55 | OPENING_PAREN,
2017-08-01 15:54:21 +00:00
| ^^^^^^^^^^^^^
error: regex syntax error: unrecognized escape sequence
2018-10-06 16:18:06 +00:00
--> $DIR/regex.rs:59:45
|
2018-10-06 16:18:06 +00:00
59 | let raw_string_error = Regex::new(r"[...//...]");
2018-03-13 14:02:40 +00:00
| ^^
error: regex syntax error: unrecognized escape sequence
2018-10-06 16:18:06 +00:00
--> $DIR/regex.rs:60:46
|
2018-10-06 16:18:06 +00:00
60 | let raw_string_error = Regex::new(r#"[...//...]"#);
2018-03-13 14:02:40 +00:00
| ^^
2017-08-01 15:54:21 +00:00
error: trivial regex
2018-10-06 16:18:06 +00:00
--> $DIR/regex.rs:64:33
2017-08-01 15:54:21 +00:00
|
2018-10-06 16:18:06 +00:00
64 | let trivial_eq = Regex::new("^foobar$");
2017-08-01 15:54:21 +00:00
| ^^^^^^^^^^
|
2018-03-13 14:02:40 +00:00
= help: consider using `==` on `str`s
2017-08-01 15:54:21 +00:00
error: trivial regex
2018-10-06 16:18:06 +00:00
--> $DIR/regex.rs:66:48
2017-08-01 15:54:21 +00:00
|
2018-10-06 16:18:06 +00:00
66 | let trivial_eq_builder = RegexBuilder::new("^foobar$");
2017-08-01 15:54:21 +00:00
| ^^^^^^^^^^
|
2018-03-13 14:02:40 +00:00
= help: consider using `==` on `str`s
2017-08-01 15:54:21 +00:00
error: trivial regex
2018-10-06 16:18:06 +00:00
--> $DIR/regex.rs:68:42
2017-08-01 15:54:21 +00:00
|
2018-10-06 16:18:06 +00:00
68 | let trivial_starts_with = Regex::new("^foobar");
2017-08-01 15:54:21 +00:00
| ^^^^^^^^^
|
2018-03-13 14:02:40 +00:00
= help: consider using `str::starts_with`
2017-08-01 15:54:21 +00:00
error: trivial regex
2018-10-06 16:18:06 +00:00
--> $DIR/regex.rs:70:40
2017-08-01 15:54:21 +00:00
|
2018-10-06 16:18:06 +00:00
70 | let trivial_ends_with = Regex::new("foobar$");
2017-08-01 15:54:21 +00:00
| ^^^^^^^^^
|
2018-03-13 14:02:40 +00:00
= help: consider using `str::ends_with`
2017-08-01 15:54:21 +00:00
error: trivial regex
2018-10-06 16:18:06 +00:00
--> $DIR/regex.rs:72:39
2017-08-01 15:54:21 +00:00
|
2018-10-06 16:18:06 +00:00
72 | let trivial_contains = Regex::new("foobar");
2017-08-01 15:54:21 +00:00
| ^^^^^^^^
|
2018-03-13 14:02:40 +00:00
= help: consider using `str::contains`
2017-08-01 15:54:21 +00:00
error: trivial regex
2018-10-06 16:18:06 +00:00
--> $DIR/regex.rs:74:39
2017-08-01 15:54:21 +00:00
|
2018-10-06 16:18:06 +00:00
74 | let trivial_contains = Regex::new(NOT_A_REAL_REGEX);
2017-08-01 15:54:21 +00:00
| ^^^^^^^^^^^^^^^^
|
2018-03-13 14:02:40 +00:00
= help: consider using `str::contains`
2017-08-01 15:54:21 +00:00
error: trivial regex
2018-10-06 16:18:06 +00:00
--> $DIR/regex.rs:76:40
2017-08-01 15:54:21 +00:00
|
2018-10-06 16:18:06 +00:00
76 | let trivial_backslash = Regex::new("a/.b");
2017-08-01 15:54:21 +00:00
| ^^^^^^^
|
2018-03-13 14:02:40 +00:00
= help: consider using `str::contains`
2017-08-01 15:54:21 +00:00
error: trivial regex
2018-10-06 16:18:06 +00:00
--> $DIR/regex.rs:79:36
2017-08-01 15:54:21 +00:00
|
2018-10-06 16:18:06 +00:00
79 | let trivial_empty = Regex::new("");
2017-08-01 15:54:21 +00:00
| ^^
|
2018-03-13 14:02:40 +00:00
= help: the regex is unlikely to be useful as it is
2017-08-01 15:54:21 +00:00
error: trivial regex
2018-10-06 16:18:06 +00:00
--> $DIR/regex.rs:81:36
2017-08-01 15:54:21 +00:00
|
2018-10-06 16:18:06 +00:00
81 | let trivial_empty = Regex::new("^");
2017-08-01 15:54:21 +00:00
| ^^^
|
2018-03-13 14:02:40 +00:00
= help: the regex is unlikely to be useful as it is
2017-08-01 15:54:21 +00:00
error: trivial regex
2018-10-06 16:18:06 +00:00
--> $DIR/regex.rs:83:36
2017-08-01 15:54:21 +00:00
|
2018-10-06 16:18:06 +00:00
83 | let trivial_empty = Regex::new("^$");
2017-08-01 15:54:21 +00:00
| ^^^^
|
2018-03-13 14:02:40 +00:00
= help: consider using `str::is_empty`
2017-08-01 15:54:21 +00:00
error: trivial regex
2018-10-06 16:18:06 +00:00
--> $DIR/regex.rs:85:44
2017-08-01 15:54:21 +00:00
|
2018-10-06 16:18:06 +00:00
85 | let binary_trivial_empty = BRegex::new("^$");
2017-08-01 15:54:21 +00:00
| ^^^^
|
2018-03-13 14:02:40 +00:00
= help: consider using `str::is_empty`
2017-08-01 15:54:21 +00:00
error: aborting due to 23 previous errors
2018-01-16 16:06:27 +00:00