You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The compiler now generates similar code with and without the `with_ref`
cfg:
```rust
fn f(x: impl IntoIterator<Item = String>) {
for y in x { println!("{y}"); }
}
fn main() {
#[cfg(with_ref)]
let a = ["foo", "bar"].iter().map(|&s| s.to_string());
#[cfg(not(with_ref))]
let a = ["foo", "bar"].iter().map(|s| s.to_string());
f(a);
}
```
The generated code is strictly identical with `-O`, and identical modulo
some minor reordering without.
Copy file name to clipboardExpand all lines: tests/ui/deprecated.stderr
+21-15Lines changed: 21 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -13,89 +13,95 @@ error: lint `clippy::extend_from_slice` has been removed: `Vec::extend_from_slic
13
13
LL | #![warn(clippy::extend_from_slice)]
14
14
| ^^^^^^^^^^^^^^^^^^^^^^^^^
15
15
16
-
error: lint `clippy::match_on_vec_items` has been removed: `clippy::indexing_slicing` covers indexing and slicing on `Vec<_>`
16
+
error: lint `clippy::inefficient_to_string` has been removed: compiler now generates identical code for both code variants
17
17
--> tests/ui/deprecated.rs:7:9
18
18
|
19
+
LL | #![warn(clippy::inefficient_to_string)]
20
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
21
+
22
+
error: lint `clippy::match_on_vec_items` has been removed: `clippy::indexing_slicing` covers indexing and slicing on `Vec<_>`
23
+
--> tests/ui/deprecated.rs:8:9
24
+
|
19
25
LL | #![warn(clippy::match_on_vec_items)]
20
26
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
21
27
22
28
error: lint `clippy::misaligned_transmute` has been removed: split into `clippy::cast_ptr_alignment` and `clippy::transmute_ptr_to_ptr`
23
-
--> tests/ui/deprecated.rs:8:9
29
+
--> tests/ui/deprecated.rs:9:9
24
30
|
25
31
LL | #![warn(clippy::misaligned_transmute)]
26
32
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
27
33
28
34
error: lint `clippy::option_map_or_err_ok` has been removed: `clippy::manual_ok_or` covers this case
29
-
--> tests/ui/deprecated.rs:9:9
35
+
--> tests/ui/deprecated.rs:10:9
30
36
|
31
37
LL | #![warn(clippy::option_map_or_err_ok)]
32
38
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
33
39
34
40
error: lint `clippy::pub_enum_variant_names` has been removed: `clippy::enum_variant_names` now covers this case via the `avoid-breaking-exported-api` config
35
-
--> tests/ui/deprecated.rs:10:9
41
+
--> tests/ui/deprecated.rs:11:9
36
42
|
37
43
LL | #![warn(clippy::pub_enum_variant_names)]
38
44
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
39
45
40
46
error: lint `clippy::range_step_by_zero` has been removed: `Iterator::step_by(0)` now panics and is no longer an infinite iterator
41
-
--> tests/ui/deprecated.rs:11:9
47
+
--> tests/ui/deprecated.rs:12:9
42
48
|
43
49
LL | #![warn(clippy::range_step_by_zero)]
44
50
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
45
51
46
52
error: lint `clippy::regex_macro` has been removed: the `regex!` macro was removed from the regex crate in 2018
47
-
--> tests/ui/deprecated.rs:12:9
53
+
--> tests/ui/deprecated.rs:13:9
48
54
|
49
55
LL | #![warn(clippy::regex_macro)]
50
56
| ^^^^^^^^^^^^^^^^^^^
51
57
52
58
error: lint `clippy::replace_consts` has been removed: `min_value` and `max_value` are now deprecated
53
-
--> tests/ui/deprecated.rs:13:9
59
+
--> tests/ui/deprecated.rs:14:9
54
60
|
55
61
LL | #![warn(clippy::replace_consts)]
56
62
| ^^^^^^^^^^^^^^^^^^^^^^
57
63
58
64
error: lint `clippy::should_assert_eq` has been removed: `assert!(a == b)` can now print the values the same way `assert_eq!(a, b) can
59
-
--> tests/ui/deprecated.rs:14:9
65
+
--> tests/ui/deprecated.rs:15:9
60
66
|
61
67
LL | #![warn(clippy::should_assert_eq)]
62
68
| ^^^^^^^^^^^^^^^^^^^^^^^^
63
69
64
70
error: lint `clippy::string_to_string` has been removed: `clippy:implicit_clone` covers those cases
65
-
--> tests/ui/deprecated.rs:15:9
71
+
--> tests/ui/deprecated.rs:16:9
66
72
|
67
73
LL | #![warn(clippy::string_to_string)]
68
74
| ^^^^^^^^^^^^^^^^^^^^^^^^
69
75
70
76
error: lint `clippy::unsafe_vector_initialization` has been removed: the suggested alternative could be substantially slower
error: lint `clippy::unstable_as_mut_slice` has been removed: `Vec::as_mut_slice` is now stable
77
-
--> tests/ui/deprecated.rs:17:9
83
+
--> tests/ui/deprecated.rs:18:9
78
84
|
79
85
LL | #![warn(clippy::unstable_as_mut_slice)]
80
86
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
81
87
82
88
error: lint `clippy::unstable_as_slice` has been removed: `Vec::as_slice` is now stable
83
-
--> tests/ui/deprecated.rs:18:9
89
+
--> tests/ui/deprecated.rs:19:9
84
90
|
85
91
LL | #![warn(clippy::unstable_as_slice)]
86
92
| ^^^^^^^^^^^^^^^^^^^^^^^^^
87
93
88
94
error: lint `clippy::unused_collect` has been removed: `Iterator::collect` is now marked as `#[must_use]`
89
-
--> tests/ui/deprecated.rs:19:9
95
+
--> tests/ui/deprecated.rs:20:9
90
96
|
91
97
LL | #![warn(clippy::unused_collect)]
92
98
| ^^^^^^^^^^^^^^^^^^^^^^
93
99
94
100
error: lint `clippy::wrong_pub_self_convention` has been removed: `clippy::wrong_self_convention` now covers this case via the `avoid-breaking-exported-api` config
0 commit comments