]> git.lizzy.rs Git - rust.git/commitdiff
Explain why we are creating an aggregate constant
authorOliver Scherer <github35764891676564198441@oli-obk.de>
Tue, 18 Aug 2020 11:57:32 +0000 (13:57 +0200)
committerOliver Scherer <github35764891676564198441@oli-obk.de>
Tue, 18 Aug 2020 11:57:32 +0000 (13:57 +0200)
src/librustc_mir/transform/const_prop.rs

index 7b4582abe5eea221160629313ded386570492916..4c79c8f28a81193274fe45c514a0f1a750504dd5 100644 (file)
@@ -856,6 +856,8 @@ fn replace_with_const(
                             });
 
                             if let Some(Some(alloc)) = alloc {
+                                // Assign entire constant in a single statement.
+                                // We can't use aggregates, as we are post-aggregate-lowering.
                                 *rval = Rvalue::Use(Operand::Constant(Box::new(Constant {
                                     span: source_info.span,
                                     user_ty: None,