|
1 |
| -use rustc_abi::{CanonAbi, Size}; |
| 1 | +use rustc_abi::{CanonAbi, FieldIdx, Size}; |
2 | 2 | use rustc_middle::ty::layout::LayoutOf as _;
|
3 | 3 | use rustc_middle::ty::{self, Instance, Ty};
|
4 | 4 | use rustc_span::{BytePos, Loc, Symbol, hygiene};
|
@@ -159,23 +159,29 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
159 | 159 | 1 => {
|
160 | 160 | this.write_scalar(
|
161 | 161 | Scalar::from_target_usize(name.len().to_u64(), this),
|
162 |
| - &this.project_field(dest, 0)?, |
| 162 | + &this.project_field(dest, FieldIdx::from_u32(0))?, |
163 | 163 | )?;
|
164 | 164 | this.write_scalar(
|
165 | 165 | Scalar::from_target_usize(filename.len().to_u64(), this),
|
166 |
| - &this.project_field(dest, 1)?, |
| 166 | + &this.project_field(dest, FieldIdx::from_u32(1))?, |
167 | 167 | )?;
|
168 | 168 | }
|
169 | 169 | _ => throw_unsup_format!("unknown `miri_resolve_frame` flags {}", flags),
|
170 | 170 | }
|
171 | 171 |
|
172 |
| - this.write_scalar(Scalar::from_u32(lineno), &this.project_field(dest, 2)?)?; |
173 |
| - this.write_scalar(Scalar::from_u32(colno), &this.project_field(dest, 3)?)?; |
| 172 | + this.write_scalar( |
| 173 | + Scalar::from_u32(lineno), |
| 174 | + &this.project_field(dest, FieldIdx::from_u32(2))?, |
| 175 | + )?; |
| 176 | + this.write_scalar( |
| 177 | + Scalar::from_u32(colno), |
| 178 | + &this.project_field(dest, FieldIdx::from_u32(3))?, |
| 179 | + )?; |
174 | 180 |
|
175 | 181 | // Support a 4-field struct for now - this is deprecated
|
176 | 182 | // and slated for removal.
|
177 | 183 | if num_fields == 5 {
|
178 |
| - this.write_pointer(fn_ptr, &this.project_field(dest, 4)?)?; |
| 184 | + this.write_pointer(fn_ptr, &this.project_field(dest, FieldIdx::from_u32(4))?)?; |
179 | 185 | }
|
180 | 186 |
|
181 | 187 | interp_ok(())
|
|
0 commit comments