rust-osdev / x86_64

Library to program x86_64 hardware.
https://docs.rs/x86_64
Apache License 2.0
802 stars 133 forks source link

fix signature of Step::steps_between implementations #513

Open Freax13 opened 3 days ago

Freax13 commented 3 days ago

A recent nightly changed the signature of Step::steps_between to match the signature of Iterator::size_hint. This PR changes our implementations to match the new signature. This PR also fixes the Step implementation of Page on 32-bit platforms.

Closes #512 Cc @isaka-james @tsatke

Freax13 commented 3 days ago

It also simplifies them by forwarding to the Step implementations of the wrapped types (e.g. VirtAddr calls the Step implementation of u64).

Oops, this obviously doesn't work on stable, duh. I'll revert back to the old implementations and fix them instead.

Freax13 commented 3 days ago

Re @tsoutsman https://github.com/tsatke/devos/commit/547946e014571121c74e79079d7cd66a6898c094:

force a toolchain version until https://github.com/rust-osdev/x86_64/pull/513 is merged and x2apic releases a new version that uses the fix

We'll likely do a minor release (we can't do patch releases because we're pre 1.0), so you won't have to wait on x2apic to bump its dependency on x86_64. Running cargo update -p x86_64 should suffice.

bjorn3 commented 3 days ago

This should probably also be backported to the 0.14 series. Blog os depends on bootloader 0.9 which uses x86_64 0.14.