Comments (10)
I think it should be possible to move the DEBUG_STR
constant to a separate, private trait. Looking into it right now.
from x86_64.
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 DEBUG_STR
is probably the better solution.
from x86_64.
Thanks for reporting! I definitely see that this is confusing.
I am not sure if this is actually a rustc issue or not.
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).
from x86_64.
Yes, but in that case we should probably redefine the DEBUG_STR
constant in the respective child traits. Otherwise it's not included in the docs and only accessible using generics.
from x86_64.
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
DebugOutput
, doesn't it?Isn't that what you meant with #404 anyway?
Users should never implement this trait themselves. [...]
#404 is meant to prevent users from implementing PageSize
on their own types. What I meant with my comment was that with the changes in a5585ef, it would be impossible for users to create generic implementations of Mapper<S>
.
from x86_64.
I can't think of a good way to prevent this, other than by making the Sealed
trait private. Unfortunately, private supertraits are only allowed starting with Rust 1.74 following RFC 2145. Our current MSRV is 1.59, so that's not an option.
from x86_64.
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...
from x86_64.
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?
from x86_64.
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 DebugOutput
, doesn't it?
from x86_64.
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
DebugOutput
, doesn't it?
Isn't that what you meant with #404 anyway?
Users should never implement this trait themselves. [...]
from x86_64.
Related Issues (20)
- `SelectorErrorCode::index()` parses the wrong bits HOT 6
- const fn gdt creation HOT 4
- Set minimal scoped permissions to github workflow HOT 1
- Create a Security Policy
- Mutable references in page table implementation? HOT 1
- IDT and page table code causing trouble in Confidential Computing space HOT 1
- Hash pin workflow dependencies HOT 9
- `Descriptor::tss_segment` too restrictive? HOT 2
- recursive page table with recursive index 511 is unsound HOT 7
- How can I set 2MiB page frame in my Page Directory Table? HOT 1
- How do I map to a virtualized physical address? HOT 1
- Enable OpenSSF Scorecard Action HOT 2
- [Question] Is there a reason to not support pagemaps level 5 ? HOT 2
- Trait for Entry handler function types? HOT 2
- Should we add an register abstraction? How should it work with and ?
- `VirtAddr` arithmetic may panic HOT 2
- Returning FrameAlreadyMapped error when it shouldn't HOT 10
- Should have a way to construct an `InterruptStackFrameValue`? HOT 3
- A `VirtualAddr` panic is triggered when the page table called `clean_up` HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from x86_64.