-
Notifications
You must be signed in to change notification settings - Fork 132
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
0.15 Tracking issue #262
Comments
Note that If we support only 1.61 and later, we could then remove most of our @phil-opp @Freax13 would we want increase our minimum rust version to be |
Both `const_fn_fn_ptr_basics` and `const_fn_trait_bound` were stabilized in Rust relese 1.61. We can't immediately remove the `const_fn!` quite yet. 1.61 is not yet on stable, and even it were, removing them would increase our MSRV to 1.61 (which we may or may not want to do in a patch release). See also: #262 (comment) Signed-off-by: Joe Richey <[email protected]>
Ah, that's great! Increasing the minimum Rust version for |
Oh that crate looks amazing, it would let us get rid of our If we don't need Rust 1.61 for |
Sure, sounds good to me! |
Oh wait we use inline assembly, so the min stable version is already 1.59 if the "instructions" feature is used. We should probably just make that the unconditionally minimum supported version for 0.15 |
One thing I was considering for 0.15 were changes to #[repr(transparent)]
pub struct VirtAddr(*const ()); on 64-bit platforms, we could then have the following impl VirtAddr {
// Safety: raw pointer has to be canonical
#[cfg(target_pointer_width = "64")]
pub const unsafe fn from_ptr_unsafe<T>(ptr: *const T) -> Self {
Self(ptr as *const ())
}
#[cfg(target_arch = "x86_64")]
pub const fn from_ref<T>(r: &T) -> Self {
// Safety: references point to valid data, so are canonical.
unsafe { Self::from_ptr_unsafe(r) }
}
} This would make it possible to construct something like a The downside of this (other than implementation complexity) is that the following methods would have to be made non-const:
I'm not sure how bad this downside would be. |
We probably need to think about pointer provenance at some point. There is currently an open proposal to make the usize to pointer conversion more strict. See the Rust's Unsafe Pointer Types Need An Overhaul post for some background information. I'm not sure what the correct approach for our Given this issue, I don't think that it's a good idea to switch |
I agree with that, having some methods only be const on 64-bit targets seems unintuitive. That being said I'd still be interested in potential use cases. |
Those articles are very interesting, and I agree that changing things in this space is really complicated. It definitely seems like keeping
This is a good idea, I'll see if I can put some examples together in a separate tracking issue. |
I can't think of anything. |
Me neither! |
What's the state of this? Should we finally prepare the 0.15 release? |
We could wait for #404, but this also wouldn't be a deal breaker for me, especially because we don't seem to have come to a final design on the changes just yet. Other than that, I think we're ready. |
I'll get started on rebasing next onto master. |
Hm, never mind, I forgot we don't do rebases. I'll get started on merging next into master instead. |
I'm done with that. Depending on whether on not we want to wait for some other breaking prs to also be included, I can create a pr. |
This issue tracks any breaking changes we want to make for
0.15
.NOTE: All breaking changes should be made against the
next
branch, this branch should then be merged in right before releasing0.15
. Also, remember to updateChangelog.md
.software_interrupt!()
macro to be a cosnt generic functionsoftware_interrupt<const NUM: u8>()
. Done in Change software_interrupt to use min_const_generics #227 (and also replace software_interrupt! macro with generic function #259 and software_interrupt: Add additional testing #260)idt::Entry
andidt::EntryOptions
structures to move the code selector intoEntryOptions
. Also, introduce theInterruptFn
trait which allows for abstracting over all function pointers that can be used as interrupt handlers. Done in idt: Fixup Options structure and cleanup set_handler_fn #226 (and also in Resubmission of #226 #261)step_trait
to implementStep
forPhysFrame
andPage
. See Implementcore::iter::Step
forPhysFrame
andPage
#212 . This may or may not be a breaking change, depending on how we handlePageRange
/PageRangeInclusive
/etc....step_trait
isn't going to be stable for awhile, this doesn't seem like something we need to do for 0.15.InterruptStackFrameValue
. See Use SegmentSelector in InterruptStackFrame #263:code_segment
should be aSegmentSelector
(what about padding?)cpu_flags
should be aRFlags
changecpu_flags
's type toRFlags
#324stack_segment
should be aSegmentSelector
(what about padding?)rip
andrsp
?Cr4Flags::PROTECTION_KEY
=>Cr4Flags::PROTECTION_KEY_USER
XCr0Flags::YMM
=>XCr0Flags::AVX
VirtAddr::try_new
VirtAddrNotValid
andPhysAddrNotValid
to actually contain the invalid address instead of just containing the bad high bits. Done in Fix:VirtAddrNotValid
andPhysAddrNotValid
should contain the whole address #347 against themaster
branch.usize
impls forAdd
/Sub
onVirtAddr
/PhysAddr
, see DefineCheckedAdd
andCheckedSub
traits #293 (comment) Breaking change done in Remove usize trait impls #364load_tss
andGlobalDescriptorTable
#323from_raw_entries
?The text was updated successfully, but these errors were encountered: