Skip to content

Commit 48538ed

Browse files
author
Ryan van Polen
committed
Updated feature flag and output of clippy/tests/ui/map_flatten*
1 parent 4c2d3bc commit 48538ed

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

src/tools/clippy/tests/ui/map_flatten.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![warn(clippy::map_flatten)]
2-
#![feature(result_flattening)]
2+
33
//@no-rustfix
44
// issue #8506, multi-line
55
#[rustfmt::skip]

src/tools/clippy/tests/ui/map_flatten_fixable.fixed

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![feature(result_flattening)]
21
#![allow(
32
clippy::let_underscore_untyped,
43
clippy::missing_docs_in_private_items,

src/tools/clippy/tests/ui/map_flatten_fixable.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![feature(result_flattening)]
21
#![allow(
32
clippy::let_underscore_untyped,
43
clippy::missing_docs_in_private_items,

src/tools/clippy/tests/ui/map_flatten_fixable.stderr

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: called `map(..).flatten()` on `Iterator`
2-
--> tests/ui/map_flatten_fixable.rs:17:47
2+
--> tests/ui/map_flatten_fixable.rs:16:47
33
|
44
LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(option_id).flatten().collect();
55
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `filter_map` and remove the `.flatten()`: `filter_map(option_id)`
@@ -8,43 +8,43 @@ LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(option_id).flatten().coll
88
= help: to override `-D warnings` add `#[allow(clippy::map_flatten)]`
99

1010
error: called `map(..).flatten()` on `Iterator`
11-
--> tests/ui/map_flatten_fixable.rs:19:47
11+
--> tests/ui/map_flatten_fixable.rs:18:47
1212
|
1313
LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(option_id_ref).flatten().collect();
1414
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `filter_map` and remove the `.flatten()`: `filter_map(option_id_ref)`
1515

1616
error: called `map(..).flatten()` on `Iterator`
17-
--> tests/ui/map_flatten_fixable.rs:21:47
17+
--> tests/ui/map_flatten_fixable.rs:20:47
1818
|
1919
LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(option_id_closure).flatten().collect();
2020
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `filter_map` and remove the `.flatten()`: `filter_map(option_id_closure)`
2121

2222
error: called `map(..).flatten()` on `Iterator`
23-
--> tests/ui/map_flatten_fixable.rs:23:47
23+
--> tests/ui/map_flatten_fixable.rs:22:47
2424
|
2525
LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(|x| x.checked_add(1)).flatten().collect();
2626
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `filter_map` and remove the `.flatten()`: `filter_map(|x| x.checked_add(1))`
2727

2828
error: called `map(..).flatten()` on `Iterator`
29-
--> tests/ui/map_flatten_fixable.rs:27:47
29+
--> tests/ui/map_flatten_fixable.rs:26:47
3030
|
3131
LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(|x| 0..x).flatten().collect();
3232
| ^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|x| 0..x)`
3333

3434
error: called `map(..).flatten()` on `Option`
35-
--> tests/ui/map_flatten_fixable.rs:31:40
35+
--> tests/ui/map_flatten_fixable.rs:30:40
3636
|
3737
LL | let _: Option<_> = (Some(Some(1))).map(|x| x).flatten();
3838
| ^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|x| x)`
3939

4040
error: called `map(..).flatten()` on `Result`
41-
--> tests/ui/map_flatten_fixable.rs:35:42
41+
--> tests/ui/map_flatten_fixable.rs:34:42
4242
|
4343
LL | let _: Result<_, &str> = (Ok(Ok(1))).map(|x| x).flatten();
4444
| ^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|x| x)`
4545

4646
error: called `map(..).flatten()` on `Iterator`
47-
--> tests/ui/map_flatten_fixable.rs:45:10
47+
--> tests/ui/map_flatten_fixable.rs:44:10
4848
|
4949
LL | .map(|n| match n {
5050
| __________^
@@ -74,7 +74,7 @@ LL ~ });
7474
|
7575

7676
error: called `map(..).flatten()` on `Option`
77-
--> tests/ui/map_flatten_fixable.rs:66:10
77+
--> tests/ui/map_flatten_fixable.rs:65:10
7878
|
7979
LL | .map(|_| {
8080
| __________^

0 commit comments

Comments
 (0)