]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_mir_build/src/build/expr/category.rs
change thir to lazily create constants
[rust.git] / compiler / rustc_mir_build / src / build / expr / category.rs
index d31f6ed93840ad08deb23604ceb72a6f91d2c915..a932ddbd53e3421c868d64bfc25f8f5af664eec9 100644 (file)
@@ -69,9 +69,12 @@ impl Category {
             | ExprKind::AssignOp { .. }
             | ExprKind::ThreadLocalRef(_) => Some(Category::Rvalue(RvalueFunc::AsRvalue)),
 
-            ExprKind::ConstBlock { .. } | ExprKind::Literal { .. } | ExprKind::StaticRef { .. } => {
-                Some(Category::Constant)
-            }
+            ExprKind::ConstBlock { .. }
+            | ExprKind::Literal { .. }
+            | ExprKind::ScalarLiteral { .. }
+            | ExprKind::ConstParam { .. }
+            | ExprKind::StaticRef { .. }
+            | ExprKind::NamedConst { .. } => Some(Category::Constant),
 
             ExprKind::Loop { .. }
             | ExprKind::Block { .. }