Skip to content

Commit

Permalink
Update stderr files
Browse files Browse the repository at this point in the history
  • Loading branch information
hkmatsumoto committed Nov 14, 2020
1 parent 548b43b commit d9ac655
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
12 changes: 6 additions & 6 deletions tests/ui/map_flatten.stderr
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
error: called `map(..).flatten()` on an `Iterator`
--> $DIR/map_flatten.rs:15:46
--> $DIR/map_flatten.rs:16:46
|
LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(option_id).flatten().collect();
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `filter_map` instead: `.filter_map(option_id)`
|
= note: `-D clippy::map-flatten` implied by `-D warnings`

error: called `map(..).flatten()` on an `Iterator`
--> $DIR/map_flatten.rs:16:46
--> $DIR/map_flatten.rs:17:46
|
LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(option_id_ref).flatten().collect();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `filter_map` instead: `.filter_map(option_id_ref)`

error: called `map(..).flatten()` on an `Iterator`
--> $DIR/map_flatten.rs:17:46
--> $DIR/map_flatten.rs:18:46
|
LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(option_id_closure).flatten().collect();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `filter_map` instead: `.filter_map(option_id_closure)`

error: called `map(..).flatten()` on an `Iterator`
--> $DIR/map_flatten.rs:18:46
--> $DIR/map_flatten.rs:19:46
|
LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(|x| x.checked_add(1)).flatten().collect();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `filter_map` instead: `.filter_map(|x| x.checked_add(1))`

error: called `map(..).flatten()` on an `Iterator`
--> $DIR/map_flatten.rs:21:46
--> $DIR/map_flatten.rs:22:46
|
LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(|x| 0..x).flatten().collect();
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `flat_map` instead: `.flat_map(|x| 0..x)`

error: called `map(..).flatten()` on an `Option`
--> $DIR/map_flatten.rs:24:39
--> $DIR/map_flatten.rs:25:39
|
LL | let _: Option<_> = (Some(Some(1))).map(|x| x).flatten();
| ^^^^^^^^^^^^^^^^^^^^^ help: try using `and_then` instead: `.and_then(|x| x)`
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/option_option.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ LL | Struct { x: Option<Option<u8>> },
| ^^^^^^^^^^^^^^^^^^

error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases
--> $DIR/option_option.rs:78:14
--> $DIR/option_option.rs:76:14
|
LL | foo: Option<Option<Cow<'a, str>>>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
8 changes: 4 additions & 4 deletions tests/ui/or_fun_call.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -79,25 +79,25 @@ LL | let _ = stringy.unwrap_or("".to_owned());
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| "".to_owned())`

error: use of `unwrap_or` followed by a function call
--> $DIR/or_fun_call.rs:76:21
--> $DIR/or_fun_call.rs:77:21
|
LL | let _ = Some(1).unwrap_or(map[&1]);
| ^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| map[&1])`

error: use of `unwrap_or` followed by a function call
--> $DIR/or_fun_call.rs:78:21
--> $DIR/or_fun_call.rs:79:21
|
LL | let _ = Some(1).unwrap_or(map[&1]);
| ^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| map[&1])`

error: use of `or` followed by a function call
--> $DIR/or_fun_call.rs:102:35
--> $DIR/or_fun_call.rs:103:35
|
LL | let _ = Some("a".to_string()).or(Some("b".to_string()));
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `or_else(|| Some("b".to_string()))`

error: use of `or` followed by a function call
--> $DIR/or_fun_call.rs:106:10
--> $DIR/or_fun_call.rs:107:10
|
LL | .or(Some(Bar(b, Duration::from_secs(2))));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `or_else(|| Some(Bar(b, Duration::from_secs(2))))`
Expand Down
12 changes: 6 additions & 6 deletions tests/ui/try_err.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ LL | Err(err)?;
| ^^^^^^^^^ help: try this: `return Err(err.into())`

error: returning an `Err(_)` with the `?` operator
--> $DIR/try_err.rs:86:23
--> $DIR/try_err.rs:87:23
|
LL | Err(_) => Err(1)?,
| ^^^^^^^ help: try this: `return Err(1)`
Expand All @@ -40,7 +40,7 @@ LL | try_validation!(Ok::<_, i32>(5));
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: returning an `Err(_)` with the `?` operator
--> $DIR/try_err.rs:101:23
--> $DIR/try_err.rs:102:23
|
LL | Err(_) => Err(ret_one!())?,
| ^^^^^^^^^^^^^^^^ help: try this: `return Err(ret_one!())`
Expand All @@ -51,25 +51,25 @@ LL | try_validation_in_macro!(Ok::<_, i32>(5));
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: returning an `Err(_)` with the `?` operator
--> $DIR/try_err.rs:140:9
--> $DIR/try_err.rs:141:9
|
LL | Err(foo!())?;
| ^^^^^^^^^^^^ help: try this: `return Err(foo!())`

error: returning an `Err(_)` with the `?` operator
--> $DIR/try_err.rs:147:9
--> $DIR/try_err.rs:148:9
|
LL | Err(io::ErrorKind::WriteZero)?
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `return Poll::Ready(Err(io::ErrorKind::WriteZero.into()))`

error: returning an `Err(_)` with the `?` operator
--> $DIR/try_err.rs:149:9
--> $DIR/try_err.rs:150:9
|
LL | Err(io::Error::new(io::ErrorKind::InvalidInput, "error"))?
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `return Poll::Ready(Err(io::Error::new(io::ErrorKind::InvalidInput, "error")))`

error: returning an `Err(_)` with the `?` operator
--> $DIR/try_err.rs:157:9
--> $DIR/try_err.rs:158:9
|
LL | Err(io::ErrorKind::NotFound)?
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `return Poll::Ready(Some(Err(io::ErrorKind::NotFound.into())))`
Expand Down

0 comments on commit d9ac655

Please sign in to comment.