-
Notifications
You must be signed in to change notification settings - Fork 19
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
Show a better error on wrong struct size #62
base: main
Are you sure you want to change the base?
Conversation
nice. I love that the location of the error ends up being the |
9528b98
to
547e55a
Compare
seeing the same thing here. I guess the location does not end up being the attribute.strange that when consts are used in this position, they generate "erroneous constant" info instead of an error. |
trying to get professional help now: https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/.22note.3A.20erroneous.20constant.20used.22/near/430142304 |
/// This is used in `bitsize.rs` gen, for showing a compile error. | ||
/// Only needed because const contexts can't use `format!` and `COMPUTED_SIZE` is not a plain number. | ||
/// `evaluation of `bilge::AssertEquals::<19, 18>::EQUAL` failed` will tell you what's wrong. | ||
pub struct AssertEquals<const COMPUTED_SIZE: usize, const DECLARED_SIZE: usize>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider #[doc(hidden)]
:)
Should be tested on a free standing project with both stable and nightly, since in-project I sometimes just saw "evaluation of constant value failed", which is not that helpful.