Skip to content

Tonic master branch builds on 1.52 but not 1.51 #85659

Description

@davidpdrsn

I recently worked on some changes to tonic. The changes work fine on Rust 1.52 (the version I was on when I wrote the changes) but I've since discovered that things don't compile on Rust 1.51. I see an error like this:

error[E0391]: cycle detected when computing the bounds for type parameter `T`
   --> /Users/david.pedersen/dev/major/tonic/target/debug/build/tonic-reflection-8e8e4b3f5942cb14/out/grpc.reflection.v1alpha.rs:185:43
    |
185 |                 Response = http::Response<T::ResponseBody>,
    |                                           ^^^^^^^^^^^^^^^
    |
    = note: ...which again requires computing the bounds for type parameter `T`, completing the cycle
note: cycle used when computing explicit predicates of `proto::server_reflection_client::<impl at /Users/david.pedersen/dev/major/tonic/target/debug/build/tonic-reflection-8e8e4b3f5942cb14/out/grpc.reflection.v1alpha.rs:166:5: 215:6>::with_interceptor`
   --> /Users/david.pedersen/dev/major/tonic/target/debug/build/tonic-reflection-8e8e4b3f5942cb14/out/grpc.reflection.v1alpha.rs:185:43
    |
185 |                 Response = http::Response<T::ResponseBody>,

I'm not knowingly doing anything that requires Rust 1.52 so find this error a bit surprising. Could it be a bug in rustc?

Reproduction:

$ git clone https://github.com/hyperium/tonic.git
$ cd tonic
$ cargo +1.51 check -p examples

I expected to see this happen: Things should build on 1.51 as well as 1.52.

Instead, this happened: Doesn't build on 1.51, does build on 1.52.

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

    C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions