about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm/llvm
diff options
context:
space:
mode:
authorAndy Russell <arussell123@gmail.com>2018-10-18 20:34:01 -0400
committerAndy Russell <arussell123@gmail.com>2019-03-24 12:21:03 -0400
commit4728433c9ec07814b15868cb092afa2d60963cee (patch)
treee4dd8d429e8a55efe5eee897d9a1611edd2e1187 /src/librustc_codegen_llvm/llvm
parent0633c55d2030969d91b57142b8582c53101e6339 (diff)
downloadrust-4728433c9ec07814b15868cb092afa2d60963cee.tar.gz
rust-4728433c9ec07814b15868cb092afa2d60963cee.zip
make asm diagnostic instruction optional
`DiagnosticInfoInlineAsm::getInstruction` may return a null pointer, so
the instruction shouldn't be blindly unwrapped.
Diffstat (limited to 'src/librustc_codegen_llvm/llvm')
-rw-r--r--src/librustc_codegen_llvm/llvm/diagnostic.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc_codegen_llvm/llvm/diagnostic.rs b/src/librustc_codegen_llvm/llvm/diagnostic.rs
index a8d272f157c..04e65ac4233 100644
--- a/src/librustc_codegen_llvm/llvm/diagnostic.rs
+++ b/src/librustc_codegen_llvm/llvm/diagnostic.rs
@@ -88,7 +88,7 @@ impl OptimizationDiagnostic<'ll> {
 pub struct InlineAsmDiagnostic<'ll> {
     pub cookie: c_uint,
     pub message: &'ll Twine,
-    pub instruction: &'ll Value,
+    pub instruction: Option<&'ll Value>,
 }
 
 impl InlineAsmDiagnostic<'ll> {
@@ -107,7 +107,7 @@ impl InlineAsmDiagnostic<'ll> {
         InlineAsmDiagnostic {
             cookie,
             message: message.unwrap(),
-            instruction: instruction.unwrap(),
+            instruction,
         }
     }
 }