In this case, pool.get::<3>() apparently read an element which out of the boundary, but this code compiles. The boundary check is done at runtime, instead of compile time. Did I do anything wrong?
For better or worse, array indexing happens at runtime, and the bounds checking is not a separate part of the indexing operation. However, I don’t think there’s a fundamental reason why the compiler couldn’t be helpful and lint known out-of-bounds accesses, except that if it were a strict error it would make existing valid code stop compiling (probably tests mostly). Even a warning could be annoying, and break builds that have warnings set to deny. A Clippy lint might make sense, at least as a first step.