You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 the impl<T: std::marker::Sized> telling me the parameter nneds to be std::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:
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 Array struct was defined as struct Array<T: ?Sized, N: ArrayLength<T>> { ... }, which would have indeed failed to compile due to the ?Sized bound, which GenericArray does not support containing.
structArray<T,N:ArrayLength<T>>{data:GenericArray<T,N>,}impl<T:Sized>Array<T,U3>{pubfnnew(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.
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: