You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I expected to see this happen: successful compilation because of the blanket impl<T> From<!> for T
Instead, this happened:
error[E0277]: `?` couldn't convert the error to `()`
--> src/main.rs:8:14
|
7 | fn main() -> Result<(), ()> {
| -------------- expected `()` because of this
8 | no_fail()?;
| ^ the trait `From<!>` is not implemented for `()`
|
= note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
= help: the following other types implement trait `FromResidual<R>`:
<Result<T, F> as FromResidual<Result<Infallible, E>>>
<Result<T, F> as FromResidual<Yeet<E>>>
= note: required for `Result<(), ()>` to implement `FromResidual<Result<Infallible, !>>`
For more information about this error, try `rustc --explain E0277`.
error: could not compile `tmp` due to previous error
I cannot really make sense of the error message, as it complains about a missing From impl. Maybe this is an issue with the Try implementation (try_trait_v2 does not change the error) but I cannot tell.
The text was updated successfully, but these errors were encountered:
However I did not see the #[rustc_reservation_impl] (this was not visible in the rustdoc, leading to my confusion). #64715 is the related issue, if anyone is interested.
Going to close this as this should be tracked by the other issue.
I tried this code:
I expected to see this happen: successful compilation because of the blanket
impl<T> From<!> for T
Instead, this happened:
Meta
rustc --version --verbose
:I cannot really make sense of the error message, as it complains about a missing
From
impl. Maybe this is an issue with theTry
implementation (try_trait_v2
does not change the error) but I cannot tell.The text was updated successfully, but these errors were encountered: