clarify semantics of ConstantIndex MIR projection
This commit is contained in:
parent
5a4ee43c38
commit
f0ddc7b472
2 changed files with 8 additions and 4 deletions
|
@ -1135,8 +1135,10 @@ pub enum ProjectionElem<V, T> {
|
|||
ConstantIndex {
|
||||
/// index or -index (in Python terms), depending on from_end
|
||||
offset: u64,
|
||||
/// The thing being indexed must be at least this long. For arrays this
|
||||
/// is always the exact length.
|
||||
/// The thing being indexed must be at least this long -- otherwise, the
|
||||
/// projection is UB.
|
||||
///
|
||||
/// For arrays this is always the exact length.
|
||||
min_length: u64,
|
||||
/// Counting backwards from end? This is always false when indexing an
|
||||
/// array.
|
||||
|
|
|
@ -768,8 +768,10 @@ pub enum ProjectionElem {
|
|||
ConstantIndex {
|
||||
/// index or -index (in Python terms), depending on from_end
|
||||
offset: u64,
|
||||
/// The thing being indexed must be at least this long. For arrays this
|
||||
/// is always the exact length.
|
||||
/// The thing being indexed must be at least this long -- otherwise, the
|
||||
/// projection is UB.
|
||||
///
|
||||
/// For arrays this is always the exact length.
|
||||
min_length: u64,
|
||||
/// Counting backwards from end? This is always false when indexing an
|
||||
/// array.
|
||||
|
|
Loading…
Add table
Reference in a new issue