Skip to content

Commit 4e18568

Browse files
committed
fixed failing tests with update-references.sh
1 parent eaeaf74 commit 4e18568

File tree

3 files changed

+172
-15
lines changed

3 files changed

+172
-15
lines changed

tests/ui/regex.stderr

Lines changed: 167 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,171 @@
1-
error[E0514]: found crate `regex` compiled by an incompatible version of rustc
2-
--> $DIR/regex.rs:4:1
1+
error: trivial regex
2+
--> $DIR/regex.rs:13:45
33
|
4-
LL | extern crate regex;
5-
| ^^^^^^^^^^^^^^^^^^^
4+
LL | let pipe_in_wrong_position = Regex::new("|");
5+
| ^^^
66
|
7-
= help: please recompile that crate using this compiler (rustc 1.43.0-nightly (a8437cf21 2020-02-27))
8-
= note: the following crate versions were found:
9-
crate `regex` compiled by rustc 1.43.0-nightly (e3a277943 2020-02-25): /home/devinr/aprog/rust/__forks__/rust-clippy/target/debug/deps/libregex-7640b48dc23b89d0.rlib
7+
= note: `-D clippy::trivial-regex` implied by `-D warnings`
8+
= help: the regex is unlikely to be useful as it is
109

11-
error: aborting due to previous error
10+
error: trivial regex
11+
--> $DIR/regex.rs:14:60
12+
|
13+
LL | let pipe_in_wrong_position_builder = RegexBuilder::new("|");
14+
| ^^^
15+
|
16+
= help: the regex is unlikely to be useful as it is
17+
18+
error: regex syntax error: invalid character class range, the start must be <= the end
19+
--> $DIR/regex.rs:15:42
20+
|
21+
LL | let wrong_char_ranice = Regex::new("[z-a]");
22+
| ^^^
23+
|
24+
= note: `-D clippy::invalid-regex` implied by `-D warnings`
25+
26+
error: regex syntax error: invalid character class range, the start must be <= the end
27+
--> $DIR/regex.rs:16:37
28+
|
29+
LL | let some_unicode = Regex::new("[é-è]");
30+
| ^^^
31+
32+
error: regex syntax error on position 0: unclosed group
33+
--> $DIR/regex.rs:18:33
34+
|
35+
LL | let some_regex = Regex::new(OPENING_PAREN);
36+
| ^^^^^^^^^^^^^
37+
38+
error: trivial regex
39+
--> $DIR/regex.rs:20:53
40+
|
41+
LL | let binary_pipe_in_wrong_position = BRegex::new("|");
42+
| ^^^
43+
|
44+
= help: the regex is unlikely to be useful as it is
45+
46+
error: regex syntax error on position 0: unclosed group
47+
--> $DIR/regex.rs:21:41
48+
|
49+
LL | let some_binary_regex = BRegex::new(OPENING_PAREN);
50+
| ^^^^^^^^^^^^^
51+
52+
error: regex syntax error on position 0: unclosed group
53+
--> $DIR/regex.rs:22:56
54+
|
55+
LL | let some_binary_regex_builder = BRegexBuilder::new(OPENING_PAREN);
56+
| ^^^^^^^^^^^^^
57+
58+
error: regex syntax error on position 0: unclosed group
59+
--> $DIR/regex.rs:34:37
60+
|
61+
LL | let set_error = RegexSet::new(&[OPENING_PAREN, r"[a-z]+/.(com|org|net)"]);
62+
| ^^^^^^^^^^^^^
63+
64+
error: regex syntax error on position 0: unclosed group
65+
--> $DIR/regex.rs:35:39
66+
|
67+
LL | let bset_error = BRegexSet::new(&[OPENING_PAREN, r"[a-z]+/.(com|org|net)"]);
68+
| ^^^^^^^^^^^^^
69+
70+
error: regex syntax error: unrecognized escape sequence
71+
--> $DIR/regex.rs:37:45
72+
|
73+
LL | let raw_string_error = Regex::new(r"[...//...]");
74+
| ^^
75+
76+
error: regex syntax error: unrecognized escape sequence
77+
--> $DIR/regex.rs:38:46
78+
|
79+
LL | let raw_string_error = Regex::new(r#"[...//...]"#);
80+
| ^^
81+
82+
error: trivial regex
83+
--> $DIR/regex.rs:42:33
84+
|
85+
LL | let trivial_eq = Regex::new("^foobar$");
86+
| ^^^^^^^^^^
87+
|
88+
= help: consider using `==` on `str`s
89+
90+
error: trivial regex
91+
--> $DIR/regex.rs:44:48
92+
|
93+
LL | let trivial_eq_builder = RegexBuilder::new("^foobar$");
94+
| ^^^^^^^^^^
95+
|
96+
= help: consider using `==` on `str`s
97+
98+
error: trivial regex
99+
--> $DIR/regex.rs:46:42
100+
|
101+
LL | let trivial_starts_with = Regex::new("^foobar");
102+
| ^^^^^^^^^
103+
|
104+
= help: consider using `str::starts_with`
105+
106+
error: trivial regex
107+
--> $DIR/regex.rs:48:40
108+
|
109+
LL | let trivial_ends_with = Regex::new("foobar$");
110+
| ^^^^^^^^^
111+
|
112+
= help: consider using `str::ends_with`
113+
114+
error: trivial regex
115+
--> $DIR/regex.rs:50:39
116+
|
117+
LL | let trivial_contains = Regex::new("foobar");
118+
| ^^^^^^^^
119+
|
120+
= help: consider using `str::contains`
121+
122+
error: trivial regex
123+
--> $DIR/regex.rs:52:39
124+
|
125+
LL | let trivial_contains = Regex::new(NOT_A_REAL_REGEX);
126+
| ^^^^^^^^^^^^^^^^
127+
|
128+
= help: consider using `str::contains`
129+
130+
error: trivial regex
131+
--> $DIR/regex.rs:54:40
132+
|
133+
LL | let trivial_backslash = Regex::new("a/.b");
134+
| ^^^^^^^
135+
|
136+
= help: consider using `str::contains`
137+
138+
error: trivial regex
139+
--> $DIR/regex.rs:57:36
140+
|
141+
LL | let trivial_empty = Regex::new("");
142+
| ^^
143+
|
144+
= help: the regex is unlikely to be useful as it is
145+
146+
error: trivial regex
147+
--> $DIR/regex.rs:59:36
148+
|
149+
LL | let trivial_empty = Regex::new("^");
150+
| ^^^
151+
|
152+
= help: the regex is unlikely to be useful as it is
153+
154+
error: trivial regex
155+
--> $DIR/regex.rs:61:36
156+
|
157+
LL | let trivial_empty = Regex::new("^$");
158+
| ^^^^
159+
|
160+
= help: consider using `str::is_empty`
161+
162+
error: trivial regex
163+
--> $DIR/regex.rs:63:44
164+
|
165+
LL | let binary_trivial_empty = BRegex::new("^$");
166+
| ^^^^
167+
|
168+
= help: consider using `str::is_empty`
169+
170+
error: aborting due to 23 previous errors
12171

tests/ui/single_component_path_imports.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#![warn(clippy::single_component_path_imports)]
44
#![allow(unused_imports)]
55

6-
use regex;
6+
77
use serde as edres;
88
pub use serde;
99

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
error[E0514]: found crate `regex` compiled by an incompatible version of rustc
2-
--> $DIR/single_component_path_imports.rs:6:5
1+
error: this import is redundant
2+
--> $DIR/single_component_path_imports.rs:6:1
33
|
44
LL | use regex;
5-
| ^^^^^
5+
| ^^^^^^^^^^ help: remove it entirely
66
|
7-
= help: please recompile that crate using this compiler (rustc 1.43.0-nightly (a8437cf21 2020-02-27))
8-
= note: the following crate versions were found:
9-
crate `regex` compiled by rustc 1.43.0-nightly (e3a277943 2020-02-25): /home/devinr/aprog/rust/__forks__/rust-clippy/target/debug/deps/libregex-7640b48dc23b89d0.rlib
7+
= note: `-D clippy::single-component-path-imports` implied by `-D warnings`
108

119
error: aborting due to previous error
1210

0 commit comments

Comments
 (0)