Fix min dependency versions. Update MSRV to 1.64.

Also includes a work-around for a buggy `format_args!` macro found in
rustc 1.67 and 1.68.

Resolves #2670.
This commit is contained in:
Sergio Benitez 2023-12-13 17:49:05 -08:00
parent 92a2559a9a
commit a59f3c4c1f
12 changed files with 29 additions and 19 deletions

View File

@ -8,7 +8,7 @@ readme = "../README.md"
keywords = ["rocket", "framework", "database", "pools"] keywords = ["rocket", "framework", "database", "pools"]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2021" edition = "2021"
rust-version = "1.56" rust-version = "1.64"
[lib] [lib]
proc-macro = true proc-macro = true

View File

@ -8,7 +8,7 @@ readme = "../README.md"
keywords = ["rocket", "framework", "database", "pools"] keywords = ["rocket", "framework", "database", "pools"]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2021" edition = "2021"
rust-version = "1.56" rust-version = "1.64"
[package.metadata.docs.rs] [package.metadata.docs.rs]
all-features = true all-features = true

View File

@ -10,7 +10,7 @@ readme = "README.md"
keywords = ["rocket", "framework", "templates", "templating", "engine"] keywords = ["rocket", "framework", "templates", "templating", "engine"]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2021" edition = "2021"
rust-version = "1.56" rust-version = "1.64"
[features] [features]
tera = ["tera_"] tera = ["tera_"]

View File

@ -8,7 +8,7 @@ readme = "../README.md"
keywords = ["rocket", "framework", "database", "pools"] keywords = ["rocket", "framework", "database", "pools"]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2021" edition = "2021"
rust-version = "1.56" rust-version = "1.64"
[lib] [lib]
proc-macro = true proc-macro = true

View File

@ -8,7 +8,7 @@ readme = "../README.md"
keywords = ["rocket", "framework", "database", "pools"] keywords = ["rocket", "framework", "database", "pools"]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2021" edition = "2021"
rust-version = "1.56" rust-version = "1.64"
[features] [features]
diesel_sqlite_pool = ["diesel/sqlite", "diesel/r2d2"] diesel_sqlite_pool = ["diesel/sqlite", "diesel/r2d2"]
@ -31,7 +31,7 @@ r2d2_postgres = { version = "0.18", optional = true }
rusqlite = { version = "0.29.0", optional = true } rusqlite = { version = "0.29.0", optional = true }
r2d2_sqlite = { version = "0.22.0", optional = true } r2d2_sqlite = { version = "0.22.0", optional = true }
memcache = { version = "0.15", optional = true } memcache = { version = "0.15.2", optional = true }
r2d2-memcache = { version = "0.6", optional = true } r2d2-memcache = { version = "0.6", optional = true }
[dependencies.rocket_sync_db_pools_codegen] [dependencies.rocket_sync_db_pools_codegen]

View File

@ -10,7 +10,7 @@ readme = "README.md"
keywords = ["rocket", "web", "framework", "websocket"] keywords = ["rocket", "web", "framework", "websocket"]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2021" edition = "2021"
rust-version = "1.56" rust-version = "1.64"
[features] [features]
default = ["tungstenite"] default = ["tungstenite"]

View File

@ -245,8 +245,8 @@ impl<'r, S> IoHandler for MessageStream<'r, S>
{ {
async fn io(self: Pin<Box<Self>>, io: IoStream) -> io::Result<()> { async fn io(self: Pin<Box<Self>>, io: IoStream) -> io::Result<()> {
let (mut sink, source) = DuplexStream::new(io, self.ws.config).await.split(); let (mut sink, source) = DuplexStream::new(io, self.ws.config).await.split();
let handler = Pin::into_inner(self).handler; let stream = (Pin::into_inner(self).handler)(source);
let mut stream = std::pin::pin!((handler)(source)); rocket::tokio::pin!(stream);
while let Some(msg) = stream.next().await { while let Some(msg) = stream.next().await {
let result = match msg { let result = match msg {
Ok(msg) => sink.send(msg).await, Ok(msg) => sink.send(msg).await,

View File

@ -10,7 +10,7 @@ readme = "../../README.md"
keywords = ["rocket", "web", "framework", "code", "generation"] keywords = ["rocket", "web", "framework", "code", "generation"]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2021" edition = "2021"
rust-version = "1.56" rust-version = "1.64"
[lib] [lib]
proc-macro = true proc-macro = true
@ -19,7 +19,7 @@ proc-macro = true
indexmap = "2" indexmap = "2"
quote = "1.0" quote = "1.0"
syn = { version = "2.0", features = ["full", "visit", "visit-mut", "extra-traits"] } syn = { version = "2.0", features = ["full", "visit", "visit-mut", "extra-traits"] }
proc-macro2 = "1.0.27" proc-macro2 = "1.0.60"
devise = "0.4" devise = "0.4"
rocket_http = { version = "0.6.0-dev", path = "../http/" } rocket_http = { version = "0.6.0-dev", path = "../http/" }
unicode-xid = "0.2" unicode-xid = "0.2"

View File

@ -13,7 +13,7 @@ keywords = ["rocket", "web", "framework", "http"]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
categories = ["web-programming"] categories = ["web-programming"]
edition = "2021" edition = "2021"
rust-version = "1.56" rust-version = "1.64"
[features] [features]
default = [] default = []
@ -38,7 +38,7 @@ log = "0.4"
ref-cast = "1.0" ref-cast = "1.0"
uncased = "0.9.6" uncased = "0.9.6"
either = "1" either = "1"
pear = "0.2.3" pear = "0.2.8"
pin-project-lite = "0.2" pin-project-lite = "0.2"
memchr = "2" memchr = "2"
stable-pattern = "0.1" stable-pattern = "0.1"

View File

@ -14,7 +14,7 @@ license = "MIT OR Apache-2.0"
build = "build.rs" build = "build.rs"
categories = ["web-programming::http-server"] categories = ["web-programming::http-server"]
edition = "2021" edition = "2021"
rust-version = "1.56" rust-version = "1.64"
[package.metadata.docs.rs] [package.metadata.docs.rs]
all-features = true all-features = true
@ -46,7 +46,7 @@ binascii = "0.1"
ref-cast = "1.0" ref-cast = "1.0"
atomic = "0.5" atomic = "0.5"
parking_lot = "0.12" parking_lot = "0.12"
ubyte = {version = "0.10", features = ["serde"] } ubyte = {version = "0.10.2", features = ["serde"] }
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
figment = { version = "0.10.6", features = ["toml", "env"] } figment = { version = "0.10.6", features = ["toml", "env"] }
rand = "0.8" rand = "0.8"
@ -56,7 +56,7 @@ indexmap = { version = "2", features = ["serde"] }
tempfile = "3" tempfile = "3"
async-trait = "0.1.43" async-trait = "0.1.43"
async-stream = "0.3.2" async-stream = "0.3.2"
multer = { version = "2", features = ["tokio-io"] } multer = { version = "3.0.0", features = ["tokio-io"] }
tokio-stream = { version = "0.1.6", features = ["signal", "time"] } tokio-stream = { version = "0.1.6", features = ["signal", "time"] }
state = "0.6" state = "0.6"

View File

@ -1,5 +1,11 @@
fn main() { fn main() {
if let Some(true) = version_check::is_feature_flaggable() { if let Some((version, channel, _)) = version_check::triple() {
if channel.supports_features() {
println!("cargo:rustc-cfg=nightly"); println!("cargo:rustc-cfg=nightly");
} }
if version.at_least("1.67") && version.at_most("1.68.2") {
println!("cargo:rustc-cfg=broken_fmt");
}
}
} }

View File

@ -73,7 +73,9 @@ async fn hyper_service_fn(
// sends the response metadata (and a body channel) prior. // sends the response metadata (and a body channel) prior.
let (tx, rx) = oneshot::channel(); let (tx, rx) = oneshot::channel();
debug!("Received request: {:#?}", hyp_req); #[cfg(not(broken_fmt))]
debug!("received request: {:#?}", hyp_req);
tokio::spawn(async move { tokio::spawn(async move {
// We move the request next, so get the upgrade future now. // We move the request next, so get the upgrade future now.
let pending_upgrade = hyper::upgrade::on(&mut hyp_req); let pending_upgrade = hyper::upgrade::on(&mut hyp_req);
@ -160,7 +162,9 @@ impl Rocket<Orbit> {
let hyp_response = hyp_res.body(hyp_body) let hyp_response = hyp_res.body(hyp_body)
.map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e))?; .map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e))?;
#[cfg(not(broken_fmt))]
debug!("sending response: {:#?}", hyp_response); debug!("sending response: {:#?}", hyp_response);
tx.send(hyp_response).map_err(|_| { tx.send(hyp_response).map_err(|_| {
let msg = "client disconnect before response started"; let msg = "client disconnect before response started";
io::Error::new(io::ErrorKind::BrokenPipe, msg) io::Error::new(io::ErrorKind::BrokenPipe, msg)