Skip to content

refactor(edmonds-karp): drop two unsafe Send impls the compiler already provides - #820

Open
tachsin wants to merge 1 commit into
evenfurther:mainfrom
tachsin:refactor/drop-redundant-unsafe-send
Open

refactor(edmonds-karp): drop two unsafe Send impls the compiler already provides#820
tachsin wants to merge 1 commit into
evenfurther:mainfrom
tachsin:refactor/drop-redundant-unsafe-send

Conversation

@tachsin

@tachsin tachsin commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Closes #817.

Removes both unsafe impl Send. Every field of SparseCapacity and DenseCapacity is Send whenever C is, so the compiler derives the same impl with the same bound, and the crate is left with no unsafe in this file at all.

Adds a compile-time assertion in its place:

const fn assert_send<T: Send>() {}
assert_send::<DenseCapacity<i32>>();
assert_send::<SparseCapacity<i32>>();

so the property is still verified, and a future field that is not Send fails the build instead of being silently promised away by the hand-written impl.

Checking

Purely a removal; no behaviour changes. 291 tests pass, clippy and rustfmt clean.

This touches the same file as #819 but not the same lines; I checked they merge in either order.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Two unsafe impl Send in edmonds_karp that the compiler already provides

1 participant