-
Notifications
You must be signed in to change notification settings - Fork 7
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
consider const panic if min > max #21
Comments
Thank you for this idea! I tried this on stable (1.63): trait CheckBounds<const L: usize, const U: usize> {
const WB: u8 = if Self::L > Self::U || Self::L == 0 {
panic!("invalid bounds")
} else {
1
};
}
impl<T, const L: usize, const U: usize> CheckBounds<L, U> for BoundedVec<T, L, U> {} and got:
Any ideas? Maybe you're have some features enabled that allow this. |
Oh, it's |
you may expose in toml so #[cfg(feature(generic_const_exprs)) so you can have both stable and unstable, unstable with future proof feature |
Good idea! Thank you! |
bounded-vec/src/bounded_vec.rs
Line 14 in 8265180
that compiles for me:
The text was updated successfully, but these errors were encountered: