S0030: tuple field is out of bounds
Generated from rellum-diagnostics/src/db.rs.
Explanation
Tuple field indexes are zero-based and must refer to an existing tuple element. Accessing .N past the tuple's last element would read a value that is not part of the tuple.
Common causes
- using .1 on a one-element tuple
- using .2 on a two-element tuple
- counting tuple fields from one instead of zero
Canonical fixes
- use an existing tuple field index
Before:
value = pair.2
After:
value = pair.1
- add the missing tuple element if the shape is wrong
Before:
pair = (left, right)
value = pair.2
After:
triple = (left, middle, right)
value = triple.2
Code example
value = pair.2