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
use tower::ServiceBuilder;
use tower_http::ServiceBuilderExt;
fn main() {
ServiceBuilder::new().trace_for_http();
}
I expected to see this happen: Compile succeeds
Instead, this happened:
$ cargo build
Compiling mytest v0.1.0 (/srv/home/user/temp/mytest)
error[E0599]: no method named `trace_for_http` found for struct `ServiceBuilder` in the current scope
--> src/main.rs:5:27
|
5 | ServiceBuilder::new().trace_for_http();
| ^^^^^^^^^^^^^^ method not found in `ServiceBuilder<Identity>`
warning: unused import: `tower_http::ServiceBuilderExt`
--> src/main.rs:2:5
|
2 | use tower_http::ServiceBuilderExt;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
For more information about this error, try `rustc --explain E0599`.
warning: `mytest` (bin "mytest") generated 1 warning
error: could not compile `mytest` (bin "mytest") due to 1 previous error; 1 warning emitted
If tower is manually pinned to 0.4.13 in Cargo.toml, then compile works fine.
I also found ServiceBuilder in tower 0.5.1 removes many cfg_attr from 0.4.13 (source), perhaps Rust considers that a major change so it only applies ServiceBuilderExt to ServiceBuilder in 0.4.x?
The text was updated successfully, but these errors were encountered:
Bug Report
ServiceBuilderExt may not extend ServiceBuilder
Version
tower = "0.5.1"
tower-http = { version = "0.5.2", features = ["util", "trace"] }
Platform
Linux laptop 6.1.0-25-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.106-3 (2024-08-26) x86_64 GNU/Linux
Description
I tried this code:
I expected to see this happen: Compile succeeds
Instead, this happened:
If tower is manually pinned to 0.4.13 in Cargo.toml, then compile works fine.
I also found
ServiceBuilder
in tower 0.5.1 removes manycfg_attr
from 0.4.13 (source), perhaps Rust considers that a major change so it only applies ServiceBuilderExt to ServiceBuilder in 0.4.x?The text was updated successfully, but these errors were encountered: