mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-30 12:07:40 +00:00
![]() 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`. |
||
---|---|---|
.. | ||
dont-suggest-through-inner-const.rs | ||
dont-suggest-through-inner-const.stderr | ||
infer-return-ty-for-fn-sig-issue-125488.fixed | ||
infer-return-ty-for-fn-sig-issue-125488.rs | ||
infer-return-ty-for-fn-sig-issue-125488.stderr | ||
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 | ||
ret-bang.rs | ||
ret-non-nil.rs | ||
ret-non-nil.stderr | ||
return-disjoint-regions.rs | ||
return-disjoint-regions.stderr | ||
return-from-diverging.rs | ||
return-from-diverging.stderr | ||
return-from-residual-sugg-issue-125997.fixed | ||
return-from-residual-sugg-issue-125997.rs | ||
return-from-residual-sugg-issue-125997.stderr | ||
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 | ||
return-nil.rs | ||
return-struct.rs | ||
return-struct.stderr | ||
return-ty-mismatch-note.rs | ||
return-ty-mismatch-note.stderr | ||
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 | ||
tail-expr-as-potential-return.stderr | ||
tail-expr-if-as-return.rs | ||
tail-expr-if-as-return.stderr |