summaryrefslogtreecommitdiffstats
path: root/tests/ui/try-trait
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/try-trait')
-rw-r--r--tests/ui/try-trait/bad-interconversion.stderr4
-rw-r--r--tests/ui/try-trait/issue-32709.stderr6
2 files changed, 7 insertions, 3 deletions
diff --git a/tests/ui/try-trait/bad-interconversion.stderr b/tests/ui/try-trait/bad-interconversion.stderr
index d8b9431be..97fbbdbf8 100644
--- a/tests/ui/try-trait/bad-interconversion.stderr
+++ b/tests/ui/try-trait/bad-interconversion.stderr
@@ -4,7 +4,9 @@ error[E0277]: `?` couldn't convert the error to `u8`
LL | fn result_to_result() -> Result<u64, u8> {
| --------------- expected `u8` because of this
LL | Ok(Err(123_i32)?)
- | ^ the trait `From<i32>` is not implemented for `u8`
+ | ------------^ the trait `From<i32>` is not implemented for `u8`
+ | |
+ | this can't be annotated with `?` because it has type `Result<_, i32>`
|
= note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
= help: the following other types implement trait `From<T>`:
diff --git a/tests/ui/try-trait/issue-32709.stderr b/tests/ui/try-trait/issue-32709.stderr
index 94e8f9295..b155b3ff6 100644
--- a/tests/ui/try-trait/issue-32709.stderr
+++ b/tests/ui/try-trait/issue-32709.stderr
@@ -4,7 +4,9 @@ error[E0277]: `?` couldn't convert the error to `()`
LL | fn a() -> Result<i32, ()> {
| --------------- expected `()` because of this
LL | Err(5)?;
- | ^ the trait `From<{integer}>` is not implemented for `()`
+ | ------^ the trait `From<{integer}>` is not implemented for `()`
+ | |
+ | this can't be annotated with `?` because it has type `Result<_, {integer}>`
|
= note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
= help: the following other types implement trait `From<T>`:
@@ -19,6 +21,6 @@ LL | Err(5)?;
and 4 others
= note: required for `Result<i32, ()>` to implement `FromResidual<Result<Infallible, {integer}>>`
-error: aborting due to previous error
+error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.