From 4096bf7a984ff5234af9e68292a2ada3718495aa Mon Sep 17 00:00:00 2001 From: John Nunley Date: Sat, 30 Dec 2023 08:46:53 -0800 Subject: [PATCH 1/4] Replace futures-util with futures-lite futures-lite is a lightweight alternative to futures-util that comes with much less baggage (e.g. no proc macros, no channel implementation) and compiles much faster. This commit replaces futures-util with futures-lite in both the axum and axum-core crates. Signed-off-by: John Nunley --- axum-core/Cargo.toml | 3 +- axum-core/src/body.rs | 8 +-- axum-core/src/ext_traits/mod.rs | 5 ++ axum-core/src/ext_traits/request.rs | 3 +- axum-core/src/ext_traits/request_parts.rs | 3 +- axum/Cargo.toml | 6 ++- axum/src/extract/multipart.rs | 2 +- axum/src/extract/ws.rs | 17 ++++-- axum/src/handler/future.rs | 8 +-- axum/src/handler/mod.rs | 45 ++++++++++++++-- axum/src/handler/service.rs | 6 +-- axum/src/middleware/from_extractor.rs | 4 +- axum/src/middleware/from_fn.rs | 4 +- axum/src/middleware/map_request.rs | 4 +- axum/src/middleware/map_response.rs | 4 +- axum/src/response/sse.rs | 8 ++- axum/src/routing/route.rs | 2 +- axum/src/routing/tests/mod.rs | 8 +-- axum/src/serve.rs | 32 ++++++++--- rustc-ice-2023-12-30T16_17_52-3660.txt | 65 +++++++++++++++++++++++ rustc-ice-2023-12-30T16_17_52-3730.txt | 65 +++++++++++++++++++++++ 21 files changed, 249 insertions(+), 53 deletions(-) create mode 100644 rustc-ice-2023-12-30T16_17_52-3660.txt create mode 100644 rustc-ice-2023-12-30T16_17_52-3730.txt diff --git a/axum-core/Cargo.toml b/axum-core/Cargo.toml index 1e73ace231..a1f89fe60a 100644 --- a/axum-core/Cargo.toml +++ b/axum-core/Cargo.toml @@ -20,7 +20,8 @@ __private_docs = ["dep:tower-http"] [dependencies] async-trait = "0.1.67" bytes = "1.0" -futures-util = { version = "0.3", default-features = false, features = ["alloc"] } +futures-core = { version = "0.3.0", default-features = false } +futures-lite = { version = "2.0.0", default-features = false } http = "1.0.0" http-body = "1.0.0" http-body-util = "0.1.0" diff --git a/axum-core/src/body.rs b/axum-core/src/body.rs index 3c3f6a10d8..365c1f2397 100644 --- a/axum-core/src/body.rs +++ b/axum-core/src/body.rs @@ -2,8 +2,8 @@ use crate::{BoxError, Error}; use bytes::Bytes; -use futures_util::stream::Stream; -use futures_util::TryStream; +use futures_core::TryStream; +use futures_lite::prelude::*; use http_body::{Body as _, Frame}; use http_body_util::BodyExt; use pin_project_lite::pin_project; @@ -147,7 +147,7 @@ impl Stream for BodyDataStream { #[inline] fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { loop { - match futures_util::ready!(Pin::new(&mut self.inner).poll_frame(cx)?) { + match futures_lite::ready!(Pin::new(&mut self.inner).poll_frame(cx)?) { Some(frame) => match frame.into_data() { Ok(data) => return Poll::Ready(Some(Ok(data))), Err(_frame) => {} @@ -202,7 +202,7 @@ where cx: &mut Context<'_>, ) -> Poll, Self::Error>>> { let stream = self.project().stream.get_pin_mut(); - match futures_util::ready!(stream.try_poll_next(cx)) { + match futures_lite::ready!(stream.try_poll_next(cx)) { Some(Ok(chunk)) => Poll::Ready(Some(Ok(Frame::data(chunk.into())))), Some(Err(err)) => Poll::Ready(Some(Err(Error::new(err)))), None => Poll::Ready(None), diff --git a/axum-core/src/ext_traits/mod.rs b/axum-core/src/ext_traits/mod.rs index 02595fbeac..00d93ed53c 100644 --- a/axum-core/src/ext_traits/mod.rs +++ b/axum-core/src/ext_traits/mod.rs @@ -1,6 +1,11 @@ pub(crate) mod request; pub(crate) mod request_parts; +use core::future::Future; +use core::pin::Pin; + +type BoxFuture<'a, T> = Pin + Send + 'a>>; + #[cfg(test)] mod tests { use std::convert::Infallible; diff --git a/axum-core/src/ext_traits/request.rs b/axum-core/src/ext_traits/request.rs index 5b7aee783a..f965b3bfd6 100644 --- a/axum-core/src/ext_traits/request.rs +++ b/axum-core/src/ext_traits/request.rs @@ -1,6 +1,7 @@ use crate::body::Body; use crate::extract::{DefaultBodyLimitKind, FromRequest, FromRequestParts, Request}; -use futures_util::future::BoxFuture; + +use super::BoxFuture; mod sealed { pub trait Sealed {} diff --git a/axum-core/src/ext_traits/request_parts.rs b/axum-core/src/ext_traits/request_parts.rs index e7063f4d8b..ba1b52be32 100644 --- a/axum-core/src/ext_traits/request_parts.rs +++ b/axum-core/src/ext_traits/request_parts.rs @@ -1,7 +1,8 @@ use crate::extract::FromRequestParts; -use futures_util::future::BoxFuture; use http::request::Parts; +use super::BoxFuture; + mod sealed { pub trait Sealed {} impl Sealed for http::request::Parts {} diff --git a/axum/Cargo.toml b/axum/Cargo.toml index c582696d24..221a332194 100644 --- a/axum/Cargo.toml +++ b/axum/Cargo.toml @@ -35,7 +35,7 @@ query = ["dep:serde_urlencoded"] tokio = ["dep:hyper-util", "dep:tokio", "tokio/net", "tokio/rt", "tower/make", "tokio/macros"] tower-log = ["tower/log"] tracing = ["dep:tracing", "axum-core/tracing"] -ws = ["dep:hyper", "tokio", "dep:tokio-tungstenite", "dep:sha1", "dep:base64"] +ws = ["dep:hyper", "tokio", "dep:tokio-tungstenite", "dep:sha1", "dep:base64", "dep:futures-sink"] # Required for intra-doc links to resolve correctly __private_docs = ["tower/full", "dep:tower-http"] @@ -44,7 +44,9 @@ __private_docs = ["tower/full", "dep:tower-http"] async-trait = "0.1.67" axum-core = { path = "../axum-core", version = "0.4.3" } bytes = "1.0" -futures-util = { version = "0.3", default-features = false, features = ["alloc"] } +futures-core = { version = "0.3", default-features = false, features = ["alloc"] } +futures-lite = { version = "2.0.0", default-features = false, features = ["alloc"] } +futures-sink = { version = "0.3", default-features = false, features = ["alloc"], optional = true } http = "1.0.0" http-body = "1.0.0" http-body-util = "0.1.0" diff --git a/axum/src/extract/multipart.rs b/axum/src/extract/multipart.rs index 6a72335e74..84c377fd44 100644 --- a/axum/src/extract/multipart.rs +++ b/axum/src/extract/multipart.rs @@ -10,7 +10,7 @@ use axum_core::{ response::{IntoResponse, Response}, RequestExt, }; -use futures_util::stream::Stream; +use futures_lite::stream::Stream; use http::{ header::{HeaderMap, CONTENT_TYPE}, StatusCode, diff --git a/axum/src/extract/ws.rs b/axum/src/extract/ws.rs index ecf320ab31..cd33cf429b 100644 --- a/axum/src/extract/ws.rs +++ b/axum/src/extract/ws.rs @@ -95,10 +95,11 @@ use super::FromRequestParts; use crate::{body::Bytes, response::Response, Error}; use async_trait::async_trait; use axum_core::body::Body; -use futures_util::{ - sink::{Sink, SinkExt}, +use futures_lite::{ + future::poll_fn, stream::{Stream, StreamExt}, }; +use futures_sink::Sink; use http::{ header::{self, HeaderMap, HeaderName, HeaderValue}, request::Parts, @@ -470,8 +471,14 @@ impl WebSocket { /// Send a message. pub async fn send(&mut self, msg: Message) -> Result<(), Error> { - self.inner - .send(msg.into_tungstenite()) + // Start sending the message. + poll_fn(|cx| Pin::new(&mut self.inner).poll_ready(cx)) + .await + .map_err(Error::new)?; + Pin::new(&mut self.inner).start_send(msg.into_tungstenite()).map_err(Error::new)?; + + // Send the message. + poll_fn(|cx| Pin::new(&mut self.inner).poll_flush(cx)) .await .map_err(Error::new) } @@ -492,7 +499,7 @@ impl Stream for WebSocket { fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { loop { - match futures_util::ready!(self.inner.poll_next_unpin(cx)) { + match futures_lite::ready!(self.inner.poll_next(cx)) { Some(Ok(msg)) => { if let Some(msg) = Message::from_tungstenite(msg) { return Poll::Ready(Some(Ok(msg))); diff --git a/axum/src/handler/future.rs b/axum/src/handler/future.rs index 751984d0c6..7d4ab49973 100644 --- a/axum/src/handler/future.rs +++ b/axum/src/handler/future.rs @@ -1,8 +1,8 @@ //! Handler future types. +use super::MapFuture; use crate::response::Response; use axum_core::extract::Request; -use futures_util::future::Map; use pin_project_lite::pin_project; use std::{convert::Infallible, future::Future, pin::Pin, task::Context}; use tower::util::Oneshot; @@ -11,7 +11,7 @@ use tower_service::Service; opaque_future! { /// The response future for [`IntoService`](super::IntoService). pub type IntoServiceFuture = - Map< + MapFuture< F, fn(Response) -> Result, >; @@ -24,7 +24,7 @@ pin_project! { S: Service, { #[pin] - inner: Map, fn(Result) -> Response>, + inner: MapFuture, fn(Result) -> Response>, } } @@ -33,7 +33,7 @@ where S: Service, { pub(super) fn new( - inner: Map, fn(Result) -> Response>, + inner: MapFuture, fn(Result) -> Response>, ) -> Self { Self { inner } } diff --git a/axum/src/handler/mod.rs b/axum/src/handler/mod.rs index 579fdbbad4..74d614bd54 100644 --- a/axum/src/handler/mod.rs +++ b/axum/src/handler/mod.rs @@ -51,7 +51,14 @@ use crate::{ response::{IntoResponse, Response}, routing::IntoMakeService, }; -use std::{convert::Infallible, fmt, future::Future, marker::PhantomData, pin::Pin}; +use std::{ + convert::Infallible, + fmt, + future::Future, + marker::PhantomData, + pin::Pin, + task::{Context, Poll}, +}; use tower::ServiceExt; use tower_layer::Layer; use tower_service::Service; @@ -313,12 +320,10 @@ where type Future = future::LayeredFuture; fn call(self, req: Request, state: S) -> Self::Future { - use futures_util::future::{FutureExt, Map}; - let svc = self.handler.with_state(state); let svc = self.layer.layer(svc); - let future: Map< + let future: MapFuture< _, fn( Result< @@ -326,7 +331,7 @@ where >::Error, >, ) -> _, - > = svc.oneshot(req).map(|result| match result { + > = MapFuture::new(svc.oneshot(req), |result| match result { Ok(res) => res.into_response(), Err(err) => match err {}, }); @@ -383,6 +388,36 @@ where } } +pin_project_lite::pin_project! { + #[doc(hidden)] + pub struct MapFuture { + #[pin] + future: Fut, + mapper: F + } +} + +impl T> MapFuture { + #[inline] + fn new(future: Fut, mapper: F) -> Self { + Self { future, mapper } + } +} + +impl T> Future for MapFuture { + type Output = T; + + #[inline] + fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { + let mut this = self.project(); + let poll = this.future.as_mut().poll(cx); + match poll { + Poll::Ready(input) => Poll::Ready((this.mapper)(input)), + Poll::Pending => Poll::Pending, + } + } +} + #[cfg(test)] mod tests { use super::*; diff --git a/axum/src/handler/service.rs b/axum/src/handler/service.rs index e6b8df9316..7efa202e6b 100644 --- a/axum/src/handler/service.rs +++ b/axum/src/handler/service.rs @@ -1,4 +1,4 @@ -use super::Handler; +use super::{Handler, MapFuture}; use crate::body::{Body, Bytes, HttpBody}; #[cfg(feature = "tokio")] use crate::extract::connect_info::IntoMakeServiceWithConnectInfo; @@ -165,13 +165,11 @@ where } fn call(&mut self, req: Request) -> Self::Future { - use futures_util::future::FutureExt; - let req = req.map(Body::new); let handler = self.handler.clone(); let future = Handler::call(handler, req, self.state.clone()); - let future = future.map(Ok as _); + let future = MapFuture::new(future, Ok as _); super::future::IntoServiceFuture::new(future) } diff --git a/axum/src/middleware/from_extractor.rs b/axum/src/middleware/from_extractor.rs index 63ef85800a..c0b192af79 100644 --- a/axum/src/middleware/from_extractor.rs +++ b/axum/src/middleware/from_extractor.rs @@ -2,7 +2,7 @@ use crate::{ extract::FromRequestParts, response::{IntoResponse, Response}, }; -use futures_util::{future::BoxFuture, ready}; +use futures_lite::{future::Boxed, ready}; use http::Request; use pin_project_lite::pin_project; use std::{ @@ -254,7 +254,7 @@ pin_project! { T: Service>, { Extracting { - future: BoxFuture<'static, (Request, Result)>, + future: Boxed<(Request, Result)>, }, Call { #[pin] future: T::Future }, } diff --git a/axum/src/middleware/from_fn.rs b/axum/src/middleware/from_fn.rs index e4c44c74f5..278a5d1edc 100644 --- a/axum/src/middleware/from_fn.rs +++ b/axum/src/middleware/from_fn.rs @@ -1,6 +1,6 @@ use crate::response::{IntoResponse, Response}; use axum_core::extract::{FromRequest, FromRequestParts, Request}; -use futures_util::future::BoxFuture; +use futures_lite::future::Boxed; use std::{ any::type_name, convert::Infallible, @@ -361,7 +361,7 @@ impl Service for Next { /// Response future for [`FromFn`]. pub struct ResponseFuture { - inner: BoxFuture<'static, Response>, + inner: Boxed, } impl Future for ResponseFuture { diff --git a/axum/src/middleware/map_request.rs b/axum/src/middleware/map_request.rs index 596b6c3c87..f3184bf994 100644 --- a/axum/src/middleware/map_request.rs +++ b/axum/src/middleware/map_request.rs @@ -2,7 +2,7 @@ use crate::body::{Body, Bytes, HttpBody}; use crate::response::{IntoResponse, Response}; use crate::BoxError; use axum_core::extract::{FromRequest, FromRequestParts}; -use futures_util::future::BoxFuture; +use futures_lite::future::Boxed; use http::Request; use std::{ any::type_name, @@ -336,7 +336,7 @@ where /// Response future for [`MapRequest`]. pub struct ResponseFuture { - inner: BoxFuture<'static, Response>, + inner: Boxed, } impl Future for ResponseFuture { diff --git a/axum/src/middleware/map_response.rs b/axum/src/middleware/map_response.rs index 2510cdc256..63d5c23744 100644 --- a/axum/src/middleware/map_response.rs +++ b/axum/src/middleware/map_response.rs @@ -1,6 +1,6 @@ use crate::response::{IntoResponse, Response}; use axum_core::extract::FromRequestParts; -use futures_util::future::BoxFuture; +use futures_lite::future::Boxed; use http::Request; use std::{ any::type_name, @@ -324,7 +324,7 @@ where /// Response future for [`MapResponse`]. pub struct ResponseFuture { - inner: BoxFuture<'static, Response>, + inner: Boxed, } impl Future for ResponseFuture { diff --git a/axum/src/response/sse.rs b/axum/src/response/sse.rs index d3cc69b543..4c0615d85f 100644 --- a/axum/src/response/sse.rs +++ b/axum/src/response/sse.rs @@ -34,10 +34,8 @@ use axum_core::{ response::{IntoResponse, Response}, }; use bytes::{BufMut, BytesMut}; -use futures_util::{ - ready, - stream::{Stream, TryStream}, -}; +use futures_core::{Stream, TryStream}; +use futures_lite::ready; use http_body::Frame; use pin_project_lite::pin_project; use std::{ @@ -514,7 +512,7 @@ impl<'a> Iterator for MemchrSplit<'a> { mod tests { use super::*; use crate::{routing::get, test_helpers::*, Router}; - use futures_util::stream; + use futures_lite::stream; use std::{collections::HashMap, convert::Infallible}; use tokio_stream::StreamExt as _; diff --git a/axum/src/routing/route.rs b/axum/src/routing/route.rs index 2bde8c8c5f..6ded3940d9 100644 --- a/axum/src/routing/route.rs +++ b/axum/src/routing/route.rs @@ -234,7 +234,7 @@ impl Future for InfallibleRouteFuture { type Output = Response; fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { - match futures_util::ready!(self.project().future.poll(cx)) { + match futures_lite::ready!(self.project().future.poll(cx)) { Ok(response) => Poll::Ready(response), Err(err) => match err {}, } diff --git a/axum/src/routing/tests/mod.rs b/axum/src/routing/tests/mod.rs index 144c870dfa..2ac409fc27 100644 --- a/axum/src/routing/tests/mod.rs +++ b/axum/src/routing/tests/mod.rs @@ -16,7 +16,7 @@ use crate::{ BoxError, Extension, Json, Router, ServiceExt, }; use axum_core::extract::Request; -use futures_util::stream::StreamExt; +use futures_lite::stream::StreamExt; use http::{ header::{ALLOW, CONTENT_LENGTH, HOST}, HeaderMap, Method, StatusCode, Uri, @@ -637,7 +637,7 @@ async fn body_limited_by_default() { for uri in ["/bytes", "/string", "/json"] { println!("calling {uri}"); - let stream = futures_util::stream::repeat("a".repeat(1000)).map(Ok::<_, hyper::Error>); + let stream = futures_lite::stream::repeat("a".repeat(1000)).map(Ok::<_, hyper::Error>); let body = reqwest::Body::wrap_stream(stream); let res_future = client @@ -791,14 +791,14 @@ async fn limited_body_with_streaming_body() { let client = TestClient::new(app); - let stream = futures_util::stream::iter(vec![Ok::<_, hyper::Error>("a".repeat(LIMIT))]); + let stream = futures_lite::stream::iter(vec![Ok::<_, hyper::Error>("a".repeat(LIMIT))]); let res = client .post("/") .body(reqwest::Body::wrap_stream(stream)) .await; assert_eq!(res.status(), StatusCode::OK); - let stream = futures_util::stream::iter(vec![Ok::<_, hyper::Error>("a".repeat(LIMIT * 2))]); + let stream = futures_lite::stream::iter(vec![Ok::<_, hyper::Error>("a".repeat(LIMIT * 2))]); let res = client .post("/") .body(reqwest::Body::wrap_stream(stream)) diff --git a/axum/src/serve.rs b/axum/src/serve.rs index b253cb5def..0807b97318 100644 --- a/axum/src/serve.rs +++ b/axum/src/serve.rs @@ -14,7 +14,7 @@ use std::{ }; use axum_core::{body::Body, extract::Request, response::Response}; -use futures_util::{pin_mut, FutureExt}; +use futures_lite::pin; use hyper::body::Incoming; use hyper_util::{ rt::{TokioExecutor, TokioIo}, @@ -337,20 +337,38 @@ where tokio::spawn(async move { let builder = Builder::new(TokioExecutor::new()); let conn = builder.serve_connection_with_upgrades(tcp_stream, hyper_service); - pin_mut!(conn); + pin!(conn); - let signal_closed = signal_tx.closed().fuse(); - pin_mut!(signal_closed); + let signal_closed = Some(signal_tx.closed()); + pin!(signal_closed); loop { + // Wait for the connection. + let connect = async { conn.as_mut().await }; + + // Simultaneously wait for the signal to close us. + let signal = async { + match signal_closed.as_mut().as_pin_mut() { + Some(signal) => { + signal.await; + + // Fuse the signal after we close it. + signal_closed.set(None); + } + + None => futures_lite::future::pending().await, + } + }; + + // Poll these futures in parallel. tokio::select! { - result = conn.as_mut() => { + result = connect => { if let Err(_err) = result { trace!("failed to serve connection: {_err:#}"); } break; } - _ = &mut signal_closed => { + _ = signal => { trace!("signal received in task, starting graceful shutdown"); conn.as_mut().graceful_shutdown(); } @@ -420,7 +438,7 @@ mod private { task::{Context, Poll}, }; - pub struct ServeFuture(pub(super) futures_util::future::BoxFuture<'static, io::Result<()>>); + pub struct ServeFuture(pub(super) futures_lite::future::Boxed>); impl Future for ServeFuture { type Output = io::Result<()>; diff --git a/rustc-ice-2023-12-30T16_17_52-3660.txt b/rustc-ice-2023-12-30T16_17_52-3660.txt new file mode 100644 index 0000000000..5a2e6ba792 --- /dev/null +++ b/rustc-ice-2023-12-30T16_17_52-3660.txt @@ -0,0 +1,65 @@ +thread 'rustc' panicked at compiler/rustc_resolve/src/lib.rs:2006:67: +internal error: entered unreachable code +stack backtrace: + 0: 0x7f3588a5edf1 - std::backtrace_rs::backtrace::libunwind::trace::h6f3a1ccb73000b37 + at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5 + 1: 0x7f3588a5edf1 - std::backtrace_rs::backtrace::trace_unsynchronized::hd0ff5fdd1bf60d6e + at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5 + 2: 0x7f3588a5edf1 - std::backtrace::Backtrace::create::h20f939ce9d7f40d9 + at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/std/src/backtrace.rs:332:13 + 3: 0x7f3588a5ed40 - std::backtrace::Backtrace::force_capture::h46973c2cb0e6bee4 + at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/std/src/backtrace.rs:313:9 + 4: 0x7f3589973b65 - std[5286da1a7f1702bd]::panicking::update_hook::>::{closure#0} + 5: 0x7f3588a78678 - as core::ops::function::Fn>::call::h8beb636fc6649401 + at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/alloc/src/boxed.rs:2021:9 + 6: 0x7f3588a78678 - std::panicking::rust_panic_with_hook::h793910703cc9c61f + at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/std/src/panicking.rs:783:13 + 7: 0x7f3588a78399 - std::panicking::begin_panic_handler::{{closure}}::h6665f370f292bae4 + at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/std/src/panicking.rs:649:13 + 8: 0x7f3588a759f6 - std::sys_common::backtrace::__rust_end_short_backtrace::h9d63f7a0bd69415f + at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/std/src/sys_common/backtrace.rs:171:18 + 9: 0x7f3588a78132 - rust_begin_unwind + at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/std/src/panicking.rs:645:5 + 10: 0x7f3588a3d995 - core::panicking::panic_fmt::h1da727f5c08c6f04 + at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/core/src/panicking.rs:72:14 + 11: 0x7f3588a3da33 - core::panicking::panic::h63f9b841f6a58ec4 + at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/core/src/panicking.rs:127:5 + 12: 0x7f358ddc06fc - ::resolve_rustdoc_path + 13: 0x7f358dd6fde3 - ::resolve_and_cache_rustdoc_path + 14: 0x7f358dd703e7 - ::resolve_doc_links + 15: 0x7f358dd63c1b - ::resolve_impl_item + 16: 0x7f358dd5abbd - ::resolve_item + 17: 0x7f358dd41a2a - ::visit_item + 18: 0x7f358de036ab - rustc_ast[4c22f6135fa95ce6]::visit::walk_item:: + 19: 0x7f358dd51411 - ::resolve_item + 20: 0x7f358dd41a2a - ::visit_item + 21: 0x7f358ddac02a - ::late_resolve_crate + 22: 0x7f358de7c9d0 - ::time::<(), ::resolve_crate::{closure#0}> + 23: 0x7f358ddbd269 - ::resolve_crate + 24: 0x7f3589b82301 - rustc_interface[91dfe8068dedb37f]::passes::resolver_for_lowering + 25: 0x7f358e46328a - rustc_query_impl[4e655a8ff60e5d3e]::plumbing::__rust_begin_short_backtrace::> + 26: 0x7f358e638998 - >::call_once + 27: 0x7f358e6d9dd7 - rustc_query_system[2ffd499e350ffcd1]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[4e655a8ff60e5d3e]::plumbing::QueryCtxt, true> + 28: 0x7f358e5c98de - rustc_query_impl[4e655a8ff60e5d3e]::query_impl::resolver_for_lowering::get_query_incr::__rust_end_short_backtrace + 29: 0x7f3589934da3 - ::enter::)>> + 30: 0x7f35899a26fb - ::enter::, rustc_span[b466c03c33b43973]::ErrorGuaranteed>> + 31: 0x7f3589976927 - rustc_span[b466c03c33b43973]::set_source_map::, rustc_interface[91dfe8068dedb37f]::interface::run_compiler, rustc_driver_impl[4c517d3e910738e6]::run_compiler::{closure#0}>::{closure#0}::{closure#0}> + 32: 0x7f358995cb94 - >::set::, rustc_driver_impl[4c517d3e910738e6]::run_compiler::{closure#0}>::{closure#0}, core[8a20573edde69916]::result::Result<(), rustc_span[b466c03c33b43973]::ErrorGuaranteed>>::{closure#0}, core[8a20573edde69916]::result::Result<(), rustc_span[b466c03c33b43973]::ErrorGuaranteed>> + 33: 0x7f3589976e19 - rustc_span[b466c03c33b43973]::create_session_globals_then::, rustc_interface[91dfe8068dedb37f]::util::run_in_thread_pool_with_globals, rustc_driver_impl[4c517d3e910738e6]::run_compiler::{closure#0}>::{closure#0}, core[8a20573edde69916]::result::Result<(), rustc_span[b466c03c33b43973]::ErrorGuaranteed>>::{closure#0}> + 34: 0x7f358996384e - std[5286da1a7f1702bd]::sys_common::backtrace::__rust_begin_short_backtrace::, rustc_driver_impl[4c517d3e910738e6]::run_compiler::{closure#0}>::{closure#0}, core[8a20573edde69916]::result::Result<(), rustc_span[b466c03c33b43973]::ErrorGuaranteed>>::{closure#0}, core[8a20573edde69916]::result::Result<(), rustc_span[b466c03c33b43973]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[8a20573edde69916]::result::Result<(), rustc_span[b466c03c33b43973]::ErrorGuaranteed>> + 35: 0x7f3589965851 - <::spawn_unchecked_, rustc_driver_impl[4c517d3e910738e6]::run_compiler::{closure#0}>::{closure#0}, core[8a20573edde69916]::result::Result<(), rustc_span[b466c03c33b43973]::ErrorGuaranteed>>::{closure#0}, core[8a20573edde69916]::result::Result<(), rustc_span[b466c03c33b43973]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[8a20573edde69916]::result::Result<(), rustc_span[b466c03c33b43973]::ErrorGuaranteed>>::{closure#1} as core[8a20573edde69916]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} + 36: 0x7f3588a822c5 - as core::ops::function::FnOnce>::call_once::hf616250a9953f5f4 + at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/alloc/src/boxed.rs:2007:9 + 37: 0x7f3588a822c5 - as core::ops::function::FnOnce>::call_once::h01da6fdf90df2f5c + at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/alloc/src/boxed.rs:2007:9 + 38: 0x7f3588a822c5 - std::sys::unix::thread::Thread::new::thread_start::hc7b365d4f1703e67 + at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/std/src/sys/unix/thread.rs:108:17 + 39: 0x7f3593045bc2 - + + +rustc version: 1.76.0-nightly (3a85a5cfe 2023-11-20) +platform: x86_64-unknown-linux-musl + +query stack during panic: +#0 [resolver_for_lowering] getting the resolver for lowering +end of query stack diff --git a/rustc-ice-2023-12-30T16_17_52-3730.txt b/rustc-ice-2023-12-30T16_17_52-3730.txt new file mode 100644 index 0000000000..428f9afcc1 --- /dev/null +++ b/rustc-ice-2023-12-30T16_17_52-3730.txt @@ -0,0 +1,65 @@ +thread 'rustc' panicked at compiler/rustc_resolve/src/lib.rs:2006:67: +internal error: entered unreachable code +stack backtrace: + 0: 0x7f955cc5edf1 - std::backtrace_rs::backtrace::libunwind::trace::h6f3a1ccb73000b37 + at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5 + 1: 0x7f955cc5edf1 - std::backtrace_rs::backtrace::trace_unsynchronized::hd0ff5fdd1bf60d6e + at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5 + 2: 0x7f955cc5edf1 - std::backtrace::Backtrace::create::h20f939ce9d7f40d9 + at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/std/src/backtrace.rs:332:13 + 3: 0x7f955cc5ed40 - std::backtrace::Backtrace::force_capture::h46973c2cb0e6bee4 + at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/std/src/backtrace.rs:313:9 + 4: 0x7f955db73b65 - std[5286da1a7f1702bd]::panicking::update_hook::>::{closure#0} + 5: 0x7f955cc78678 - as core::ops::function::Fn>::call::h8beb636fc6649401 + at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/alloc/src/boxed.rs:2021:9 + 6: 0x7f955cc78678 - std::panicking::rust_panic_with_hook::h793910703cc9c61f + at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/std/src/panicking.rs:783:13 + 7: 0x7f955cc78399 - std::panicking::begin_panic_handler::{{closure}}::h6665f370f292bae4 + at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/std/src/panicking.rs:649:13 + 8: 0x7f955cc759f6 - std::sys_common::backtrace::__rust_end_short_backtrace::h9d63f7a0bd69415f + at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/std/src/sys_common/backtrace.rs:171:18 + 9: 0x7f955cc78132 - rust_begin_unwind + at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/std/src/panicking.rs:645:5 + 10: 0x7f955cc3d995 - core::panicking::panic_fmt::h1da727f5c08c6f04 + at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/core/src/panicking.rs:72:14 + 11: 0x7f955cc3da33 - core::panicking::panic::h63f9b841f6a58ec4 + at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/core/src/panicking.rs:127:5 + 12: 0x7f9561fc06fc - ::resolve_rustdoc_path + 13: 0x7f9561f6fde3 - ::resolve_and_cache_rustdoc_path + 14: 0x7f9561f703e7 - ::resolve_doc_links + 15: 0x7f9561f63c1b - ::resolve_impl_item + 16: 0x7f9561f5abbd - ::resolve_item + 17: 0x7f9561f41a2a - ::visit_item + 18: 0x7f95620036ab - rustc_ast[4c22f6135fa95ce6]::visit::walk_item:: + 19: 0x7f9561f51411 - ::resolve_item + 20: 0x7f9561f41a2a - ::visit_item + 21: 0x7f9561fac02a - ::late_resolve_crate + 22: 0x7f956207c9d0 - ::time::<(), ::resolve_crate::{closure#0}> + 23: 0x7f9561fbd269 - ::resolve_crate + 24: 0x7f955dd82301 - rustc_interface[91dfe8068dedb37f]::passes::resolver_for_lowering + 25: 0x7f956266328a - rustc_query_impl[4e655a8ff60e5d3e]::plumbing::__rust_begin_short_backtrace::> + 26: 0x7f9562838998 - >::call_once + 27: 0x7f95628d9dd7 - rustc_query_system[2ffd499e350ffcd1]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[4e655a8ff60e5d3e]::plumbing::QueryCtxt, true> + 28: 0x7f95627c98de - rustc_query_impl[4e655a8ff60e5d3e]::query_impl::resolver_for_lowering::get_query_incr::__rust_end_short_backtrace + 29: 0x7f955db34da3 - ::enter::)>> + 30: 0x7f955dba26fb - ::enter::, rustc_span[b466c03c33b43973]::ErrorGuaranteed>> + 31: 0x7f955db76927 - rustc_span[b466c03c33b43973]::set_source_map::, rustc_interface[91dfe8068dedb37f]::interface::run_compiler, rustc_driver_impl[4c517d3e910738e6]::run_compiler::{closure#0}>::{closure#0}::{closure#0}> + 32: 0x7f955db5cb94 - >::set::, rustc_driver_impl[4c517d3e910738e6]::run_compiler::{closure#0}>::{closure#0}, core[8a20573edde69916]::result::Result<(), rustc_span[b466c03c33b43973]::ErrorGuaranteed>>::{closure#0}, core[8a20573edde69916]::result::Result<(), rustc_span[b466c03c33b43973]::ErrorGuaranteed>> + 33: 0x7f955db76e19 - rustc_span[b466c03c33b43973]::create_session_globals_then::, rustc_interface[91dfe8068dedb37f]::util::run_in_thread_pool_with_globals, rustc_driver_impl[4c517d3e910738e6]::run_compiler::{closure#0}>::{closure#0}, core[8a20573edde69916]::result::Result<(), rustc_span[b466c03c33b43973]::ErrorGuaranteed>>::{closure#0}> + 34: 0x7f955db6384e - std[5286da1a7f1702bd]::sys_common::backtrace::__rust_begin_short_backtrace::, rustc_driver_impl[4c517d3e910738e6]::run_compiler::{closure#0}>::{closure#0}, core[8a20573edde69916]::result::Result<(), rustc_span[b466c03c33b43973]::ErrorGuaranteed>>::{closure#0}, core[8a20573edde69916]::result::Result<(), rustc_span[b466c03c33b43973]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[8a20573edde69916]::result::Result<(), rustc_span[b466c03c33b43973]::ErrorGuaranteed>> + 35: 0x7f955db65851 - <::spawn_unchecked_, rustc_driver_impl[4c517d3e910738e6]::run_compiler::{closure#0}>::{closure#0}, core[8a20573edde69916]::result::Result<(), rustc_span[b466c03c33b43973]::ErrorGuaranteed>>::{closure#0}, core[8a20573edde69916]::result::Result<(), rustc_span[b466c03c33b43973]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[8a20573edde69916]::result::Result<(), rustc_span[b466c03c33b43973]::ErrorGuaranteed>>::{closure#1} as core[8a20573edde69916]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} + 36: 0x7f955cc822c5 - as core::ops::function::FnOnce>::call_once::hf616250a9953f5f4 + at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/alloc/src/boxed.rs:2007:9 + 37: 0x7f955cc822c5 - as core::ops::function::FnOnce>::call_once::h01da6fdf90df2f5c + at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/alloc/src/boxed.rs:2007:9 + 38: 0x7f955cc822c5 - std::sys::unix::thread::Thread::new::thread_start::hc7b365d4f1703e67 + at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/std/src/sys/unix/thread.rs:108:17 + 39: 0x7f956735abc2 - + + +rustc version: 1.76.0-nightly (3a85a5cfe 2023-11-20) +platform: x86_64-unknown-linux-musl + +query stack during panic: +#0 [resolver_for_lowering] getting the resolver for lowering +end of query stack From 9adf1e6f746135f77cb1530324bf54966a49a357 Mon Sep 17 00:00:00 2001 From: John Nunley Date: Sat, 30 Dec 2023 11:33:25 -0800 Subject: [PATCH 2/4] Fix CI errors Signed-off-by: John Nunley --- axum/src/extract/ws.rs | 8 +++- rustc-ice-2023-12-30T16_17_52-3660.txt | 65 -------------------------- rustc-ice-2023-12-30T16_17_52-3730.txt | 65 -------------------------- 3 files changed, 6 insertions(+), 132 deletions(-) delete mode 100644 rustc-ice-2023-12-30T16_17_52-3660.txt delete mode 100644 rustc-ice-2023-12-30T16_17_52-3730.txt diff --git a/axum/src/extract/ws.rs b/axum/src/extract/ws.rs index cd33cf429b..71ffb7f4af 100644 --- a/axum/src/extract/ws.rs +++ b/axum/src/extract/ws.rs @@ -159,7 +159,9 @@ impl WebSocketUpgrade { /// If set to `0` each message will be eagerly written to the underlying stream. /// It is often more optimal to allow them to buffer a little, hence the default value. /// - /// Note: [`flush`](SinkExt::flush) will always fully write the buffer regardless. + /// Note: [`flush`] will always fully write the buffer regardless. + /// + /// [`flush`]: https://docs.rs/futures-util/latest/futures_util/sink/trait.SinkExt.html#method.flush pub fn write_buffer_size(mut self, size: usize) -> Self { self.config.write_buffer_size = size; self @@ -475,7 +477,9 @@ impl WebSocket { poll_fn(|cx| Pin::new(&mut self.inner).poll_ready(cx)) .await .map_err(Error::new)?; - Pin::new(&mut self.inner).start_send(msg.into_tungstenite()).map_err(Error::new)?; + Pin::new(&mut self.inner) + .start_send(msg.into_tungstenite()) + .map_err(Error::new)?; // Send the message. poll_fn(|cx| Pin::new(&mut self.inner).poll_flush(cx)) diff --git a/rustc-ice-2023-12-30T16_17_52-3660.txt b/rustc-ice-2023-12-30T16_17_52-3660.txt deleted file mode 100644 index 5a2e6ba792..0000000000 --- a/rustc-ice-2023-12-30T16_17_52-3660.txt +++ /dev/null @@ -1,65 +0,0 @@ -thread 'rustc' panicked at compiler/rustc_resolve/src/lib.rs:2006:67: -internal error: entered unreachable code -stack backtrace: - 0: 0x7f3588a5edf1 - std::backtrace_rs::backtrace::libunwind::trace::h6f3a1ccb73000b37 - at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5 - 1: 0x7f3588a5edf1 - std::backtrace_rs::backtrace::trace_unsynchronized::hd0ff5fdd1bf60d6e - at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5 - 2: 0x7f3588a5edf1 - std::backtrace::Backtrace::create::h20f939ce9d7f40d9 - at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/std/src/backtrace.rs:332:13 - 3: 0x7f3588a5ed40 - std::backtrace::Backtrace::force_capture::h46973c2cb0e6bee4 - at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/std/src/backtrace.rs:313:9 - 4: 0x7f3589973b65 - std[5286da1a7f1702bd]::panicking::update_hook::>::{closure#0} - 5: 0x7f3588a78678 - as core::ops::function::Fn>::call::h8beb636fc6649401 - at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/alloc/src/boxed.rs:2021:9 - 6: 0x7f3588a78678 - std::panicking::rust_panic_with_hook::h793910703cc9c61f - at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/std/src/panicking.rs:783:13 - 7: 0x7f3588a78399 - std::panicking::begin_panic_handler::{{closure}}::h6665f370f292bae4 - at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/std/src/panicking.rs:649:13 - 8: 0x7f3588a759f6 - std::sys_common::backtrace::__rust_end_short_backtrace::h9d63f7a0bd69415f - at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/std/src/sys_common/backtrace.rs:171:18 - 9: 0x7f3588a78132 - rust_begin_unwind - at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/std/src/panicking.rs:645:5 - 10: 0x7f3588a3d995 - core::panicking::panic_fmt::h1da727f5c08c6f04 - at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/core/src/panicking.rs:72:14 - 11: 0x7f3588a3da33 - core::panicking::panic::h63f9b841f6a58ec4 - at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/core/src/panicking.rs:127:5 - 12: 0x7f358ddc06fc - ::resolve_rustdoc_path - 13: 0x7f358dd6fde3 - ::resolve_and_cache_rustdoc_path - 14: 0x7f358dd703e7 - ::resolve_doc_links - 15: 0x7f358dd63c1b - ::resolve_impl_item - 16: 0x7f358dd5abbd - ::resolve_item - 17: 0x7f358dd41a2a - ::visit_item - 18: 0x7f358de036ab - rustc_ast[4c22f6135fa95ce6]::visit::walk_item:: - 19: 0x7f358dd51411 - ::resolve_item - 20: 0x7f358dd41a2a - ::visit_item - 21: 0x7f358ddac02a - ::late_resolve_crate - 22: 0x7f358de7c9d0 - ::time::<(), ::resolve_crate::{closure#0}> - 23: 0x7f358ddbd269 - ::resolve_crate - 24: 0x7f3589b82301 - rustc_interface[91dfe8068dedb37f]::passes::resolver_for_lowering - 25: 0x7f358e46328a - rustc_query_impl[4e655a8ff60e5d3e]::plumbing::__rust_begin_short_backtrace::> - 26: 0x7f358e638998 - >::call_once - 27: 0x7f358e6d9dd7 - rustc_query_system[2ffd499e350ffcd1]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[4e655a8ff60e5d3e]::plumbing::QueryCtxt, true> - 28: 0x7f358e5c98de - rustc_query_impl[4e655a8ff60e5d3e]::query_impl::resolver_for_lowering::get_query_incr::__rust_end_short_backtrace - 29: 0x7f3589934da3 - ::enter::)>> - 30: 0x7f35899a26fb - ::enter::, rustc_span[b466c03c33b43973]::ErrorGuaranteed>> - 31: 0x7f3589976927 - rustc_span[b466c03c33b43973]::set_source_map::, rustc_interface[91dfe8068dedb37f]::interface::run_compiler, rustc_driver_impl[4c517d3e910738e6]::run_compiler::{closure#0}>::{closure#0}::{closure#0}> - 32: 0x7f358995cb94 - >::set::, rustc_driver_impl[4c517d3e910738e6]::run_compiler::{closure#0}>::{closure#0}, core[8a20573edde69916]::result::Result<(), rustc_span[b466c03c33b43973]::ErrorGuaranteed>>::{closure#0}, core[8a20573edde69916]::result::Result<(), rustc_span[b466c03c33b43973]::ErrorGuaranteed>> - 33: 0x7f3589976e19 - rustc_span[b466c03c33b43973]::create_session_globals_then::, rustc_interface[91dfe8068dedb37f]::util::run_in_thread_pool_with_globals, rustc_driver_impl[4c517d3e910738e6]::run_compiler::{closure#0}>::{closure#0}, core[8a20573edde69916]::result::Result<(), rustc_span[b466c03c33b43973]::ErrorGuaranteed>>::{closure#0}> - 34: 0x7f358996384e - std[5286da1a7f1702bd]::sys_common::backtrace::__rust_begin_short_backtrace::, rustc_driver_impl[4c517d3e910738e6]::run_compiler::{closure#0}>::{closure#0}, core[8a20573edde69916]::result::Result<(), rustc_span[b466c03c33b43973]::ErrorGuaranteed>>::{closure#0}, core[8a20573edde69916]::result::Result<(), rustc_span[b466c03c33b43973]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[8a20573edde69916]::result::Result<(), rustc_span[b466c03c33b43973]::ErrorGuaranteed>> - 35: 0x7f3589965851 - <::spawn_unchecked_, rustc_driver_impl[4c517d3e910738e6]::run_compiler::{closure#0}>::{closure#0}, core[8a20573edde69916]::result::Result<(), rustc_span[b466c03c33b43973]::ErrorGuaranteed>>::{closure#0}, core[8a20573edde69916]::result::Result<(), rustc_span[b466c03c33b43973]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[8a20573edde69916]::result::Result<(), rustc_span[b466c03c33b43973]::ErrorGuaranteed>>::{closure#1} as core[8a20573edde69916]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} - 36: 0x7f3588a822c5 - as core::ops::function::FnOnce>::call_once::hf616250a9953f5f4 - at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/alloc/src/boxed.rs:2007:9 - 37: 0x7f3588a822c5 - as core::ops::function::FnOnce>::call_once::h01da6fdf90df2f5c - at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/alloc/src/boxed.rs:2007:9 - 38: 0x7f3588a822c5 - std::sys::unix::thread::Thread::new::thread_start::hc7b365d4f1703e67 - at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/std/src/sys/unix/thread.rs:108:17 - 39: 0x7f3593045bc2 - - - -rustc version: 1.76.0-nightly (3a85a5cfe 2023-11-20) -platform: x86_64-unknown-linux-musl - -query stack during panic: -#0 [resolver_for_lowering] getting the resolver for lowering -end of query stack diff --git a/rustc-ice-2023-12-30T16_17_52-3730.txt b/rustc-ice-2023-12-30T16_17_52-3730.txt deleted file mode 100644 index 428f9afcc1..0000000000 --- a/rustc-ice-2023-12-30T16_17_52-3730.txt +++ /dev/null @@ -1,65 +0,0 @@ -thread 'rustc' panicked at compiler/rustc_resolve/src/lib.rs:2006:67: -internal error: entered unreachable code -stack backtrace: - 0: 0x7f955cc5edf1 - std::backtrace_rs::backtrace::libunwind::trace::h6f3a1ccb73000b37 - at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5 - 1: 0x7f955cc5edf1 - std::backtrace_rs::backtrace::trace_unsynchronized::hd0ff5fdd1bf60d6e - at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5 - 2: 0x7f955cc5edf1 - std::backtrace::Backtrace::create::h20f939ce9d7f40d9 - at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/std/src/backtrace.rs:332:13 - 3: 0x7f955cc5ed40 - std::backtrace::Backtrace::force_capture::h46973c2cb0e6bee4 - at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/std/src/backtrace.rs:313:9 - 4: 0x7f955db73b65 - std[5286da1a7f1702bd]::panicking::update_hook::>::{closure#0} - 5: 0x7f955cc78678 - as core::ops::function::Fn>::call::h8beb636fc6649401 - at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/alloc/src/boxed.rs:2021:9 - 6: 0x7f955cc78678 - std::panicking::rust_panic_with_hook::h793910703cc9c61f - at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/std/src/panicking.rs:783:13 - 7: 0x7f955cc78399 - std::panicking::begin_panic_handler::{{closure}}::h6665f370f292bae4 - at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/std/src/panicking.rs:649:13 - 8: 0x7f955cc759f6 - std::sys_common::backtrace::__rust_end_short_backtrace::h9d63f7a0bd69415f - at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/std/src/sys_common/backtrace.rs:171:18 - 9: 0x7f955cc78132 - rust_begin_unwind - at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/std/src/panicking.rs:645:5 - 10: 0x7f955cc3d995 - core::panicking::panic_fmt::h1da727f5c08c6f04 - at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/core/src/panicking.rs:72:14 - 11: 0x7f955cc3da33 - core::panicking::panic::h63f9b841f6a58ec4 - at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/core/src/panicking.rs:127:5 - 12: 0x7f9561fc06fc - ::resolve_rustdoc_path - 13: 0x7f9561f6fde3 - ::resolve_and_cache_rustdoc_path - 14: 0x7f9561f703e7 - ::resolve_doc_links - 15: 0x7f9561f63c1b - ::resolve_impl_item - 16: 0x7f9561f5abbd - ::resolve_item - 17: 0x7f9561f41a2a - ::visit_item - 18: 0x7f95620036ab - rustc_ast[4c22f6135fa95ce6]::visit::walk_item:: - 19: 0x7f9561f51411 - ::resolve_item - 20: 0x7f9561f41a2a - ::visit_item - 21: 0x7f9561fac02a - ::late_resolve_crate - 22: 0x7f956207c9d0 - ::time::<(), ::resolve_crate::{closure#0}> - 23: 0x7f9561fbd269 - ::resolve_crate - 24: 0x7f955dd82301 - rustc_interface[91dfe8068dedb37f]::passes::resolver_for_lowering - 25: 0x7f956266328a - rustc_query_impl[4e655a8ff60e5d3e]::plumbing::__rust_begin_short_backtrace::> - 26: 0x7f9562838998 - >::call_once - 27: 0x7f95628d9dd7 - rustc_query_system[2ffd499e350ffcd1]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[4e655a8ff60e5d3e]::plumbing::QueryCtxt, true> - 28: 0x7f95627c98de - rustc_query_impl[4e655a8ff60e5d3e]::query_impl::resolver_for_lowering::get_query_incr::__rust_end_short_backtrace - 29: 0x7f955db34da3 - ::enter::)>> - 30: 0x7f955dba26fb - ::enter::, rustc_span[b466c03c33b43973]::ErrorGuaranteed>> - 31: 0x7f955db76927 - rustc_span[b466c03c33b43973]::set_source_map::, rustc_interface[91dfe8068dedb37f]::interface::run_compiler, rustc_driver_impl[4c517d3e910738e6]::run_compiler::{closure#0}>::{closure#0}::{closure#0}> - 32: 0x7f955db5cb94 - >::set::, rustc_driver_impl[4c517d3e910738e6]::run_compiler::{closure#0}>::{closure#0}, core[8a20573edde69916]::result::Result<(), rustc_span[b466c03c33b43973]::ErrorGuaranteed>>::{closure#0}, core[8a20573edde69916]::result::Result<(), rustc_span[b466c03c33b43973]::ErrorGuaranteed>> - 33: 0x7f955db76e19 - rustc_span[b466c03c33b43973]::create_session_globals_then::, rustc_interface[91dfe8068dedb37f]::util::run_in_thread_pool_with_globals, rustc_driver_impl[4c517d3e910738e6]::run_compiler::{closure#0}>::{closure#0}, core[8a20573edde69916]::result::Result<(), rustc_span[b466c03c33b43973]::ErrorGuaranteed>>::{closure#0}> - 34: 0x7f955db6384e - std[5286da1a7f1702bd]::sys_common::backtrace::__rust_begin_short_backtrace::, rustc_driver_impl[4c517d3e910738e6]::run_compiler::{closure#0}>::{closure#0}, core[8a20573edde69916]::result::Result<(), rustc_span[b466c03c33b43973]::ErrorGuaranteed>>::{closure#0}, core[8a20573edde69916]::result::Result<(), rustc_span[b466c03c33b43973]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[8a20573edde69916]::result::Result<(), rustc_span[b466c03c33b43973]::ErrorGuaranteed>> - 35: 0x7f955db65851 - <::spawn_unchecked_, rustc_driver_impl[4c517d3e910738e6]::run_compiler::{closure#0}>::{closure#0}, core[8a20573edde69916]::result::Result<(), rustc_span[b466c03c33b43973]::ErrorGuaranteed>>::{closure#0}, core[8a20573edde69916]::result::Result<(), rustc_span[b466c03c33b43973]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[8a20573edde69916]::result::Result<(), rustc_span[b466c03c33b43973]::ErrorGuaranteed>>::{closure#1} as core[8a20573edde69916]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} - 36: 0x7f955cc822c5 - as core::ops::function::FnOnce>::call_once::hf616250a9953f5f4 - at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/alloc/src/boxed.rs:2007:9 - 37: 0x7f955cc822c5 - as core::ops::function::FnOnce>::call_once::h01da6fdf90df2f5c - at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/alloc/src/boxed.rs:2007:9 - 38: 0x7f955cc822c5 - std::sys::unix::thread::Thread::new::thread_start::hc7b365d4f1703e67 - at /rustc/3a85a5cfe7884f94e3cb29a606913d7989ad9b48/library/std/src/sys/unix/thread.rs:108:17 - 39: 0x7f956735abc2 - - - -rustc version: 1.76.0-nightly (3a85a5cfe 2023-11-20) -platform: x86_64-unknown-linux-musl - -query stack during panic: -#0 [resolver_for_lowering] getting the resolver for lowering -end of query stack From e28a9c990b45274f1b7035cc46eb550a7afd0adc Mon Sep 17 00:00:00 2001 From: John Nunley Date: Mon, 1 Jan 2024 10:47:50 -0800 Subject: [PATCH 3/4] CI check 2 Signed-off-by: John Nunley --- axum/Cargo.toml | 2 +- axum/src/extract/ws.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/axum/Cargo.toml b/axum/Cargo.toml index 221a332194..35789a8cb6 100644 --- a/axum/Cargo.toml +++ b/axum/Cargo.toml @@ -117,6 +117,7 @@ rustversion = "1.0.9" [dev-dependencies] anyhow = "1.0" axum-macros = { path = "../axum-macros", version = "0.4.1", features = ["__private"] } +futures-util = "0.3" quickcheck = "1.0" quickcheck_macros = "1.0" reqwest = { version = "0.11.14", default-features = false, features = ["json", "stream", "multipart"] } @@ -199,7 +200,6 @@ allowed = [ # not 1.0 "futures_core", "futures_sink", - "futures_util", "tower_layer", "tower_service", diff --git a/axum/src/extract/ws.rs b/axum/src/extract/ws.rs index 71ffb7f4af..3fc807bfc8 100644 --- a/axum/src/extract/ws.rs +++ b/axum/src/extract/ws.rs @@ -160,7 +160,7 @@ impl WebSocketUpgrade { /// It is often more optimal to allow them to buffer a little, hence the default value. /// /// Note: [`flush`] will always fully write the buffer regardless. - /// + /// /// [`flush`]: https://docs.rs/futures-util/latest/futures_util/sink/trait.SinkExt.html#method.flush pub fn write_buffer_size(mut self, size: usize) -> Self { self.config.write_buffer_size = size; From b619a49e42a54d5e6b17774131d45b66e9368b93 Mon Sep 17 00:00:00 2001 From: John Nunley Date: Sun, 28 Jan 2024 09:29:23 -0800 Subject: [PATCH 4/4] Fix websockets error Signed-off-by: John Nunley --- axum/src/extract/ws.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/axum/src/extract/ws.rs b/axum/src/extract/ws.rs index 3fc807bfc8..f44ee07f86 100644 --- a/axum/src/extract/ws.rs +++ b/axum/src/extract/ws.rs @@ -845,6 +845,7 @@ mod tests { use super::*; use crate::{body::Body, routing::get, test_helpers::spawn_service, Router}; + use futures_util::sink::SinkExt; use http::{Request, Version}; use tokio_tungstenite::tungstenite; use tower::ServiceExt;