tower 5.0 : error[E0015]: cannot call non-const fn `Identity::new` in constant functions
LeonGGX opened this issue · comments
LeonGGX commented
Switching from tower 0.4 to tower 0.5.0 in an application using axum, couldn't compile tower lib due to the following error :
Compiling tower v0.5.0
error[E0015]: cannot call non-const fn Identity::new
in constant functions
--> C:...\tower-0.5.0\src\builder\mod.rs:120:20
|
120 | layer: Identity::new(),
| ^^^^^^^^^^^^^^^
|
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
System : Windows 11
Rust : latest stable version.
Sean McArthur commented
See #784.
snaeil commented
The problem remained for me until I deleted the target
directory and Cargo.lock
.