diff options
| author | Boxy <supbscripter@gmail.com> | 2024-06-03 02:34:35 +0100 |
|---|---|---|
| committer | Boxy <supbscripter@gmail.com> | 2024-06-05 22:25:41 +0100 |
| commit | a9702a66684f0e1f412d92a83761be2e461b69fb (patch) | |
| tree | a0996c6eb298ce6f655671c36517f7dd44e501c4 /compiler/rustc_mir_build/src | |
| parent | 58feec9b85a18d26507dfe6d075fd128a1265888 (diff) | |
| download | rust-a9702a66684f0e1f412d92a83761be2e461b69fb.tar.gz rust-a9702a66684f0e1f412d92a83761be2e461b69fb.zip | |
Add `Ty` to `ConstKind::Value`
Diffstat (limited to 'compiler/rustc_mir_build/src')
| -rw-r--r-- | compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs b/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs index 8d881713eeb..cc5aa8ea9cc 100644 --- a/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs +++ b/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs @@ -101,7 +101,7 @@ impl<'tcx> ConstToPat<'tcx> { // level of indirection can be eliminated let have_valtree = - matches!(cv, mir::Const::Ty(c) if matches!(c.kind(), ty::ConstKind::Value(_))); + matches!(cv, mir::Const::Ty(c) if matches!(c.kind(), ty::ConstKind::Value(_, _))); let inlined_const_as_pat = match cv { mir::Const::Ty(c) => match c.kind() { ty::ConstKind::Param(_) @@ -113,8 +113,8 @@ impl<'tcx> ConstToPat<'tcx> { | ty::ConstKind::Expr(_) => { span_bug!(self.span, "unexpected const in `to_pat`: {:?}", c.kind()) } - ty::ConstKind::Value(valtree) => { - self.recur(valtree, cv.ty()).unwrap_or_else(|_: FallbackToOpaqueConst| { + ty::ConstKind::Value(ty, valtree) => { + self.recur(valtree, ty).unwrap_or_else(|_: FallbackToOpaqueConst| { Box::new(Pat { span: self.span, ty: cv.ty(), |
