rust/tests/ui/try-trait
Esteban Küber 6eb48824da Don't mention `FromResidual` on bad `?`
Unless `try_trait_v2` is enabled, don't mention that `FromResidual` isn't implemented for a specific type when the implicit `From` conversion of a `?` fails. For the end user on stable, `?` might as well be a compiler intrinsic, so we remove that note to avoid further confusion and allowing other parts of the error to be more prominent.

```
error[E0277]: `?` couldn't convert the error to `u8`
  --> $DIR/bad-interconversion.rs:4:20
   |
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`
   |        |
   |        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>`:
             `u8` implements `From<Char>`
             `u8` implements `From<bool>`
```
2025-02-18 17:34:16 +00:00
..
bad-interconversion.rs Remove `feature(control_flow_enum)` in tests 2024-09-25 19:00:19 -07:00
bad-interconversion.stderr Don't mention `FromResidual` on bad `?` 2025-02-18 17:34:16 +00:00
issue-32709.rs Move tests 2023-08-28 17:47:37 -03:00
issue-32709.stderr Don't mention `FromResidual` on bad `?` 2025-02-18 17:34:16 +00:00
option-to-result.rs
option-to-result.stderr Explicitly specify type parameter on FromResidual impls in stdlib. 2024-08-12 12:54:18 -05:00
try-as-monad.rs [AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives 2024-02-16 20:02:50 +00:00
try-on-option-diagnostics.rs [AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives 2024-02-16 20:02:50 +00:00
try-on-option-diagnostics.stderr
try-on-option.rs
try-on-option.stderr Start using `#[diagnostic::do_not_recommend]` in the standard library 2024-07-22 07:29:59 +02:00
try-operator-custom.rs Remove `feature(control_flow_enum)` in tests 2024-09-25 19:00:19 -07:00
try-operator-on-main.rs
try-operator-on-main.stderr Fixing span manipulation and indentation of the suggestion introduced by #126187 2024-08-25 20:30:06 +08:00
try-poll.rs [AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives 2024-02-16 20:02:50 +00:00
yeet-for-option.rs [AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives 2024-02-16 20:02:50 +00:00
yeet-for-result.rs [AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives 2024-02-16 20:02:50 +00:00