about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_mir_build/src/builder/expr/as_rvalue.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/rustc_mir_build/src/builder/expr/as_rvalue.rs b/compiler/rustc_mir_build/src/builder/expr/as_rvalue.rs
index d6dc12e5955..3a5839f2d40 100644
--- a/compiler/rustc_mir_build/src/builder/expr/as_rvalue.rs
+++ b/compiler/rustc_mir_build/src/builder/expr/as_rvalue.rs
@@ -661,8 +661,11 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
     /// operations that can be const-folded today.
     fn check_constness(&self, mut kind: &'a ExprKind<'tcx>) -> bool {
         loop {
+            debug!(?kind, "check_constness");
             match kind {
-                &ExprKind::PointerCoercion {
+                &ExprKind::ValueTypeAscription { source: eid, user_ty: _, user_ty_span: _ }
+                | &ExprKind::Use { source: eid }
+                | &ExprKind::PointerCoercion {
                     cast: PointerCoercion::Unsize,
                     source: eid,
                     is_from_as_cast: _,