-
Notifications
You must be signed in to change notification settings - Fork 8
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
Support custom reprs, and constants in range bounds #8
Comments
The trouble with allowing custom type reprs is that I think the best option is to special-case |
I don't think it's a good idea, do a specialization just for the libc add a lot of work for this crate. I think this need a general solution or just don't do it. After all I don't think there will be ever a OS where I'm fine with: bounded_integer! {
#[repr(i32)]
pub struct TimeOut { -1..=i32::MAX }
}
static_assertions::assert_type_eq_all!(libc::c_int, i32); |
And I just encountered another problem - automatic I will leave this issue open because someone might potentially come along with a better solution in the future, but for now I don't think I can solve this. |
My use case of this crate is as follow:
Unfortunately, this can't be parsed by the macro.
For the first one we could have an alternate:
This one is possible, I guess.
And the second one I could do:
But I guess it will be hard.
There is also that
#[repr(libc::c_int)]
is not possible but#[repr(transparent)]
should allow that without problem not need to use#[repr(libc::c_int)]
directly for structure. I don't think it's possible for enum rust-lang/rust#68122.This is just a feedback of my personal use case, I totally agree with closing this.
The text was updated successfully, but these errors were encountered: