-
Notifications
You must be signed in to change notification settings - Fork 90
fix(driver): make OpCode unsafe #651
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,7 +30,7 @@ impl Extra { | |
| } | ||
|
|
||
| /// Operations. | ||
| pub trait OpCode {} | ||
| pub unsafe trait OpCode {} | ||
|
|
||
| pub mod op; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -24,9 +24,9 @@ impl< | |||||
| { | ||||||
| } | ||||||
|
|
||||||
| impl OpCode for OpenFile {} | ||||||
| unsafe impl OpCode for OpenFile {} | ||||||
|
|
||||||
| impl OpCode for CloseFile {} | ||||||
| unsafe impl OpCode for CloseFile {} | ||||||
|
|
||||||
| impl<S: AsFd> OpCode for TruncateFile<S> {} | ||||||
|
||||||
| impl<S: AsFd> OpCode for TruncateFile<S> {} | |
| unsafe impl<S: AsFd> OpCode for TruncateFile<S> {} |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This implementation of the unsafe trait OpCode must be marked with unsafe. Change this to: unsafe impl<S: AsFd> OpCode for Sync {}
| impl<S: AsFd> OpCode for Sync<S> {} | |
| unsafe impl<S: AsFd> OpCode for Sync<S> {} |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This implementation of the unsafe trait OpCode must be marked with unsafe. Change this to: unsafe impl<S: AsFd> OpCode for ShutdownSocket {}
| impl<S: AsFd> OpCode for ShutdownSocket<S> {} | |
| unsafe impl<S: AsFd> OpCode for ShutdownSocket<S> {} |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These implementations of the unsafe trait OpCode must be marked with unsafe. Change to: unsafe impl<S: AsFd> OpCode for Accept {} and unsafe impl<S: AsFd> OpCode for Connect {}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This blanket implementation must be marked as unsafe since it implements the unsafe trait OpCode. Change this to: unsafe impl<T: PollOpCode + IourOpCode + ?Sized> OpCode for T {}