I am currently working on a project and encountered a trait mismatch error in the x86_64 crate while building. Since I don't have time to rewrite the library, I decided to test the crate separately by cloning it and attempting to build it.
Steps I followed:
Cloned the repository and tried building it on a fresh setup.
Encountered the same error related to a trait mismatch in the steps_between method in the x86_64 crate.
The error message I am receiving is as follows:
error[E0053]: method `steps_between` has an incompatible type for trait
--> /home/masterplan/.cargo/registry/src/index.crates.io-6f17d22bba15001f/x86_64-0.15.1/src/addr.rs:362:51
|
362 | fn steps_between(start: &Self, end: &Self) -> Option<usize> {
| ^^^^^^^^^^^^^ expected `(usize, Option<usize>)`, found `Option<usize>`
|
= note: expected signature `fn(&addr::VirtAddr, &addr::VirtAddr) -> (usize, Option<usize>)`
found signature `fn(&addr::VirtAddr, &addr::VirtAddr) -> Option<usize>`
help: change the output type to match the trait
|
362 | fn steps_between(start: &Self, end: &Self) -> (usize, Option<usize>) {
| ~~~~~~~~~~~~~~~~~~~~~~
Steps to reproduce:
Clone the repository and enter the directory:
git clone https://github.com/rust-osdev/x86_64
cd x86-64
Set the Rust toolchain to nightly (already set in my environment):
rustup default nightly
Attempt to build the project with the following command:
cargo build
Result:
The build fails with the error related to the trait mismatch, as shown in the terminal output above.
I am currently working on a project and encountered a trait mismatch error in the
x86_64
crate while building. Since I don't have time to rewrite the library, I decided to test the crate separately by cloning it and attempting to build it.Steps I followed:
steps_between
method in thex86_64
crate.The error message I am receiving is as follows:
Steps to reproduce:
Clone the repository and enter the directory:
Set the Rust toolchain to nightly (already set in my environment):
Attempt to build the project with the following command:
Result:
The build fails with the error related to the trait mismatch, as shown in the terminal output above.
Screenshots/Terminal Output: