More specific errors. - #598
Conversation
|
It seems that there are some tests failing due to my change to |
|
I looked into it some more, and I found this issue with this comment by one of the main contributors:
Since 0 is not a legal alignment, I'm going to make the assumption that it's okay to remove these tests that check for an alignment of 0. |
|
I decided to do a test to see what would happen if you tried to set the alignment to 0 just to make sure that it really wasn't a legal value, and this was the result when I tried to build the module: So it seems that setting the alignment to 0 can cause undesirable outcomes, so I think it's a good thing that I removed the ability for alignments to be 0. Edit: This is on inkwell 0.6.0 with LLVM 18.1. |
| ExtractOutOfRange, | ||
| #[error("Bitwidth of a value is incorrect")] | ||
| BitwidthError(&'static str), | ||
| #[error("The bitwidth of value must be a power of 2 and greater than 8.")] |
There was a problem hiding this comment.
I just copied that message from the message that was passed into the BitwidthError, so if it's wrong then it was wrong before.
TheDan64
left a comment
There was a problem hiding this comment.
Looks good; just have one question to clarify before merging
|
Any update on this? |
Description
Many of the result types returned
&'static str, or otherwise a wrapper around&'static str. I tried to find as many instances of this as I could to make the errors more specific. I may have missed some things.Related Issue
#595
How This Has Been Tested
Unfortunately, I'm unable to test it because the tests environment won't compile on my machine due to POSIX-only functionality.
#597
Option<Breaking Changes>
I felt that it was a good idea for errors to be more specific so that it would be easier to determine the source of the error.
Checklist