Skip to content

Remove questionable unsafe impl Send#869

Open
sholderbach wants to merge 1 commit intonushell:mainfrom
sholderbach:sync-and-sound
Open

Remove questionable unsafe impl Send#869
sholderbach wants to merge 1 commit intonushell:mainfrom
sholderbach:sync-and-sound

Conversation

@sholderbach
Copy link
Copy Markdown
Member

HistoryCompleter is not Send due to it containing a reference to a &dyn History which was only trait History: Send.
Here the property of a type T needing to implement Sync for its &T to be Send comes into play. Thus this unsafe impl Send is unsound.

The change of making trait History: Send + Sync makes HistoryCompleter: Send automatically and should be compatible for all sound implementations.

`HistoryCompleter` is not `Send` due to it containing a reference to a
`&dyn History` which was only `trait History: Send`.
Here the property of a type T needing to implement `Sync` for its `&T`
to be `Send` comes into play. Thus this `unsafe impl Send` is unsound.

The change of making `trait History: Send + Sync` makes
`HistoryCompleter: Send` automatically and should be compatible for all
sound implementations.
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.

1 participant