Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This makes stream_len atomic for File in an attempt to resolve the concerns brought up during the last stabilization attempt from which
stream_lenwas ultimately removed.This gives us atomic
stream_lenfor all of theSeekimplementations in std (or makes us use atomicstream_lenif the underlying construct has such an atomicstream_len):Empty→ already returnsOk(0)since f1cd179Cursor<impl Read>→ already uses atomic operation since c518f2dFile/&File→ now uses atomic operation with this PRBox<impl Seek>→ now uses innerstream_len&mut impl Seek→ now uses innerstream_lenBufReader<impl Seek>→ now uses innerstream_lenBufWriter<impl Seek>→ now uses innerstream_lenThe only non-atomic implementation remaining is the one on the trait itself, which is unfortunate, but I'm not sure if the alternatives to that are better or not.
cc @sfackler @LukasKalbertodt