book
book copied to clipboard
document futures size explosion pitfall and mitigations
As explained e.g. here, futures can easily turn into unpleasant memory hog surprises.
One possible easy way to investigate problematic code is to add a future-size-threshold = 100 (or whichever threshold seems reasonable) clippy lint.
Further information: withoutboats: Futures and Segmented Stacks
We would welcome a PR explaining this. Please feel free to write it if you have the time.
I don't feel qualified enough to do a detailed writeup, so would rather see somebody else spearheading this. If nobody else takes it up, I can try and come up with 1-2 paragraphs…