I would absolutely expect production code to use that outside of tests.
See, for example, how rustc uses panicking slicing into IndexVecs all the time by VariantIdx, by BasicBlock, by FieldIdx, etc.
Obviously it uses iter_enumerated or similar where feasible. But sometimes you have a Variants::Multiple with a FieldIdx of the field holding the tag, and you use fields[field_idx] to get it.
In those places it wouldn't be better to fields.get(field_idx).expect("the field index to exist in the layout that said to use it"). The fact that it's using indexing at all is the "well of course I expect it to be in-range".
Then hope you have a @matthiaskrgr to fuzz things and find out if there's some edge case that was missed and file bugs about it ![]()