mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-13 23:42:56 +00:00
tweak wording
This commit is contained in:
parent
df81147b51
commit
62aff3bbc7
@ -735,7 +735,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||
.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()),
|
||||
|
@ -9,7 +9,7 @@ LL | true => 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 => Ok(x?),
|
||||
| +++ ++
|
||||
@ -25,7 +25,7 @@ LL | true => return 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?),
|
||||
| +++ ++
|
||||
|
@ -8,7 +8,7 @@ LL | 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?)
|
||||
| +++ ++
|
||||
@ -23,7 +23,7 @@ LL | return 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?);
|
||||
| +++ ++
|
||||
@ -39,7 +39,7 @@ LL | 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?)
|
||||
| +++ ++
|
||||
@ -55,7 +55,7 @@ LL | 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?)
|
||||
| +++ ++
|
||||
|
Loading…
Reference in New Issue
Block a user