.must_apply_modulo_regions()
{
err.multipart_suggestion(
- "you can rely on the implicit conversion that `?` does to transform the error type",
+ "use `?` to coerce and return an appropriate `Err`, and wrap the resulting value \
+ in `Ok` so the expression remains of type `Result`",
vec![
(expr.span.shrink_to_lo(), "Ok(".to_string()),
(expr.span.shrink_to_hi(), "?)".to_string()),
|
= note: expected enum `Result<_, B>`
found enum `Result<_, A>`
-help: you can rely on the implicit conversion that `?` does to transform the error type
+help: use `?` to coerce and return an appropriate `Err`, and wrap the resulting value in `Ok` so the expression remains of type `Result`
|
LL | true => Ok(x?),
| +++ ++
|
= note: expected enum `Result<_, B>`
found enum `Result<_, A>`
-help: you can rely on the implicit conversion that `?` does to transform the error type
+help: use `?` to coerce and return an appropriate `Err`, and wrap the resulting value in `Ok` so the expression remains of type `Result`
|
LL | true => return Ok(x?),
| +++ ++
|
= note: expected enum `Result<_, B>`
found enum `Result<_, A>`
-help: you can rely on the implicit conversion that `?` does to transform the error type
+help: use `?` to coerce and return an appropriate `Err`, and wrap the resulting value in `Ok` so the expression remains of type `Result`
|
LL | Ok(x?)
| +++ ++
|
= note: expected enum `Result<_, B>`
found enum `Result<_, A>`
-help: you can rely on the implicit conversion that `?` does to transform the error type
+help: use `?` to coerce and return an appropriate `Err`, and wrap the resulting value in `Ok` so the expression remains of type `Result`
|
LL | return Ok(x?);
| +++ ++
|
= note: expected enum `Result<_, B>`
found enum `Result<_, A>`
-help: you can rely on the implicit conversion that `?` does to transform the error type
+help: use `?` to coerce and return an appropriate `Err`, and wrap the resulting value in `Ok` so the expression remains of type `Result`
|
LL | Ok(x?)
| +++ ++
|
= note: expected enum `Result<_, B>`
found enum `Result<_, A>`
-help: you can rely on the implicit conversion that `?` does to transform the error type
+help: use `?` to coerce and return an appropriate `Err`, and wrap the resulting value in `Ok` so the expression remains of type `Result`
|
LL | Ok(x?)
| +++ ++