diff options
| author | Lukas Markeffsky <@> | 2025-01-27 04:30:00 +0100 |
|---|---|---|
| committer | Lukas Markeffsky <@> | 2025-01-30 17:47:44 +0100 |
| commit | 10fc0b159ee6e5281bf38f65680082961dd7bec3 (patch) | |
| tree | 9abdb74a542fbec70d97e48b43e660bb01793eac /compiler/rustc_ty_utils/src/consts.rs | |
| parent | 5a45ab9738330fb317d49e3594c2db5248b1e971 (diff) | |
| download | rust-10fc0b159ee6e5281bf38f65680082961dd7bec3.tar.gz rust-10fc0b159ee6e5281bf38f65680082961dd7bec3.zip | |
introduce `ty::Value`
Co-authored-by: FedericoBruzzone <federico.bruzzone.i@gmail.com>
Diffstat (limited to 'compiler/rustc_ty_utils/src/consts.rs')
| -rw-r--r-- | compiler/rustc_ty_utils/src/consts.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_ty_utils/src/consts.rs b/compiler/rustc_ty_utils/src/consts.rs index 51a7c976f60..931c36137ee 100644 --- a/compiler/rustc_ty_utils/src/consts.rs +++ b/compiler/rustc_ty_utils/src/consts.rs @@ -22,16 +22,16 @@ fn destructure_const<'tcx>( tcx: TyCtxt<'tcx>, const_: ty::Const<'tcx>, ) -> ty::DestructuredConst<'tcx> { - let ty::ConstKind::Value(ct_ty, valtree) = const_.kind() else { + let ty::ConstKind::Value(cv) = const_.kind() else { bug!("cannot destructure constant {:?}", const_) }; - let branches = match valtree { + let branches = match cv.valtree { ty::ValTree::Branch(b) => b, _ => bug!("cannot destructure constant {:?}", const_), }; - let (fields, variant) = match ct_ty.kind() { + let (fields, variant) = match cv.ty.kind() { ty::Array(inner_ty, _) | ty::Slice(inner_ty) => { // construct the consts for the elements of the array/slice let field_consts = branches |
