diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2024-04-03 17:49:59 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2024-04-03 19:06:22 +0300 |
| commit | b40ea03f8a9a94c294679b9f261b86ded120454f (patch) | |
| tree | 18e32ab93e0d4506cc8c973e3be253ebe079c03f /compiler/rustc_ty_utils | |
| parent | ceab6128fa48a616bfd3e3adf4bc80133b8ee223 (diff) | |
| download | rust-b40ea03f8a9a94c294679b9f261b86ded120454f.tar.gz rust-b40ea03f8a9a94c294679b9f261b86ded120454f.zip | |
rustc_index: Add a `ZERO` constant to index types
It is commonly used.
Diffstat (limited to 'compiler/rustc_ty_utils')
| -rw-r--r-- | compiler/rustc_ty_utils/src/layout.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_ty_utils/src/layout.rs b/compiler/rustc_ty_utils/src/layout.rs index 331970ac362..dd1f2322c41 100644 --- a/compiler/rustc_ty_utils/src/layout.rs +++ b/compiler/rustc_ty_utils/src/layout.rs @@ -377,7 +377,7 @@ fn layout_of_uncached<'tcx>( } // Type of the first ADT field: - let f0_ty = fields[FieldIdx::from_u32(0)].ty(tcx, args); + let f0_ty = fields[FieldIdx::ZERO].ty(tcx, args); // Heterogeneous SIMD vectors are not supported: // (should be caught by typeck) |
