Skip to content

Future breakage from use of Infallible and ! conflicting impls. #652

Description

@the8472

Hello, I want to give you a heads-up on behalf of the rust-lang project. A planned change will affect the volo-http crate in a future Rust version.

We are planning to make the Infallible type a type-alias to ! (the never type) in the future when the latter is stabilized. This has been documented for a long time and those plans are coming closer to stabilization (rust-lang/rust#155924).

crater-run report:

[INFO] checking volo-http-0.5.5 against try#1bdcb63291ccffc030f8223f6f978568dd240e3e for 155501-infallible-never-with-reservation
[...]
[INFO] [stdout] error[E0119]: conflicting implementations of trait `IntoResponse` for type `!`
[INFO] [stdout]   --> src/server/response/into_response.rs:61:1
[INFO] [stdout]    |
[INFO] [stdout] 55 |   impl IntoResponse for Infallible {
[INFO] [stdout]    |   -------------------------------- first implementation here
[INFO] [stdout] ...
[INFO] [stdout] 61 | / impl<T> IntoResponse for T
[INFO] [stdout] 62 | | where
[INFO] [stdout] 63 | |     T: TryInto<Body>,
[INFO] [stdout] 64 | |     T::Error: IntoResponse,
[INFO] [stdout]    | |___________________________^ conflicting implementation for `!`
[INFO] [stdout]    |
[INFO] [stdout]    = note: permitting this impl would forbid us from adding `impl<T> From<!> for T` later; see rust-lang/rust#64715 for details
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] error[E0119]: conflicting implementations of trait `IntoResponse` for type `!`
[INFO] [stdout]   --> src/server/response/into_response.rs:61:1
[INFO] [stdout]    |
[INFO] [stdout] 55 |   impl IntoResponse for Infallible {
[INFO] [stdout]    |   -------------------------------- first implementation here
[INFO] [stdout] ...
[INFO] [stdout] 61 | / impl<T> IntoResponse for T
[INFO] [stdout] 62 | | where
[INFO] [stdout] 63 | |     T: TryInto<Body>,
[INFO] [stdout] 64 | |     T::Error: IntoResponse,
[INFO] [stdout]    | |___________________________^ conflicting implementation for `!`
[INFO] [stdout]    |
[INFO] [stdout]    = note: permitting this impl would forbid us from adding `impl<T> From<!> for T` later; see rust-lang/rust#64715 for details
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] For more information about this error, try `rustc --explain E0119`.
[INFO] [stdout] 
[INFO] [stderr] error: could not compile `volo-http` (lib) due to 1 previous error
[INFO] [stderr] warning: build failed, waiting for other jobs to finish...
[INFO] [stdout] For more information about this error, try `rustc --explain E0119`.
[INFO] [stdout] 
[INFO] [stderr] error: could not compile `volo-http` (lib test) due to 1 previous error

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions