Skip to content

Rust 1.66 broke warp impl Reply on return types #107729

Open
@jxs

Description

@jxs

Hi there,
we just noticed on warp CI that one of the examples was broken (we have #![deny(warnings)] for the examples). The output is as follows:

warning: opaque type `impl warp::Filter + warp::filter::FilterBase<Extract = impl Reply, Error = Rejection> + Clone` does not satisfy its associated type bounds
  --> examples/todos.rs:39:22
   |
39 |     ) -> impl Filter<Extract = impl warp::Reply, Error = warp::Rejection> + Clone {
   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
  ::: /home/jxs/dev/oss/warp/src/filter/mod.rs:40:19
   |
40 |     type Extract: Tuple; // + Send;
   |                   ----- this associated type bound is unsatisfied for `impl Reply`
   |
   = note: `#[warn(opaque_hidden_inferred_bound)]` on by default
help: add this bound
   |
39 |     ) -> impl Filter<Extract = impl warp::Reply + warp::generic::Tuple, Error = warp::Rejection> + Clone {
   |                                                 ++++++++++++++++++++++

warning: opaque type `impl warp::Filter + warp::filter::FilterBase<Extract = impl Reply, Error = Rejection> + Clone` does not satisfy its associated type bounds
  --> examples/todos.rs:49:22
   |
49 |     ) -> impl Filter<Extract = impl warp::Reply, Error = warp::Rejection> + Clone {
   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
  ::: /home/jxs/dev/oss/warp/src/filter/mod.rs:40:19
   |
40 |     type Extract: Tuple; // + Send;
   |                   ----- this associated type bound is unsatisfied for `impl Reply`
   |
help: add this bound
   |
49 |     ) -> impl Filter<Extract = impl warp::Reply + warp::generic::Tuple, Error = warp::Rejection> + Clone {
   |                                                 ++++++++++++++++++++++

warning: opaque type `impl warp::Filter + warp::filter::FilterBase<Extract = impl Reply, Error = Rejection> + Clone` does not satisfy its associated type bounds
  --> examples/todos.rs:60:22
   |
60 |     ) -> impl Filter<Extract = impl warp::Reply, Error = warp::Rejection> + Clone {
   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
  ::: /home/jxs/dev/oss/warp/src/filter/mod.rs:40:19
   |
40 |     type Extract: Tuple; // + Send;
   |                   ----- this associated type bound is unsatisfied for `impl Reply`
   |
help: add this bound
   |
60 |     ) -> impl Filter<Extract = impl warp::Reply + warp::generic::Tuple, Error = warp::Rejection> + Clone {
   |                                                 ++++++++++++++++++++++

warning: opaque type `impl warp::Filter + warp::filter::FilterBase<Extract = impl Reply, Error = Rejection> + Clone` does not satisfy its associated type bounds
  --> examples/todos.rs:71:22
   |
71 |     ) -> impl Filter<Extract = impl warp::Reply, Error = warp::Rejection> + Clone {
   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
  ::: /home/jxs/dev/oss/warp/src/filter/mod.rs:40:19
   |
40 |     type Extract: Tuple; // + Send;
   |                   ----- this associated type bound is unsatisfied for `impl Reply`
   |
help: add this bound
   |
71 |     ) -> impl Filter<Extract = impl warp::Reply + warp::generic::Tuple, Error = warp::Rejection> + Clone {
   |                                                 ++++++++++++++++++++++

warning: opaque type `impl warp::Filter + warp::filter::FilterBase<Extract = impl Reply, Error = Rejection> + Clone` does not satisfy its associated type bounds
  --> examples/todos.rs:82:22
   |
82 |     ) -> impl Filter<Extract = impl warp::Reply, Error = warp::Rejection> + Clone {
   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
  ::: /home/jxs/dev/oss/warp/src/filter/mod.rs:40:19
   |
40 |     type Extract: Tuple; // + Send;
   |                   ----- this associated type bound is unsatisfied for `impl Reply`
   |
help: add this bound
   |
82 |     ) -> impl Filter<Extract = impl warp::Reply + warp::generic::Tuple, Error = warp::Rejection> + Clone {
   |                                                 ++++++++++++++++++++++

It seems to have been introduced with Rust version 1.66 as with 1.65 the example compiles fine. I also tried with the latest nightly (cargo 1.69.0-nightly (e84a7928d 2023-01-31)) which still reproduces the problem. This feels like a bug as it being a warning doesn't provide help, btw warp::generic::Tuple is private.
The todos example should work as a MRE, but if required I can try to provide a simpler use case.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.P-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions