diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2023-01-23 14:46:30 +0000 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2023-01-23 14:47:00 +0000 |
| commit | 62aff3bbc75468bedf751b01a746e52886be760c (patch) | |
| tree | e7fce50872f29f4aae006b9e67b430e93db8426b | |
| parent | df81147b51f95441c8db74eda92b5c5fadecb20e (diff) | |
| download | rust-62aff3bbc75468bedf751b01a746e52886be760c.tar.gz rust-62aff3bbc75468bedf751b01a746e52886be760c.zip | |
tweak wording
| -rw-r--r-- | compiler/rustc_hir_typeck/src/demand.rs | 3 | ||||
| -rw-r--r-- | tests/ui/type/type-check/coerce-result-return-value-2.stderr | 4 | ||||
| -rw-r--r-- | tests/ui/type/type-check/coerce-result-return-value.stderr | 8 |
3 files changed, 8 insertions, 7 deletions
diff --git a/compiler/rustc_hir_typeck/src/demand.rs b/compiler/rustc_hir_typeck/src/demand.rs index 97490194e25..3f185dfae02 100644 --- a/compiler/rustc_hir_typeck/src/demand.rs +++ b/compiler/rustc_hir_typeck/src/demand.rs @@ -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