-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Closed
Copy link
Labels
C-bugCategory: This is a bug.Category: This is a bug.I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Hi, i have made some changes for a crate stubborn-io
to support a generic type that implements ToSocketAddrs
from Tokio
, but suddenly the code can't compile because it runs out of memory with 6, 8, 10 GB.
This is the code i'm trying to compile:
use super::io::{StubbornIo, UnderlyingIo};
use std::future::Future;
use std::io;
use tokio::net::ToSocketAddrs;
use std::pin::Pin;
use tokio::net::TcpStream;
impl<A> UnderlyingIo<A> for TcpStream
where A: ToSocketAddrs + Sync + Send + Clone + Unpin + 'static {
fn establish(addr: A) -> Pin<Box<dyn Future<Output = io::Result<Self>> + Send>> {
Box::pin(TcpStream::connect(addr))
}
}
pub type StubbornTcpStream<A: ToSocketAddrs + Sync + Send + Clone + Unpin + 'static> = StubbornIo<TcpStream, A>;
if changed the type A
for SocketAddr
or String
it then compiles and runs fine.
It fails to compile on x86_64-unknown-linux-gnu with stable
, nightly
.
I'm attaching the Heaptrack files for further analysis.
https://gofile.io/?c=Vnar2K
hmanfroi
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.