Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pub trait Array {
- const SIZE: usize;
- type Item;
- }
- impl<T> Array for [T; 1] {
- const SIZE: usize = 1;
- type Item = T;
- }
- fn func<A: Array>(a: A) -> [A::Item; A::SIZE] { // Doesn't work
- //fn func<A: Array>(a: A) -> [A::Item; Array::SIZE] { // Doesn't work
- }
- fn main() {
- func([1; 1]);
- }
Add Comment
Please, Sign In to add comment