Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix compile error when tower not updated in Cargo.lock #611

Closed
wants to merge 2 commits into from

Conversation

tdyas
Copy link
Contributor

@tdyas tdyas commented Apr 24, 2021

Motivation

Fix the following compile error caused by the version of tower in Cargo.lock not having to be at least v0.4.6:

error[E0599]: no method named `layer_fn` found for struct `ServiceBuilder<tower::layer::util::Identity>` in the current scope
  --> tonic/src/transport/service/connection.rs:54:14
   |
54 |             .layer_fn(|s| AddOrigin::new(s, endpoint.uri.clone()))
   |              ^^^^^^^^ method not found in `ServiceBuilder<tower::layer::util::Identity>`

Since the existing version in tonic's Cargo.toml is v0.4.4, cargo did not know to update that dependency automatically if the Tonic developer has an older version in Cargo.lock. Since Tonic is a library, Cargo.lock is not checked in and can vary between developers.

Solution

Specify v0.4.6 for tower to ensure layer_fn is available.

@tdyas tdyas changed the title fix compile error when tower not updated fix compile error when tower not updated in Cargo.lock Apr 24, 2021
@davidpdrsn
Copy link
Member

This was fixed as part of #606

@davidpdrsn davidpdrsn closed this Apr 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants