rust/tests/ui/return
Esteban Küber e565eeed78 Tweak E0277 when predicate comes indirectly from ?
When a `?` operation requires an `Into` conversion with additional bounds (like having a concrete error but wanting to convert to a trait object), we handle it speficically and provide the same kind of information we give other `?` related errors.

```
error[E0277]: `?` couldn't convert the error: `E: std::error::Error` is not satisfied
  --> $DIR/bad-question-mark-on-trait-object.rs:5:13
   |
LL | fn foo() -> Result<(), Box<dyn std::error::Error>> {
   |             -------------------------------------- required `E: std::error::Error` because of this
LL |     Ok(bar()?)
   |             ^ the trait `std::error::Error` is not implemented for `E`
   |
   = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
   = note: required for `Box<dyn std::error::Error>` to implement `From<E>`
```

Avoid talking about `FromResidual` when other more relevant information is being given, particularly from `rust_on_unimplemented`.
2025-02-20 18:15:39 +00:00
..
dont-suggest-through-inner-const.rs Don't skip inner const when looking for body for suggestion 2024-05-23 19:49:48 -04:00
dont-suggest-through-inner-const.stderr Don't skip inner const when looking for body for suggestion 2024-05-23 19:49:48 -04:00
infer-return-ty-for-fn-sig-issue-125488.fixed Fix a error suggestion for E0121 when using placeholder _ as return types on function signature. 2024-06-29 14:23:33 +08:00
infer-return-ty-for-fn-sig-issue-125488.rs Fix a error suggestion for E0121 when using placeholder _ as return types on function signature. 2024-06-29 14:23:33 +08:00
infer-return-ty-for-fn-sig-issue-125488.stderr Fix a error suggestion for E0121 when using placeholder _ as return types on function signature. 2024-06-29 14:23:33 +08:00
issue-64620.rs
issue-64620.stderr
issue-82612-return-mutable-reference.rs
issue-82612-return-mutable-reference.stderr
issue-86188-return-not-in-fn-body.rs
issue-86188-return-not-in-fn-body.stderr Tweak multispan rendering 2024-12-12 23:36:27 +00:00
ret-bang.rs Move 100 entries from tests/ui into subdirs 2024-05-20 19:55:59 -07:00
ret-non-nil.rs Move 100 entries from tests/ui into subdirs 2024-05-20 19:55:59 -07:00
ret-non-nil.stderr Move 100 entries from tests/ui into subdirs 2024-05-20 19:55:59 -07:00
return-disjoint-regions.rs Move 100 entries from tests/ui into subdirs 2024-05-20 19:55:59 -07:00
return-disjoint-regions.stderr Move 100 entries from tests/ui into subdirs 2024-05-20 19:55:59 -07:00
return-from-diverging.rs
return-from-diverging.stderr
return-from-residual-sugg-issue-125997.fixed Fixing span manipulation and indentation of the suggestion introduced by #126187 2024-08-25 20:30:06 +08:00
return-from-residual-sugg-issue-125997.rs Suggest adding Result return type for associated method in E0277. 2024-07-23 10:24:45 +08:00
return-from-residual-sugg-issue-125997.stderr Tweak E0277 when predicate comes indirectly from ? 2025-02-20 18:15:39 +00:00
return-impl-trait-bad.rs
return-impl-trait-bad.stderr
return-impl-trait.fixed
return-impl-trait.rs
return-impl-trait.stderr
return-match-array-const.rs
return-match-array-const.stderr Filter empty lines, comments and delimiters from previous to last multiline span rendering 2024-12-12 23:36:27 +00:00
return-nil.rs tests: remove //@ pretty-expanded usages 2024-11-26 02:50:48 +08:00
return-struct.rs
return-struct.stderr
return-ty-mismatch-note.rs tests: update tests for more conservative return ty mismatch note 2024-06-18 21:06:53 +00:00
return-ty-mismatch-note.stderr tests: update tests for more conservative return ty mismatch note 2024-06-18 21:06:53 +00:00
return-type.rs
return-type.stderr
return-unit-from-diverging.rs
return-unit-from-diverging.stderr
suggest-a-value.rs
suggest-a-value.stderr
tail-expr-as-potential-return.rs Use full expr span for return suggestion on type error/ambiguity 2024-06-30 23:11:54 -04:00
tail-expr-as-potential-return.stderr Tweak multispan rendering 2024-12-12 23:36:27 +00:00
tail-expr-if-as-return.rs feat: add unit test 2024-05-16 21:10:07 +08:00
tail-expr-if-as-return.stderr feat: add unit test 2024-05-16 21:10:07 +08:00