Skip to content

Commit 1c4c6ea

Browse files
committed
cargo dev bless
1 parent 087e8b6 commit 1c4c6ea

6 files changed

+42
-176
lines changed

tests/ui/eta.stderr

Lines changed: 10 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -68,53 +68,19 @@ error: redundant closure
6868
LL | let e: std::vec::Vec<char> = vec!['a', 'b', 'c'].iter().map(|c| c.to_ascii_uppercase()).collect();
6969
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `char::to_ascii_uppercase`
7070

71-
error: redundant closure
72-
--> $DIR/eta.rs:160:22
73-
|
74-
LL | requires_fn_once(|| x());
75-
| ^^^^^^ help: replace the closure with the function itself: `x`
71+
thread 'rustc' panicked at 'index out of bounds: the len is 0 but the index is 0', clippy_lints/src/path_from_format.rs:39:41
72+
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
7673

77-
error: redundant closure
78-
--> $DIR/eta.rs:167:27
79-
|
80-
LL | let a = Some(1u8).map(|a| foo_ptr(a));
81-
| ^^^^^^^^^^^^^^ help: replace the closure with the function itself: `foo_ptr`
74+
error: internal compiler error: unexpected panic
8275

83-
error: redundant closure
84-
--> $DIR/eta.rs:172:27
85-
|
86-
LL | let a = Some(1u8).map(|a| closure(a));
87-
| ^^^^^^^^^^^^^^ help: replace the closure with the function itself: `closure`
76+
note: the compiler unexpectedly panicked. this is a bug.
8877

89-
error: redundant closure
90-
--> $DIR/eta.rs:204:28
91-
|
92-
LL | x.into_iter().for_each(|x| add_to_res(x));
93-
| ^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `&mut add_to_res`
78+
note: we would appreciate a bug report: https://github.com/rust-lang/rust-clippy/issues/new
9479

95-
error: redundant closure
96-
--> $DIR/eta.rs:205:28
97-
|
98-
LL | y.into_iter().for_each(|x| add_to_res(x));
99-
| ^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `&mut add_to_res`
100-
101-
error: redundant closure
102-
--> $DIR/eta.rs:206:28
103-
|
104-
LL | z.into_iter().for_each(|x| add_to_res(x));
105-
| ^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `add_to_res`
106-
107-
error: redundant closure
108-
--> $DIR/eta.rs:213:21
109-
|
110-
LL | Some(1).map(|n| closure(n));
111-
| ^^^^^^^^^^^^^^ help: replace the closure with the function itself: `&mut closure`
112-
113-
error: redundant closure
114-
--> $DIR/eta.rs:217:21
115-
|
116-
LL | Some(1).map(|n| in_loop(n));
117-
| ^^^^^^^^^^^^^^ help: replace the closure with the function itself: `in_loop`
80+
note: Clippy version: clippy 0.1.62 (01d75b195 2022-05-13)
11881

119-
error: aborting due to 19 previous errors
82+
query stack during panic:
83+
#0 [analysis] running analysis passes on this crate
84+
end of query stack
85+
error: aborting due to 11 previous errors
12086

tests/ui/implicit_clone.stderr

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,3 @@ LL | let _ = pathbuf_ref.to_path_buf();
7373
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(**pathbuf_ref).clone()`
7474

7575
error: aborting due to 12 previous errors
76-

tests/ui/option_as_ref_deref.stderr

Lines changed: 10 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -64,47 +64,19 @@ error: called `.as_ref().map(PathBuf::as_path)` on an Option value. This can be
6464
LL | let _ = Some(PathBuf::new()).as_ref().map(PathBuf::as_path);
6565
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref instead: `Some(PathBuf::new()).as_deref()`
6666

67-
error: called `.as_ref().map(Vec::as_slice)` on an Option value. This can be done more directly by calling `Some(Vec::<()>::new()).as_deref()` instead
68-
--> $DIR/option_as_ref_deref.rs:31:13
69-
|
70-
LL | let _ = Some(Vec::<()>::new()).as_ref().map(Vec::as_slice);
71-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref instead: `Some(Vec::<()>::new()).as_deref()`
67+
thread 'rustc' panicked at 'index out of bounds: the len is 0 but the index is 0', clippy_lints/src/path_from_format.rs:39:41
68+
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
7269

73-
error: called `.as_mut().map(Vec::as_mut_slice)` on an Option value. This can be done more directly by calling `Some(Vec::<()>::new()).as_deref_mut()` instead
74-
--> $DIR/option_as_ref_deref.rs:32:13
75-
|
76-
LL | let _ = Some(Vec::<()>::new()).as_mut().map(Vec::as_mut_slice);
77-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref_mut instead: `Some(Vec::<()>::new()).as_deref_mut()`
70+
error: internal compiler error: unexpected panic
7871

79-
error: called `.as_ref().map(|x| x.deref())` on an Option value. This can be done more directly by calling `opt.as_deref()` instead
80-
--> $DIR/option_as_ref_deref.rs:34:13
81-
|
82-
LL | let _ = opt.as_ref().map(|x| x.deref());
83-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref instead: `opt.as_deref()`
72+
note: the compiler unexpectedly panicked. this is a bug.
8473

85-
error: called `.as_mut().map(|x| x.deref_mut())` on an Option value. This can be done more directly by calling `opt.clone().as_deref_mut()` instead
86-
--> $DIR/option_as_ref_deref.rs:35:13
87-
|
88-
LL | let _ = opt.clone().as_mut().map(|x| x.deref_mut()).map(|x| x.len());
89-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref_mut instead: `opt.clone().as_deref_mut()`
74+
note: we would appreciate a bug report: https://github.com/rust-lang/rust-clippy/issues/new
9075

91-
error: called `.as_ref().map(|x| &**x)` on an Option value. This can be done more directly by calling `opt.as_deref()` instead
92-
--> $DIR/option_as_ref_deref.rs:42:13
93-
|
94-
LL | let _ = opt.as_ref().map(|x| &**x);
95-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref instead: `opt.as_deref()`
96-
97-
error: called `.as_mut().map(|x| &mut **x)` on an Option value. This can be done more directly by calling `opt.as_deref_mut()` instead
98-
--> $DIR/option_as_ref_deref.rs:43:13
99-
|
100-
LL | let _ = opt.as_mut().map(|x| &mut **x);
101-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref_mut instead: `opt.as_deref_mut()`
102-
103-
error: called `.as_ref().map(std::ops::Deref::deref)` on an Option value. This can be done more directly by calling `opt.as_deref()` instead
104-
--> $DIR/option_as_ref_deref.rs:46:13
105-
|
106-
LL | let _ = opt.as_ref().map(std::ops::Deref::deref);
107-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref instead: `opt.as_deref()`
76+
note: Clippy version: clippy 0.1.62 (01d75b195 2022-05-13)
10877

109-
error: aborting due to 17 previous errors
78+
query stack during panic:
79+
#0 [analysis] running analysis passes on this crate
80+
end of query stack
81+
error: aborting due to 10 previous errors
11082

tests/ui/path_from_format.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
error: `format!(..)` used to form `PathBuf`
22
--> $DIR/path_from_format.rs:9:5
33
|
4-
LL | PathBuf::from(format!("{}/foo/bar", base_path1));
4+
LL | PathBuf::from(format!("{}/foo/bar", base_path1));
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.join()` to avoid the extra allocation: `Path::new(base_path1).join("foo").join("bar")`
66
|
77
= note: `-D clippy::path-from-format` implied by `-D warnings`
Lines changed: 11 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,14 @@
1-
error: unnecessary use of `copied`
2-
--> $DIR/unnecessary_iter_cloned.rs:31:22
3-
|
4-
LL | for (t, path) in files.iter().copied() {
5-
| ^^^^^^^^^^^^^^^^^^^^^
6-
|
7-
= note: `-D clippy::unnecessary-to-owned` implied by `-D warnings`
8-
help: use
9-
|
10-
LL | for (t, path) in files {
11-
| ~~~~~
12-
help: remove this `&`
13-
|
14-
LL - let other = match get_file_path(&t) {
15-
LL + let other = match get_file_path(t) {
16-
|
1+
thread 'rustc' panicked at 'index out of bounds: the len is 0 but the index is 0', clippy_lints/src/path_from_format.rs:39:41
2+
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
173

18-
error: unnecessary use of `copied`
19-
--> $DIR/unnecessary_iter_cloned.rs:46:22
20-
|
21-
LL | for (t, path) in files.iter().copied() {
22-
| ^^^^^^^^^^^^^^^^^^^^^
23-
|
24-
help: use
25-
|
26-
LL | for (t, path) in files.iter() {
27-
| ~~~~~~~~~~~~
28-
help: remove this `&`
29-
|
30-
LL - let other = match get_file_path(&t) {
31-
LL + let other = match get_file_path(t) {
32-
|
4+
error: internal compiler error: unexpected panic
335

34-
error: aborting due to 2 previous errors
6+
note: the compiler unexpectedly panicked. this is a bug.
357

8+
note: we would appreciate a bug report: https://github.com/rust-lang/rust-clippy/issues/new
9+
10+
note: Clippy version: clippy 0.1.62 (01d75b195 2022-05-13)
11+
12+
query stack during panic:
13+
#0 [analysis] running analysis passes on this crate
14+
end of query stack

tests/ui/unnecessary_to_owned.stderr

Lines changed: 10 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -445,69 +445,19 @@ error: unnecessary use of `to_vec`
445445
LL | let _ = [std::path::PathBuf::new()][..].to_vec().into_iter();
446446
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `[std::path::PathBuf::new()][..].iter().cloned()`
447447

448-
error: unnecessary use of `to_owned`
449-
--> $DIR/unnecessary_to_owned.rs:131:13
450-
|
451-
LL | let _ = [std::path::PathBuf::new()][..].to_owned().into_iter();
452-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `[std::path::PathBuf::new()][..].iter().cloned()`
448+
thread 'rustc' panicked at 'index out of bounds: the len is 0 but the index is 0', clippy_lints/src/path_from_format.rs:39:41
449+
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
453450

454-
error: unnecessary use of `to_vec`
455-
--> $DIR/unnecessary_to_owned.rs:133:13
456-
|
457-
LL | let _ = IntoIterator::into_iter(slice.to_vec());
458-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `slice.iter().copied()`
451+
error: internal compiler error: unexpected panic
459452

460-
error: unnecessary use of `to_owned`
461-
--> $DIR/unnecessary_to_owned.rs:134:13
462-
|
463-
LL | let _ = IntoIterator::into_iter(slice.to_owned());
464-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `slice.iter().copied()`
453+
note: the compiler unexpectedly panicked. this is a bug.
465454

466-
error: unnecessary use of `to_vec`
467-
--> $DIR/unnecessary_to_owned.rs:135:13
468-
|
469-
LL | let _ = IntoIterator::into_iter([std::path::PathBuf::new()][..].to_vec());
470-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `[std::path::PathBuf::new()][..].iter().cloned()`
471-
472-
error: unnecessary use of `to_owned`
473-
--> $DIR/unnecessary_to_owned.rs:136:13
474-
|
475-
LL | let _ = IntoIterator::into_iter([std::path::PathBuf::new()][..].to_owned());
476-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `[std::path::PathBuf::new()][..].iter().cloned()`
455+
note: we would appreciate a bug report: https://github.com/rust-lang/rust-clippy/issues/new
477456

478-
error: unnecessary use of `to_vec`
479-
--> $DIR/unnecessary_to_owned.rs:198:14
480-
|
481-
LL | for t in file_types.to_vec() {
482-
| ^^^^^^^^^^^^^^^^^^^
483-
|
484-
help: use
485-
|
486-
LL | for t in file_types {
487-
| ~~~~~~~~~~
488-
help: remove this `&`
489-
|
490-
LL - let path = match get_file_path(&t) {
491-
LL + let path = match get_file_path(t) {
492-
|
493-
494-
error: unnecessary use of `to_vec`
495-
--> $DIR/unnecessary_to_owned.rs:221:14
496-
|
497-
LL | let _ = &["x"][..].to_vec().into_iter();
498-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `["x"][..].iter().cloned()`
499-
500-
error: unnecessary use of `to_vec`
501-
--> $DIR/unnecessary_to_owned.rs:226:14
502-
|
503-
LL | let _ = &["x"][..].to_vec().into_iter();
504-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `["x"][..].iter().copied()`
505-
506-
error: unnecessary use of `to_string`
507-
--> $DIR/unnecessary_to_owned.rs:273:24
508-
|
509-
LL | Box::new(build(y.to_string()))
510-
| ^^^^^^^^^^^^^ help: use: `y`
457+
note: Clippy version: clippy 0.1.62 (01d75b195 2022-05-13)
511458

512-
error: aborting due to 78 previous errors
459+
query stack during panic:
460+
#0 [analysis] running analysis passes on this crate
461+
end of query stack
462+
error: aborting due to 69 previous errors
513463

0 commit comments

Comments
 (0)