Skip to content

Commit 25f58d3

Browse files
committed
cargo dev bless
1 parent b3608f3 commit 25f58d3

File tree

6 files changed

+21
-118
lines changed

6 files changed

+21
-118
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`

tests/ui/unnecessary_iter_cloned.stderr

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,3 @@ help: remove this `&`
3030
LL - let other = match get_file_path(&t) {
3131
LL + let other = match get_file_path(t) {
3232
|
33-
34-
error: aborting due to 2 previous errors
35-

tests/ui/unnecessary_to_owned.stderr

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -445,36 +445,6 @@ 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()`
453-
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()`
459-
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()`
465-
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()`
477-
478448
error: unnecessary use of `to_vec`
479449
--> $DIR/unnecessary_to_owned.rs:198:14
480450
|
@@ -510,4 +480,3 @@ LL | Box::new(build(y.to_string()))
510480
| ^^^^^^^^^^^^^ help: use: `y`
511481

512482
error: aborting due to 78 previous errors
513-

0 commit comments

Comments
 (0)