Skip to content

Commit f4ff418

Browse files
authored
Rollup merge of #64504 - guanqun:use-println-without-empty-str, r=jonas-schievink
use println!() instead of println!("") The empty string is unnecessary.
2 parents d8ecf45 + 5355a16 commit f4ff418

File tree

7 files changed

+26
-26
lines changed

7 files changed

+26
-26
lines changed

src/librustc_codegen_llvm/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -226,21 +226,21 @@ impl CodegenBackend for LlvmCodegenBackend {
226226
for &(name, _) in back::write::RELOC_MODEL_ARGS.iter() {
227227
println!(" {}", name);
228228
}
229-
println!("");
229+
println!();
230230
}
231231
PrintRequest::CodeModels => {
232232
println!("Available code models:");
233233
for &(name, _) in back::write::CODE_GEN_MODEL_ARGS.iter(){
234234
println!(" {}", name);
235235
}
236-
println!("");
236+
println!();
237237
}
238238
PrintRequest::TlsModels => {
239239
println!("Available TLS models:");
240240
for &(name, _) in back::write::TLS_MODEL_ARGS.iter(){
241241
println!(" {}", name);
242242
}
243-
println!("");
243+
println!();
244244
}
245245
req => llvm_util::print(req, sess),
246246
}

src/libstd/process.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ impl fmt::Debug for ChildStderr {
422422
/// // Execute `ls` in the current directory of the program.
423423
/// list_dir.status().expect("process failed to execute");
424424
///
425-
/// println!("");
425+
/// println!();
426426
///
427427
/// // Change `ls` to execute in the root directory.
428428
/// list_dir.current_dir("/");

src/test/debuginfo/function-arg-initialization.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -242,12 +242,12 @@ fn non_immediate_args(a: BigStruct, b: BigStruct) {
242242

243243
fn binding(a: i64, b: u64, c: f64) {
244244
let x = 0; // #break
245-
println!("")
245+
println!()
246246
}
247247

248248
fn assignment(mut a: u64, b: u64, c: f64) {
249249
a = b; // #break
250-
println!("")
250+
println!()
251251
}
252252

253253
fn function_call(x: u64, y: u64, z: f64) {

src/test/ui/drop/dropck_legal_cycles.rs

+15-15
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ pub fn main() {
143143
v[0].descend_into_self(&mut c);
144144
assert!(!c.saw_prev_marked); // <-- different from below, b/c acyclic above
145145

146-
if PRINT { println!(""); }
146+
if PRINT { println!(); }
147147

148148
// Cycle 1: { v[0] -> v[1], v[1] -> v[0] };
149149
// does not exercise `v` itself
@@ -158,7 +158,7 @@ pub fn main() {
158158
v[0].descend_into_self(&mut c);
159159
assert!(c.saw_prev_marked);
160160

161-
if PRINT { println!(""); }
161+
if PRINT { println!(); }
162162

163163
// Cycle 2: { v[0] -> v, v[1] -> v }
164164
let v: V = Named::new("v");
@@ -171,7 +171,7 @@ pub fn main() {
171171
v.descend_into_self(&mut c);
172172
assert!(c.saw_prev_marked);
173173

174-
if PRINT { println!(""); }
174+
if PRINT { println!(); }
175175

176176
// Cycle 3: { hk0 -> hv0, hv0 -> hk0, hk1 -> hv1, hv1 -> hk1 };
177177
// does not exercise `h` itself
@@ -193,7 +193,7 @@ pub fn main() {
193193
assert!(c.saw_prev_marked);
194194
}
195195

196-
if PRINT { println!(""); }
196+
if PRINT { println!(); }
197197

198198
// Cycle 4: { h -> (hmk0,hmv0,hmk1,hmv1), {hmk0,hmv0,hmk1,hmv1} -> h }
199199

@@ -216,7 +216,7 @@ pub fn main() {
216216
// break;
217217
}
218218

219-
if PRINT { println!(""); }
219+
if PRINT { println!(); }
220220

221221
// Cycle 5: { vd[0] -> vd[1], vd[1] -> vd[0] };
222222
// does not exercise vd itself
@@ -232,7 +232,7 @@ pub fn main() {
232232
vd[0].descend_into_self(&mut c);
233233
assert!(c.saw_prev_marked);
234234

235-
if PRINT { println!(""); }
235+
if PRINT { println!(); }
236236

237237
// Cycle 6: { vd -> (vd0, vd1), {vd0, vd1} -> vd }
238238
let mut vd: VecDeque<VD> = VecDeque::new();
@@ -247,7 +247,7 @@ pub fn main() {
247247
vd[0].descend_into_self(&mut c);
248248
assert!(c.saw_prev_marked);
249249

250-
if PRINT { println!(""); }
250+
if PRINT { println!(); }
251251

252252
// Cycle 7: { vm -> (vm0, vm1), {vm0, vm1} -> vm }
253253
let mut vm: HashMap<usize, VM> = HashMap::new();
@@ -262,7 +262,7 @@ pub fn main() {
262262
vm[&0].descend_into_self(&mut c);
263263
assert!(c.saw_prev_marked);
264264

265-
if PRINT { println!(""); }
265+
if PRINT { println!(); }
266266

267267
// Cycle 8: { ll -> (ll0, ll1), {ll0, ll1} -> ll }
268268
let mut ll: LinkedList<LL> = LinkedList::new();
@@ -282,7 +282,7 @@ pub fn main() {
282282
// break;
283283
}
284284

285-
if PRINT { println!(""); }
285+
if PRINT { println!(); }
286286

287287
// Cycle 9: { bh -> (bh0, bh1), {bh0, bh1} -> bh }
288288
let mut bh: BinaryHeap<BH> = BinaryHeap::new();
@@ -302,7 +302,7 @@ pub fn main() {
302302
// break;
303303
}
304304

305-
if PRINT { println!(""); }
305+
if PRINT { println!(); }
306306

307307
// Cycle 10: { btm -> (btk0, btv1), {bt0, bt1} -> btm }
308308
let mut btm: BTreeMap<BTM, BTM> = BTreeMap::new();
@@ -323,7 +323,7 @@ pub fn main() {
323323
// break;
324324
}
325325

326-
if PRINT { println!(""); }
326+
if PRINT { println!(); }
327327

328328
// Cycle 10: { bts -> (bts0, bts1), {bts0, bts1} -> btm }
329329
let mut bts: BTreeSet<BTS> = BTreeSet::new();
@@ -343,7 +343,7 @@ pub fn main() {
343343
// break;
344344
}
345345

346-
if PRINT { println!(""); }
346+
if PRINT { println!(); }
347347

348348
// Cycle 11: { rc0 -> (rc1, rc2), rc1 -> (), rc2 -> rc0 }
349349
let (rc0, rc1, rc2): (RCRC, RCRC, RCRC);
@@ -361,7 +361,7 @@ pub fn main() {
361361
rc0.descend_into_self(&mut c);
362362
assert!(c.saw_prev_marked);
363363

364-
if PRINT { println!(""); }
364+
if PRINT { println!(); }
365365

366366
// We want to take the previous Rc case and generalize it to Arc.
367367
//
@@ -395,7 +395,7 @@ pub fn main() {
395395
arc0.descend_into_self(&mut c);
396396
assert!(c.saw_prev_marked);
397397

398-
if PRINT { println!(""); }
398+
if PRINT { println!(); }
399399

400400
// Cycle 13: { arc0 -> (arc1, arc2), arc1 -> (), arc2 -> arc0 }, rwlocks
401401
let (arc0, arc1, arc2): (ARCRW, ARCRW, ARCRW);
@@ -413,7 +413,7 @@ pub fn main() {
413413
arc0.descend_into_self(&mut c);
414414
assert!(c.saw_prev_marked);
415415

416-
if PRINT { println!(""); }
416+
if PRINT { println!(); }
417417

418418
// Cycle 14: { arc0 -> (arc1, arc2), arc1 -> (), arc2 -> arc0 }, mutexs
419419
let (arc0, arc1, arc2): (ARCM, ARCM, ARCM);

src/test/ui/for/for-c-in-str.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ fn main() {
66
//~| NOTE `&str` is not an iterator
77
//~| HELP the trait `std::iter::Iterator` is not implemented for `&str`
88
//~| NOTE required by `std::iter::IntoIterator::into_iter`
9-
println!("");
9+
println!();
1010
}
1111
}

src/tools/compiletest/src/main.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ pub fn parse_config(args: Vec<String>) -> Config {
253253
if args.len() == 1 || args[1] == "-h" || args[1] == "--help" {
254254
let message = format!("Usage: {} [OPTIONS] [TESTNAME...]", argv0);
255255
println!("{}", opts.usage(&message));
256-
println!("");
256+
println!();
257257
panic!()
258258
}
259259

@@ -265,7 +265,7 @@ pub fn parse_config(args: Vec<String>) -> Config {
265265
if matches.opt_present("h") || matches.opt_present("help") {
266266
let message = format!("Usage: {} [OPTIONS] [TESTNAME...]", argv0);
267267
println!("{}", opts.usage(&message));
268-
println!("");
268+
println!();
269269
panic!()
270270
}
271271

src/tools/compiletest/src/runtest.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2593,7 +2593,7 @@ impl<'test> TestCx<'test> {
25932593
" actual: {}",
25942594
codegen_units_to_str(&actual_item.codegen_units)
25952595
);
2596-
println!("");
2596+
println!();
25972597
}
25982598
}
25992599

@@ -3526,7 +3526,7 @@ impl<'test> TestCx<'test> {
35263526
}
35273527
}
35283528
}
3529-
println!("");
3529+
println!();
35303530
}
35313531
}
35323532
}

0 commit comments

Comments
 (0)