Open
Description
My use case of this crate is as follow:
bounded_integer! {
#[repr(libc::c_int)]
pub struct TimeOut { -1..=libc::c_int::MAX }
}
bounded_integer! {
#[repr(usize)]
pub struct MaxEvents{ 1..=libc::c_int::MAX as usize }
}
Unfortunately, this can't be parsed by the macro.
For the first one we could have an alternate:
bounded_integer! {
#[repr(libc::c_int)]
pub struct TimeOut { -1.. }
}
This one is possible, I guess.
And the second one I could do:
const TMP : usize = libc::c_int::MAX as usize;
bounded_integer! {
#[repr(usize)]
pub struct MaxEvents{ 1..=TMP }
}
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.