-
Notifications
You must be signed in to change notification settings - Fork 133
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
seal off the PageSize
trait
#404
Conversation
We already have a x86_64/src/instructions/port.rs Lines 69 to 73 in a143355
Could we have a common place to put all sealed traits or try to reuse stuff? |
Given that both In pub(crate) mod sealed {
pub trait Sealed {
const DEBUG_STR: &'static str;
}
} Then both |
This would also make |
I definitely would prefer it being an implementation detail rather than something that we commit to as part of our stable API. |
A few thoughts on this:
|
That's fine with me.
I'm not aware of any UB that can be caused by faking a
|
The traits we currently want to seal off are all marker traits and they all share some kind of debug representation.
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.
Looks reasonable to me modulo minor nits.
Users should never implement this trait themselves. This also allows us to add more supertraits to `PageSize` and `NotGiantPageSize` without introducing a major breaking change.
Any idea on a release for this change? I'd rather not have to worry about non-4kib aligned page size types 😅 since |
Users should never implement this trait themselves. This also allows us to add more supertraits to
PageSize
andNotGiantPageSize
without introducing a major breaking change.This is a breaking change (though I really hope users haven't been doing this previously).