Skip to content
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

Remove wrapper functions from c.rs #128092

Merged
merged 1 commit into from
Jul 24, 2024
Merged

Conversation

ChrisDenton
Copy link
Member

@ChrisDenton ChrisDenton commented Jul 23, 2024

I'd like for the windows c.rs just to contain the basic platform definitions and not anything higher level unless absolutely necessary. So this removes some wrapper functions that weren't really necessary in any case. The functions are only used in a few places which themselves are relatively thin wrappers. The "interesting" bit is that we had an AlertableIoFn that abstracted over ReadFileEx and WriteFileEx. I've replaced this with a closure.

Also I removed an #[allow(unsafe_op_in_unsafe_fn)] while I was moving things around.

@rustbot rustbot added O-windows Operating system: Windows S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jul 23, 2024
apccontext: *mut c_void,
iostatusblock: &mut IO_STATUS_BLOCK,
buffer: *mut crate::mem::MaybeUninit<u8>,
apccontext: *const core::ffi::c_void,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add core::ffi to the module imports here?

Comment on lines -341 to -342
byteoffset: Option<&i64>,
key: Option<&u32>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these lifetimes would have been very useful if the thing we returned also had a lifetime... unfortunately...

@workingjubilee
Copy link
Member

You can address the diff in a followup since there's preexisting core::ffi::c_voids in that module.

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jul 23, 2024

📌 Commit 8c3ce60 has been approved by workingjubilee

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 23, 2024
@bors bors merged commit ee77dda into rust-lang:master Jul 24, 2024
6 checks passed
@rustbot rustbot added this to the 1.82.0 milestone Jul 24, 2024
@ChrisDenton ChrisDenton deleted the wrappers branch July 24, 2024 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-windows Operating system: Windows S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants