2022-08-31 08:24:45 -05:00
|
|
|
error: `into_iter` call on an empty collection
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/iter_on_empty_collections.rs:5:16
|
2022-08-31 08:24:45 -05:00
|
|
|
|
|
|
|
|
LL | assert_eq!([].into_iter().next(), Option::<i32>::None);
|
|
|
|
| ^^^^^^^^^^^^^^ help: try: `std::iter::empty()`
|
|
|
|
|
|
|
|
|
= note: `-D clippy::iter-on-empty-collections` implied by `-D warnings`
|
2023-08-01 07:02:21 -05:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::iter_on_empty_collections)]`
|
2022-08-31 08:24:45 -05:00
|
|
|
|
|
|
|
error: `iter_mut` call on an empty collection
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/iter_on_empty_collections.rs:6:16
|
2022-08-31 08:24:45 -05:00
|
|
|
|
|
|
|
|
LL | assert_eq!([].iter_mut().next(), Option::<&mut i32>::None);
|
|
|
|
| ^^^^^^^^^^^^^ help: try: `std::iter::empty()`
|
|
|
|
|
|
|
|
error: `iter` call on an empty collection
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/iter_on_empty_collections.rs:7:16
|
2022-08-31 08:24:45 -05:00
|
|
|
|
|
|
|
|
LL | assert_eq!([].iter().next(), Option::<&i32>::None);
|
|
|
|
| ^^^^^^^^^ help: try: `std::iter::empty()`
|
|
|
|
|
|
|
|
error: `into_iter` call on an empty collection
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/iter_on_empty_collections.rs:8:16
|
2022-08-31 08:24:45 -05:00
|
|
|
|
|
|
|
|
LL | assert_eq!(None.into_iter().next(), Option::<i32>::None);
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: try: `std::iter::empty()`
|
|
|
|
|
|
|
|
error: `iter_mut` call on an empty collection
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/iter_on_empty_collections.rs:9:16
|
2022-08-31 08:24:45 -05:00
|
|
|
|
|
|
|
|
LL | assert_eq!(None.iter_mut().next(), Option::<&mut i32>::None);
|
|
|
|
| ^^^^^^^^^^^^^^^ help: try: `std::iter::empty()`
|
|
|
|
|
|
|
|
error: `iter` call on an empty collection
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/iter_on_empty_collections.rs:10:16
|
2022-08-31 08:24:45 -05:00
|
|
|
|
|
|
|
|
LL | assert_eq!(None.iter().next(), Option::<&i32>::None);
|
|
|
|
| ^^^^^^^^^^^ help: try: `std::iter::empty()`
|
|
|
|
|
2024-05-30 03:49:05 -05:00
|
|
|
error: `iter` call on an empty collection
|
|
|
|
--> tests/ui/iter_on_empty_collections.rs:28:66
|
|
|
|
|
|
|
|
|
LL | for i in smth.as_ref().map_or([].iter(), |s| s.iter()).chain([].iter()) {
|
|
|
|
| ^^^^^^^^^ help: try: `std::iter::empty()`
|
|
|
|
|
|
|
|
error: aborting due to 7 previous errors
|
2022-08-31 08:24:45 -05:00
|
|
|
|