Skip to content
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

Make the errors mapping table entries less cryptic #11

Merged
merged 1 commit into from
Aug 3, 2022

Conversation

kennystrawnmusic
Copy link
Contributor

@kennystrawnmusic kennystrawnmusic commented Aug 2, 2022

I've spent hours debugging the following panic message thrown when a value larger than the 8 bits defined in the timer and error vector constants (I was trying to put 0x320 in the timer vector field and 0x280 in the error vector field per what's specified on osdev.org) is plugged into the builder functions:

assertion failed: `(left == right)`
left: `3`
right: `0`

This message is coming from the bit crate, which performs an assert_eq! check to ensure that the bits are of the same length. Yet, it does absolutely nothing to inform the developer of what is being done wrong. So, I'm submitting this pull request to save other people the trouble by printing a more legible error message.

@kwzhao kwzhao merged commit 5c43eac into kwzhao:master Aug 3, 2022
@kwzhao
Copy link
Owner

kwzhao commented Aug 3, 2022

Thanks @kennystrawnmusic!

kennystrawnmusic added a commit to kennystrawnmusic/x2apic that referenced this pull request Aug 4, 2022
kwzhao added a commit that referenced this pull request Aug 4, 2022
Bump version to 0.4.1 to take #11 to crates.io
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants