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

Update indexmap dependency & fix compiler warnings #758

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
pull_request: {}

env:
MSRV: 1.49.0
MSRV: 1.63.0

jobs:
check-stable:
Expand Down
7 changes: 3 additions & 4 deletions tower/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ clients and servers.
categories = ["asynchronous", "network-programming"]
keywords = ["io", "async", "non-blocking", "futures", "service"]
edition = "2018"
rust-version = "1.49.0"
rust-version = "1.63.0"

[features]

Expand Down Expand Up @@ -69,9 +69,9 @@ tower-layer = { version = "0.3.1", path = "../tower-layer" }
tower-service = { version = "0.3.1", path = "../tower-service" }

futures-core = { version = "0.3", optional = true }
futures-util = { version = "0.3", default-features = false, features = ["alloc"], optional = true }
futures-util = { version = "0.3.22", default-features = false, features = ["alloc"], optional = true }
hdrhistogram = { version = "7.0", optional = true, default-features = false }
indexmap = { version = "1.0.2", optional = true }
indexmap = { version = "2.0.2", optional = true }
slab = { version = "0.4", optional = true }
tokio = { version = "1.6", optional = true, features = ["sync"] }
tokio-stream = { version = "0.1.0", optional = true }
Expand All @@ -91,7 +91,6 @@ tower-test = { version = "0.4", path = "../tower-test" }
tracing = { version = "0.1.2", default-features = false, features = ["std"] }
tracing-subscriber = { version = "0.3", default-features = false, features = ["fmt", "ansi"] }
http = "0.2"
lazy_static = "1.4.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is needed to fix the minimal version used in tests, per #670, or else you get:

error: cannot find macro `__lazy_static_internal` in this scope
  --> [...]/sharded-slab-0.1.1/src/tid.rs:32:1
   |
32 | / lazy_static! {
33 | |     static ref REGISTRY: Registry = Registry {
34 | |         next: AtomicUsize::new(0),
35 | |         free: Mutex::new(VecDeque::new()),
36 | |     };
37 | | }
   | |_^
   |
   = note: this error originates in the macro `lazy_static` (in Nightly builds, run with -Z macro-backtrace for more info)

rand = { version = "0.8", features = ["small_rng"] }
quickcheck = "1"

Expand Down
4 changes: 2 additions & 2 deletions tower/src/ready_cache/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use super::error;
use futures_core::Stream;
use futures_util::{stream::FuturesUnordered, task::AtomicWaker};
pub use indexmap::Equivalent;
use indexmap::IndexMap;
use indexmap::{map::MutableKeys as _, IndexMap};
use std::fmt;
use std::future::Future;
use std::hash::Hash;
Expand Down Expand Up @@ -194,7 +194,7 @@ where

/// Obtains a mutable reference to a service in the ready set by index.
pub fn get_ready_index_mut(&mut self, idx: usize) -> Option<(&mut K, &mut S)> {
self.ready.get_index_mut(idx).map(|(k, v)| (k, &mut v.0))
self.ready.get_index_mut2(idx).map(|(k, v)| (k, &mut v.0))
}

/// Returns an iterator over the ready keys and services.
Expand Down
2 changes: 1 addition & 1 deletion tower/src/util/call_all/ordered.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ impl<F: Future> common::Drive<F> for FuturesOrdered<F> {
}

fn push(&mut self, future: F) {
FuturesOrdered::push(self, future)
FuturesOrdered::push_back(self, future)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs futures-util v0.3.22 (or later).

}

fn poll(&mut self, cx: &mut Context<'_>) -> Poll<Option<F::Output>> {
Expand Down
2 changes: 1 addition & 1 deletion tower/src/util/rng.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ mod tests {
let mut r = HasherRng::default();
match super::sample_floyd2(&mut r, 2) {
[0, 1] | [1, 0] => (),
err => panic!("{err:?}"),
err => panic!("{:?}", err),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, the previous format would be fine if the crate upgraded to 2021 edition -- which it could do with the new MSRV, but that might be a bigger change than desired right now.

}
}
}
Loading