Conversation
src/types.rs
Outdated
| /// while providing `Default`. | ||
| #[repr(transparent)] | ||
| #[derive(Clone, Copy)] | ||
| pub struct Padding<T: Copy>(MaybeUninit<T>); |
There was a problem hiding this comment.
I don't think we need to export this, pub(crate) should be fine
|
Fyi you can delete the template in the PR body if it's not relevant |
8cdddd4 to
1daca12
Compare
src/lib.rs
Outdated
| pub use new::*; | ||
|
|
||
| mod types; | ||
| pub use types::*; |
There was a problem hiding this comment.
There shouldn't be anything to export
|
LGTM with the last change, any reason this is marked as a draft? |
|
It seems like ctest still fails with just these changes. |
1daca12 to
f72c749
Compare
This bit? It just needs an |
f72c749 to
b20e865
Compare
|
For style check, this will need an update at libc/libc-test/test/check_style.rs Line 20 in c0071cc |
8dd85bd to
fa9d83e
Compare
src/types.rs
Outdated
| use core::clone::Clone; | ||
| use core::default::Default; | ||
| use core::marker::Copy; | ||
| use core::mem::MaybeUninit; | ||
| use core::prelude::rust_2024::derive; |
There was a problem hiding this comment.
If you need to import all of these, just add Default to the prelude macro and add use crate::prelude::* here.
This adds a bit of trickiness: there is no crate::prelude in some cases
Lines 143 to 145 in c0071cc
mod types into the prelude as well.
6d3757e to
14167c4
Compare
src/types.rs
Outdated
| //! Platform-agnostic support types. | ||
|
|
||
| use core::mem::MaybeUninit; | ||
| use core::prelude::rust_2024::derive; |
There was a problem hiding this comment.
Sigh I was thinking this was already in the prelude, sorry I keep steering you wrong here.
Add this to prelude! instead, that's consistent. Also it will need to be ::core::prelude::v1::derive like https://github.com/rust-lang/libc/blob/c0071cc9f9385da6352e40824cfd77334e85f72d/src/macros.rs#L117C15-L117C43, the 2024 prelude isn't available until way after our MSRV.
14167c4 to
546a941
Compare
tgross35
left a comment
There was a problem hiding this comment.
Thanks for all the cycles, looks great :)
(backport <rust-lang#4632>) (cherry picked from commit bbafd45)
Description
Adds a struct for padding types.
Sources
Checklist
libc-test/semverhave been updated*LASTor*MAXareincluded (see #3131)
cd libc-test && cargo test --target mytarget);especially relevant for platforms that may not be checked in CI