Array cannot be indexed by RangeFull?
问题 Consider the following example: use std::ops::Index; use std::ops::RangeFull; fn f<T: Index<RangeFull>>(x: T) {} fn main() { let x: [i32; 4] = [0, 1, 2, 3]; f(x); } Upon calling f(x) , I get an error: error[E0277]: the type `[i32; 4]` cannot be indexed by `std::ops::RangeFull` --> src/main.rs:8:5 | 8 | f(x); | ^ `[i32; 4]` cannot be indexed by `std::ops::RangeFull` | = help: the trait `std::ops::Index<std::ops::RangeFull>` is not implemented for `[i32; 4]` note: required by `f` --> src/main