]> git.lizzy.rs Git - rust.git/commitdiff
comments
authorRalf Jung <post@ralfj.de>
Thu, 5 Dec 2019 13:38:24 +0000 (14:38 +0100)
committerRalf Jung <post@ralfj.de>
Thu, 5 Dec 2019 13:38:24 +0000 (14:38 +0100)
src/librustc_codegen_ssa/mir/operand.rs
src/librustc_codegen_ssa/mir/place.rs

index 310b8aeb4db09d3de5830959c55dae1f72f9fcd5..a6dec81274915057d93c22c36195494c63899095 100644 (file)
@@ -475,9 +475,10 @@ pub fn codegen_operand(
                             },
                         }
                         // Allow RalfJ to sleep soundly knowing that even refactorings that remove
-                        // the above error (or silence it under some conditions) will not cause UB
+                        // the above error (or silence it under some conditions) will not cause UB.
                         bx.abort();
-                        // We've errored, so we don't have to produce working code.
+                        // We still have to return an operand but it doesn't matter,
+                        // this code is unreachable.
                         let ty = self.monomorphize(&constant.literal.ty);
                         let layout = bx.cx().layout_of(ty);
                         bx.load_operand(PlaceRef::new_sized(
index 4b8819d11f4f874c2b745c73ba85d5b02de61d8e..b8ff2249dcb04aaae61acd5f6d12efadf385f39e 100644 (file)
@@ -493,6 +493,8 @@ pub fn codegen_place(
                         // With floats that won't always be true,
                         // so we generate a (safe) abort.
                         bx.abort();
+                        // We still have to return a place but it doesn't matter,
+                        // this code is unreachable.
                         let llval = bx.cx().const_undef(
                             bx.cx().type_ptr_to(bx.cx().backend_type(layout))
                         );