From f518c78ea686b92b56c6b7721c6600de80c0b85a Mon Sep 17 00:00:00 2001 From: John Nunley Date: Tue, 28 May 2024 18:45:08 -0700 Subject: [PATCH 1/2] m: Fix new nightly errors - Use i32::MAX instead of std::i32::MAX - Add "expected cfg" lints to Cargo.toml Signed-off-by: John Nunley --- Cargo.toml | 3 +++ src/epoll.rs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 6864b51..d584f45 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,6 +17,9 @@ exclude = ["/.*"] [package.metadata.docs.rs] rustdoc-args = ["--cfg", "docsrs"] +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(docsrs)', 'cfg(polling_test_poll_backend)', 'cfg(polling_test_epoll_pipe)'] } + [dependencies] cfg-if = "1" tracing = { version = "0.1.37", default-features = false } diff --git a/src/epoll.rs b/src/epoll.rs index 2f1a661..331874b 100644 --- a/src/epoll.rs +++ b/src/epoll.rs @@ -201,7 +201,7 @@ impl Poller { (_, Some(t)) if t == Duration::from_secs(0) => 0, (None, Some(t)) => { // Round up to a whole millisecond. - let mut ms = t.as_millis().try_into().unwrap_or(std::i32::MAX); + let mut ms = t.as_millis().try_into().unwrap_or(i32::MAX); if Duration::from_millis(ms as u64) < t { ms = ms.saturating_add(1); } From 476f4356f916f5fbcd7dbe1275138c7e0b59cf32 Mon Sep 17 00:00:00 2001 From: John Nunley Date: Tue, 28 May 2024 19:27:02 -0700 Subject: [PATCH 2/2] m: docsrs is OK Signed-off-by: John Nunley --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index d584f45..75a5fcf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ exclude = ["/.*"] rustdoc-args = ["--cfg", "docsrs"] [lints.rust] -unexpected_cfgs = { level = "warn", check-cfg = ['cfg(docsrs)', 'cfg(polling_test_poll_backend)', 'cfg(polling_test_epoll_pipe)'] } +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(polling_test_poll_backend)', 'cfg(polling_test_epoll_pipe)'] } [dependencies] cfg-if = "1"