-
Notifications
You must be signed in to change notification settings - Fork 143
Sealed::DEBUG_STR
is publicly accessible
#470
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
Comments
Thanks for reporting! I definitely see that this is confusing.
See rust-lang/rust#67105 and rust-lang/rust#83882. It looks like the is no consensus on what should be the expected behavior yet (forbid access in generic code or allow access in non-generic code too). |
I can't think of a good way to prevent this, other than by making the |
I think it should be possible to move the |
It kind of works, but it leads to a lot of additional bounds on the new private trait: a5585ef . I don't think that this is an improvement... |
I guess the alternative would be to commit to having this part of the public API even though that was not what we wanted in #404, right? |
Yes, but in that case we should probably redefine the |
x86_64/src/structures/paging/mapper/mod.rs Line 113 in a5585ef
This makes it impossible for users to add their own generic implementations because they can't name |
Yes it does, at least in the current implementation. Maybe it's possible to avoid this somehow, but it's probably not worth the trouble. So exposing |
Isn't that what you meant with #404 anyway?
|
#404 is meant to prevent users from implementing |
Background: We use
v0.14
sPageSize::SIZE_AS_DEBUG_STR
in the Hermit loader (src/arch/x86_64/paging.rs#L31
), which can be easily replaced.I interpret the discussion in #404 so that the intention was to remove
Sealed::DEBUG_STR
from the public API.This issue is to inform you that while the
Sealed
trait is not nameable, you can still useDEBUG_STR
when using generics:I am not sure if this is actually a rustc issue or not.
The text was updated successfully, but these errors were encountered: