Skip to content

Commit 2a6473a

Browse files
committed
Added the test results.
The regex test was modified, because rustfmt was run on regex.rs.
1 parent d5c40bb commit 2a6473a

File tree

2 files changed

+93
-28
lines changed

2 files changed

+93
-28
lines changed

tests/ui/const_static_lifetime.stderr

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
error: Constants have by default a `'static` lifetime
2+
--> $DIR/const_static_lifetime.rs:6:17
3+
|
4+
6 | const VAR_ONE: &'static str = "Test constant #1"; // ERROR Consider removing 'static.
5+
| ^^^^^^^
6+
|
7+
= note: `-D const-static-lifetime` implied by `-D warnings`
8+
= help: consider removing `'static`
9+
10+
error: Constants have by default a `'static` lifetime
11+
--> $DIR/const_static_lifetime.rs:10:21
12+
|
13+
10 | const VAR_THREE: &[&'static str] = &["one", "two"]; // ERROR Consider removing 'static
14+
| ^^^^^^^
15+
|
16+
= help: consider removing `'static`
17+
18+
error: Constants have by default a `'static` lifetime
19+
--> $DIR/const_static_lifetime.rs:12:32
20+
|
21+
12 | const VAR_FOUR: (&str, (&str, &'static str), &'static str) = ("on", ("th", "th"), "on"); // ERROR Consider removing 'static
22+
| ^^^^^^^
23+
|
24+
= help: consider removing `'static`
25+
26+
error: Constants have by default a `'static` lifetime
27+
--> $DIR/const_static_lifetime.rs:12:47
28+
|
29+
12 | const VAR_FOUR: (&str, (&str, &'static str), &'static str) = ("on", ("th", "th"), "on"); // ERROR Consider removing 'static
30+
| ^^^^^^^
31+
|
32+
= help: consider removing `'static`
33+
34+
error: Constants have by default a `'static` lifetime
35+
--> $DIR/const_static_lifetime.rs:14:30
36+
|
37+
14 | const VAR_FIVE: &'static [&[&'static str]] = &[&["test"], &["other one"]]; // ERROR Consider removing 'static
38+
| ^^^^^^^
39+
|
40+
= help: consider removing `'static`
41+
42+
error: Constants have by default a `'static` lifetime
43+
--> $DIR/const_static_lifetime.rs:16:17
44+
|
45+
16 | const VAR_SIX: &'static u8 = &5;
46+
| ^^^^^^^
47+
|
48+
= help: consider removing `'static`
49+
50+
error: Constants have by default a `'static` lifetime
51+
--> $DIR/const_static_lifetime.rs:18:39
52+
|
53+
18 | const VAR_SEVEN: &[&(&str, &'static [&'static str])] = &[&("one", &["other one"])];
54+
| ^^^^^^^
55+
|
56+
= help: consider removing `'static`
57+
58+
error: Constants have by default a `'static` lifetime
59+
--> $DIR/const_static_lifetime.rs:20:20
60+
|
61+
20 | const VAR_HEIGHT: &'static Foo = &Foo {};
62+
| ^^^^^^^
63+
|
64+
= help: consider removing `'static`
65+

tests/ui/regex.stderr

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -49,102 +49,102 @@ error: regex syntax error on position 0: unclosed parenthesis
4949
| ^^^^^^^^^^^^^
5050

5151
error: regex syntax error on position 0: unclosed parenthesis
52-
--> $DIR/regex.rs:40:9
52+
--> $DIR/regex.rs:33:37
5353
|
54-
40 | OPENING_PAREN,
55-
| ^^^^^^^^^^^^^
54+
33 | let set_error = RegexSet::new(&[OPENING_PAREN, r"[a-z]+/.(com|org|net)"]);
55+
| ^^^^^^^^^^^^^
5656

5757
error: regex syntax error on position 0: unclosed parenthesis
58-
--> $DIR/regex.rs:44:9
58+
--> $DIR/regex.rs:34:39
5959
|
60-
44 | OPENING_PAREN,
61-
| ^^^^^^^^^^^^^
60+
34 | let bset_error = BRegexSet::new(&[OPENING_PAREN, r"[a-z]+/.(com|org|net)"]);
61+
| ^^^^^^^^^^^^^
6262

6363
error: trivial regex
64-
--> $DIR/regex.rs:50:33
64+
--> $DIR/regex.rs:38:33
6565
|
66-
50 | let trivial_eq = Regex::new("^foobar$");
66+
38 | let trivial_eq = Regex::new("^foobar$");
6767
| ^^^^^^^^^^
6868
|
6969
= note: `-D trivial-regex` implied by `-D warnings`
7070
= help: consider using consider using `==` on `str`s
7171

7272
error: trivial regex
73-
--> $DIR/regex.rs:52:48
73+
--> $DIR/regex.rs:40:48
7474
|
75-
52 | let trivial_eq_builder = RegexBuilder::new("^foobar$");
75+
40 | let trivial_eq_builder = RegexBuilder::new("^foobar$");
7676
| ^^^^^^^^^^
7777
|
7878
= help: consider using consider using `==` on `str`s
7979

8080
error: trivial regex
81-
--> $DIR/regex.rs:54:42
81+
--> $DIR/regex.rs:42:42
8282
|
83-
54 | let trivial_starts_with = Regex::new("^foobar");
83+
42 | let trivial_starts_with = Regex::new("^foobar");
8484
| ^^^^^^^^^
8585
|
8686
= help: consider using consider using `str::starts_with`
8787

8888
error: trivial regex
89-
--> $DIR/regex.rs:56:40
89+
--> $DIR/regex.rs:44:40
9090
|
91-
56 | let trivial_ends_with = Regex::new("foobar$");
91+
44 | let trivial_ends_with = Regex::new("foobar$");
9292
| ^^^^^^^^^
9393
|
9494
= help: consider using consider using `str::ends_with`
9595

9696
error: trivial regex
97-
--> $DIR/regex.rs:58:39
97+
--> $DIR/regex.rs:46:39
9898
|
99-
58 | let trivial_contains = Regex::new("foobar");
99+
46 | let trivial_contains = Regex::new("foobar");
100100
| ^^^^^^^^
101101
|
102102
= help: consider using consider using `str::contains`
103103

104104
error: trivial regex
105-
--> $DIR/regex.rs:60:39
105+
--> $DIR/regex.rs:48:39
106106
|
107-
60 | let trivial_contains = Regex::new(NOT_A_REAL_REGEX);
107+
48 | let trivial_contains = Regex::new(NOT_A_REAL_REGEX);
108108
| ^^^^^^^^^^^^^^^^
109109
|
110110
= help: consider using consider using `str::contains`
111111

112112
error: trivial regex
113-
--> $DIR/regex.rs:62:40
113+
--> $DIR/regex.rs:50:40
114114
|
115-
62 | let trivial_backslash = Regex::new("a//.b");
115+
50 | let trivial_backslash = Regex::new("a//.b");
116116
| ^^^^^^^
117117
|
118118
= help: consider using consider using `str::contains`
119119

120120
error: trivial regex
121-
--> $DIR/regex.rs:65:36
121+
--> $DIR/regex.rs:53:36
122122
|
123-
65 | let trivial_empty = Regex::new("");
123+
53 | let trivial_empty = Regex::new("");
124124
| ^^
125125
|
126126
= help: consider using the regex is unlikely to be useful as it is
127127

128128
error: trivial regex
129-
--> $DIR/regex.rs:67:36
129+
--> $DIR/regex.rs:55:36
130130
|
131-
67 | let trivial_empty = Regex::new("^");
131+
55 | let trivial_empty = Regex::new("^");
132132
| ^^^
133133
|
134134
= help: consider using the regex is unlikely to be useful as it is
135135

136136
error: trivial regex
137-
--> $DIR/regex.rs:69:36
137+
--> $DIR/regex.rs:57:36
138138
|
139-
69 | let trivial_empty = Regex::new("^$");
139+
57 | let trivial_empty = Regex::new("^$");
140140
| ^^^^
141141
|
142142
= help: consider using consider using `str::is_empty`
143143

144144
error: trivial regex
145-
--> $DIR/regex.rs:71:44
145+
--> $DIR/regex.rs:59:44
146146
|
147-
71 | let binary_trivial_empty = BRegex::new("^$");
147+
59 | let binary_trivial_empty = BRegex::new("^$");
148148
| ^^^^
149149
|
150150
= help: consider using consider using `str::is_empty`

0 commit comments

Comments
 (0)