File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
compiler/rustc_codegen_ssa/src/mir Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -45,9 +45,15 @@ pub enum OperandValue<V> {
45
45
Immediate ( V ) ,
46
46
/// A pair of immediate LLVM values. Used by wide pointers too.
47
47
///
48
- /// An `OperandValue` *must* be this variant for any type for which
48
+ /// # Invariants
49
+ /// - For `Pair(a, b)`, `a` is always at offset 0, but may have `FieldIdx(1..)`
50
+ /// - `b` is not at offset 0, because `V` is not a 1ZST type.
51
+ /// - `a` and `b` will have a different FieldIdx, but otherwise `b`'s may be lower
52
+ /// or they may not be adjacent, due to arbitrary numbers of 1ZST fields that
53
+ /// will not affect the shape of the data which determines if `Pair` will be used.
54
+ /// - An `OperandValue` *must* be this variant for any type for which
49
55
/// [`LayoutTypeCodegenMethods::is_backend_scalar_pair`] returns `true`.
50
- /// The backend values in this variant must be the *immediate* backend types,
56
+ /// - The backend values in this variant must be the *immediate* backend types,
51
57
/// as returned by [`LayoutTypeCodegenMethods::scalar_pair_element_backend_type`]
52
58
/// with `immediate: true`.
53
59
Pair ( V , V ) ,
You can’t perform that action at this time.
0 commit comments