File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -47,11 +47,11 @@ where
47
47
// In the empty case, we can just reuse the existing pointer since
48
48
// it won't be dereferenced anyway. It is not safe to offset by one
49
49
// since the allocation may be empty.
50
- self . ptr . cast ( )
50
+ ptr_re
51
51
} else {
52
- // Safe because `self` is nonempty, so we can safely offset into
53
- // the first element.
54
- unsafe { self . ptr . cast ( ) . add ( 1 ) }
52
+ // In the nonempty case, we can safely offset into the first
53
+ // (complex) element.
54
+ unsafe { ptr_re . add ( 1 ) }
55
55
} ;
56
56
57
57
// `Complex` is `repr(C)` with only fields `re: T` and `im: T`. So, the
@@ -125,11 +125,11 @@ where
125
125
// In the empty case, we can just reuse the existing pointer since
126
126
// it won't be dereferenced anyway. It is not safe to offset by one
127
127
// since the allocation may be empty.
128
- self . ptr . cast ( )
128
+ ptr_re
129
129
} else {
130
- // Safe because `self` is nonempty, so we can safely offset into
131
- // the first element.
132
- unsafe { self . ptr . cast ( ) . add ( 1 ) }
130
+ // In the nonempty case, we can safely offset into the first
131
+ // (complex) element.
132
+ unsafe { ptr_re . add ( 1 ) }
133
133
} ;
134
134
135
135
// `Complex` is `repr(C)` with only fields `re: T` and `im: T`. So, the
You can’t perform that action at this time.
0 commit comments