-
Notifications
You must be signed in to change notification settings - Fork 77
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
Generic primitive type parameter with std::marker::Sized bound #100
Comments
What version were you using when you tried this? As of 0.14.7, I don't reproduce something exactly like that. Perhaps your original struct Array<T, N: ArrayLength<T>> {
data: GenericArray<T, N>,
}
impl<T: Sized> Array<T, U3> {
pub fn new(x: T, y: T, z: T) -> Self {
Array {
data: GenericArray::from([x, y, z]),
}
}
} works fine, though. EDIT: Of course, by now you may be able to use const-generics for your uses. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I am trying to implement something that looks like this for some tuple struct Array :
Unfortunately this seems to be impossible for now and the compilers complains that
arr![T; x, y, z]
has no fixed size at compile-time. It even points me to theimpl<T: std::marker::Sized>
telling me the parameter nneds to bestd::marker::Sized
even if it is already bounded.I suppose there must be a way in the macro to add this condition on T without loss of generality but I'm not familiar with procedural macros myself.
Any tip here?
Cheers,
Philippe
The text was updated successfully, but these errors were encountered: