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

Build fails with -Zbuild-std #771

Closed
asomers opened this issue Jun 14, 2024 · 2 comments
Closed

Build fails with -Zbuild-std #771

asomers opened this issue Jun 14, 2024 · 2 comments
Labels
A-ready-cache Area: The tower "ready_cache" middleware C-bug Category: This is a bug.

Comments

@asomers
Copy link

asomers commented Jun 14, 2024

Attempting to build tower for an architecture that isn't available via rustup, using -Zbuild-std, will fail. For example:

> cargo check -Zbuild-std --all-features --target aarch64-unknown-freebsd
    Checking tower v0.4.13 (/usr/home/somers/src/rust/tower/tower)
error[E0107]: struct takes 3 generic arguments but 2 generic arguments were supplied
  --> tower/src/ready_cache/cache.rs:65:25
   |
65 |     pending_cancel_txs: IndexMap<K, CancelTx>,
   |                         ^^^^^^^^ -  -------- supplied 2 generic arguments
   |                         |
   |                         expected 3 generic arguments
   |
note: struct defined here, with 3 generic parameters: `K`, `V`, `S`
  --> /home/somers/.cargo/registry/src/index.crates.io-6f17d22bba15001f/indexmap-1.9.3/src/map.rs:76:12
   |
76 | pub struct IndexMap<K, V, S> {
   |            ^^^^^^^^ -  -  -
help: add missing generic argument
   |
65 |     pending_cancel_txs: IndexMap<K, CancelTx, S>,
   |                                             +++

This is due to a bug in IndexMap, and it's already been fixed. It's already been reported in IndexMap, too. The solutions are either:

  • Upgrade to indexmap v2, or
  • Enable the std feature of indexmap

See also indexmap-rs/indexmap#289

@tobz
Copy link
Member

tobz commented Jul 20, 2024

This should be resolved when we publish the next release, which will include #741.

@tobz tobz added C-bug Category: This is a bug. A-ready-cache Area: The tower "ready_cache" middleware S-blocked Status: marked as blocked ❌ on something else such as a PR or other implementation work. labels Jul 20, 2024
@tobz
Copy link
Member

tobz commented Aug 13, 2024

This should be resolved as of [email protected].

@tobz tobz removed the S-blocked Status: marked as blocked ❌ on something else such as a PR or other implementation work. label Aug 13, 2024
@tobz tobz closed this as completed Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ready-cache Area: The tower "ready_cache" middleware C-bug Category: This is a bug.
Projects
None yet
Development

No branches or pull requests

2 participants