Skip to content

Commit 09c9301

Browse files
committed
Auto merge of rust-lang#97892 - klensy:fix-spaces, r=oli-obk
diagnostics: remove trailing spaces Remove few occurrences of trailing spaces and drive by fix of needless alloc of const string.
2 parents 2cc798b + 922ff84 commit 09c9301

11 files changed

+70
-70
lines changed

tests/ui/eprint_with_newline.stderr

+8-8
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ help: use `eprintln!` instead
99
|
1010
LL - eprint!("Hello/n");
1111
LL + eprintln!("Hello");
12-
|
12+
|
1313

1414
error: using `eprint!()` with a format string that ends in a single newline
1515
--> $DIR/eprint_with_newline.rs:6:5
@@ -21,7 +21,7 @@ help: use `eprintln!` instead
2121
|
2222
LL - eprint!("Hello {}/n", "world");
2323
LL + eprintln!("Hello {}", "world");
24-
|
24+
|
2525

2626
error: using `eprint!()` with a format string that ends in a single newline
2727
--> $DIR/eprint_with_newline.rs:7:5
@@ -33,7 +33,7 @@ help: use `eprintln!` instead
3333
|
3434
LL - eprint!("Hello {} {}/n", "world", "#2");
3535
LL + eprintln!("Hello {} {}", "world", "#2");
36-
|
36+
|
3737

3838
error: using `eprint!()` with a format string that ends in a single newline
3939
--> $DIR/eprint_with_newline.rs:8:5
@@ -45,7 +45,7 @@ help: use `eprintln!` instead
4545
|
4646
LL - eprint!("{}/n", 1265);
4747
LL + eprintln!("{}", 1265);
48-
|
48+
|
4949

5050
error: using `eprint!()` with a format string that ends in a single newline
5151
--> $DIR/eprint_with_newline.rs:9:5
@@ -57,7 +57,7 @@ help: use `eprintln!` instead
5757
|
5858
LL - eprint!("/n");
5959
LL + eprintln!();
60-
|
60+
|
6161

6262
error: using `eprint!()` with a format string that ends in a single newline
6363
--> $DIR/eprint_with_newline.rs:28:5
@@ -69,7 +69,7 @@ help: use `eprintln!` instead
6969
|
7070
LL - eprint!("//n"); // should fail
7171
LL + eprintln!("/"); // should fail
72-
|
72+
|
7373

7474
error: using `eprint!()` with a format string that ends in a single newline
7575
--> $DIR/eprint_with_newline.rs:35:5
@@ -111,7 +111,7 @@ help: use `eprintln!` instead
111111
|
112112
LL - eprint!("/r/n"); //~ ERROR
113113
LL + eprintln!("/r"); //~ ERROR
114-
|
114+
|
115115

116116
error: using `eprint!()` with a format string that ends in a single newline
117117
--> $DIR/eprint_with_newline.rs:48:5
@@ -123,7 +123,7 @@ help: use `eprintln!` instead
123123
|
124124
LL - eprint!("foo/rbar/n") // ~ ERROR
125125
LL + eprintln!("foo/rbar") // ~ ERROR
126-
|
126+
|
127127

128128
error: aborting due to 10 previous errors
129129

tests/ui/manual_split_once.stderr

+10-10
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,12 @@ help: remove the `iter` usages
9696
|
9797
LL - let l = iter.next().unwrap();
9898
LL +
99-
|
99+
|
100100
help: remove the `iter` usages
101101
|
102102
LL - let r = iter.next().unwrap();
103103
LL +
104-
|
104+
|
105105

106106
error: manual implementation of `split_once`
107107
--> $DIR/manual_split_once.rs:49:5
@@ -121,12 +121,12 @@ help: remove the `iter` usages
121121
|
122122
LL - let l = iter.next()?;
123123
LL +
124-
|
124+
|
125125
help: remove the `iter` usages
126126
|
127127
LL - let r = iter.next()?;
128128
LL +
129-
|
129+
|
130130

131131
error: manual implementation of `rsplit_once`
132132
--> $DIR/manual_split_once.rs:53:5
@@ -146,12 +146,12 @@ help: remove the `iter` usages
146146
|
147147
LL - let r = iter.next().unwrap();
148148
LL +
149-
|
149+
|
150150
help: remove the `iter` usages
151151
|
152152
LL - let l = iter.next().unwrap();
153153
LL +
154-
|
154+
|
155155

156156
error: manual implementation of `rsplit_once`
157157
--> $DIR/manual_split_once.rs:57:5
@@ -171,12 +171,12 @@ help: remove the `iter` usages
171171
|
172172
LL - let r = iter.next()?;
173173
LL +
174-
|
174+
|
175175
help: remove the `iter` usages
176176
|
177177
LL - let l = iter.next()?;
178178
LL +
179-
|
179+
|
180180

181181
error: manual implementation of `split_once`
182182
--> $DIR/manual_split_once.rs:142:13
@@ -202,12 +202,12 @@ help: remove the `iter` usages
202202
|
203203
LL - let a = iter.next().unwrap();
204204
LL +
205-
|
205+
|
206206
help: remove the `iter` usages
207207
|
208208
LL - let b = iter.next().unwrap();
209209
LL +
210-
|
210+
|
211211

212212
error: aborting due to 19 previous errors
213213

tests/ui/map_unwrap_or.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ help: use `map_or(<a>, <f>)` instead
1212
|
1313
LL - let _ = opt.map(|x| x + 1)
1414
LL + let _ = opt.map_or(0, |x| x + 1);
15-
|
15+
|
1616

1717
error: called `map(<f>).unwrap_or(<a>)` on an `Option` value. This can be done more directly by calling `map_or(<a>, <f>)` instead
1818
--> $DIR/map_unwrap_or.rs:20:13
@@ -59,7 +59,7 @@ help: use `and_then(<f>)` instead
5959
|
6060
LL - let _ = opt.map(|x| Some(x + 1)).unwrap_or(None);
6161
LL + let _ = opt.and_then(|x| Some(x + 1));
62-
|
62+
|
6363

6464
error: called `map(<f>).unwrap_or(None)` on an `Option` value. This can be done more directly by calling `and_then(<f>)` instead
6565
--> $DIR/map_unwrap_or.rs:31:13
@@ -92,7 +92,7 @@ help: use `and_then(<f>)` instead
9292
|
9393
LL - .map(|x| Some(x + 1))
9494
LL + .and_then(|x| Some(x + 1));
95-
|
95+
|
9696

9797
error: called `map(<f>).unwrap_or(<a>)` on an `Option` value. This can be done more directly by calling `map_or(<a>, <f>)` instead
9898
--> $DIR/map_unwrap_or.rs:46:13
@@ -104,7 +104,7 @@ help: use `map_or(<a>, <f>)` instead
104104
|
105105
LL - let _ = Some("prefix").map(|p| format!("{}.", p)).unwrap_or(id);
106106
LL + let _ = Some("prefix").map_or(id, |p| format!("{}.", p));
107-
|
107+
|
108108

109109
error: called `map(<f>).unwrap_or_else(<g>)` on an `Option` value. This can be done more directly by calling `map_or_else(<g>, <f>)` instead
110110
--> $DIR/map_unwrap_or.rs:50:13

tests/ui/needless_late_init.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ help: remove the assignments from the `match` arms
164164
|
165165
LL - 1 => f = "three",
166166
LL + 1 => "three",
167-
|
167+
|
168168

169169
error: unneeded late initialization
170170
--> $DIR/needless_late_init.rs:76:5
@@ -180,7 +180,7 @@ help: remove the assignments from the branches
180180
|
181181
LL - g = 5;
182182
LL + 5
183-
|
183+
|
184184
help: add a semicolon after the `if` expression
185185
|
186186
LL | };

tests/ui/print_literal.stderr

+11-11
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ help: try this
99
|
1010
LL - print!("Hello {}", "world");
1111
LL + print!("Hello world");
12-
|
12+
|
1313

1414
error: literal with an empty format string
1515
--> $DIR/print_literal.rs:26:36
@@ -21,7 +21,7 @@ help: try this
2121
|
2222
LL - println!("Hello {} {}", world, "world");
2323
LL + println!("Hello {} world", world);
24-
|
24+
|
2525

2626
error: literal with an empty format string
2727
--> $DIR/print_literal.rs:27:26
@@ -33,7 +33,7 @@ help: try this
3333
|
3434
LL - println!("Hello {}", "world");
3535
LL + println!("Hello world");
36-
|
36+
|
3737

3838
error: literal with an empty format string
3939
--> $DIR/print_literal.rs:32:25
@@ -45,7 +45,7 @@ help: try this
4545
|
4646
LL - println!("{0} {1}", "hello", "world");
4747
LL + println!("hello {1}", "world");
48-
|
48+
|
4949

5050
error: literal with an empty format string
5151
--> $DIR/print_literal.rs:32:34
@@ -57,7 +57,7 @@ help: try this
5757
|
5858
LL - println!("{0} {1}", "hello", "world");
5959
LL + println!("{0} world", "hello");
60-
|
60+
|
6161

6262
error: literal with an empty format string
6363
--> $DIR/print_literal.rs:33:25
@@ -69,7 +69,7 @@ help: try this
6969
|
7070
LL - println!("{1} {0}", "hello", "world");
7171
LL + println!("{1} hello", "world");
72-
|
72+
|
7373

7474
error: literal with an empty format string
7575
--> $DIR/print_literal.rs:33:34
@@ -81,7 +81,7 @@ help: try this
8181
|
8282
LL - println!("{1} {0}", "hello", "world");
8383
LL + println!("world {0}", "hello");
84-
|
84+
|
8585

8686
error: literal with an empty format string
8787
--> $DIR/print_literal.rs:36:29
@@ -93,7 +93,7 @@ help: try this
9393
|
9494
LL - println!("{foo} {bar}", foo = "hello", bar = "world");
9595
LL + println!("hello {bar}", bar = "world");
96-
|
96+
|
9797

9898
error: literal with an empty format string
9999
--> $DIR/print_literal.rs:36:44
@@ -105,7 +105,7 @@ help: try this
105105
|
106106
LL - println!("{foo} {bar}", foo = "hello", bar = "world");
107107
LL + println!("{foo} world", foo = "hello");
108-
|
108+
|
109109

110110
error: literal with an empty format string
111111
--> $DIR/print_literal.rs:37:29
@@ -117,7 +117,7 @@ help: try this
117117
|
118118
LL - println!("{bar} {foo}", foo = "hello", bar = "world");
119119
LL + println!("{bar} hello", bar = "world");
120-
|
120+
|
121121

122122
error: literal with an empty format string
123123
--> $DIR/print_literal.rs:37:44
@@ -129,7 +129,7 @@ help: try this
129129
|
130130
LL - println!("{bar} {foo}", foo = "hello", bar = "world");
131131
LL + println!("world {foo}", foo = "hello");
132-
|
132+
|
133133

134134
error: aborting due to 11 previous errors
135135

tests/ui/print_with_newline.stderr

+8-8
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ help: use `println!` instead
99
|
1010
LL - print!("Hello/n");
1111
LL + println!("Hello");
12-
|
12+
|
1313

1414
error: using `print!()` with a format string that ends in a single newline
1515
--> $DIR/print_with_newline.rs:9:5
@@ -21,7 +21,7 @@ help: use `println!` instead
2121
|
2222
LL - print!("Hello {}/n", "world");
2323
LL + println!("Hello {}", "world");
24-
|
24+
|
2525

2626
error: using `print!()` with a format string that ends in a single newline
2727
--> $DIR/print_with_newline.rs:10:5
@@ -33,7 +33,7 @@ help: use `println!` instead
3333
|
3434
LL - print!("Hello {} {}/n", "world", "#2");
3535
LL + println!("Hello {} {}", "world", "#2");
36-
|
36+
|
3737

3838
error: using `print!()` with a format string that ends in a single newline
3939
--> $DIR/print_with_newline.rs:11:5
@@ -45,7 +45,7 @@ help: use `println!` instead
4545
|
4646
LL - print!("{}/n", 1265);
4747
LL + println!("{}", 1265);
48-
|
48+
|
4949

5050
error: using `print!()` with a format string that ends in a single newline
5151
--> $DIR/print_with_newline.rs:12:5
@@ -57,7 +57,7 @@ help: use `println!` instead
5757
|
5858
LL - print!("/n");
5959
LL + println!();
60-
|
60+
|
6161

6262
error: using `print!()` with a format string that ends in a single newline
6363
--> $DIR/print_with_newline.rs:31:5
@@ -69,7 +69,7 @@ help: use `println!` instead
6969
|
7070
LL - print!("//n"); // should fail
7171
LL + println!("/"); // should fail
72-
|
72+
|
7373

7474
error: using `print!()` with a format string that ends in a single newline
7575
--> $DIR/print_with_newline.rs:38:5
@@ -111,7 +111,7 @@ help: use `println!` instead
111111
|
112112
LL - print!("/r/n"); //~ ERROR
113113
LL + println!("/r"); //~ ERROR
114-
|
114+
|
115115

116116
error: using `print!()` with a format string that ends in a single newline
117117
--> $DIR/print_with_newline.rs:51:5
@@ -123,7 +123,7 @@ help: use `println!` instead
123123
|
124124
LL - print!("foo/rbar/n") // ~ ERROR
125125
LL + println!("foo/rbar") // ~ ERROR
126-
|
126+
|
127127

128128
error: aborting due to 10 previous errors
129129

tests/ui/unnecessary_iter_cloned.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ help: remove this `&`
1313
|
1414
LL - let other = match get_file_path(&t) {
1515
LL + let other = match get_file_path(t) {
16-
|
16+
|
1717

1818
error: unnecessary use of `copied`
1919
--> $DIR/unnecessary_iter_cloned.rs:46:22
@@ -29,7 +29,7 @@ help: remove this `&`
2929
|
3030
LL - let other = match get_file_path(&t) {
3131
LL + let other = match get_file_path(t) {
32-
|
32+
|
3333

3434
error: aborting due to 2 previous errors
3535

tests/ui/unnecessary_to_owned.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ help: remove this `&`
489489
|
490490
LL - let path = match get_file_path(&t) {
491491
LL + let path = match get_file_path(t) {
492-
|
492+
|
493493

494494
error: unnecessary use of `to_vec`
495495
--> $DIR/unnecessary_to_owned.rs:221:14

0 commit comments

Comments
 (0)