about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorAndreas Liljeqvist <bonega@gmail.com>2021-08-23 14:20:38 +0200
committerAndreas Liljeqvist <bonega@gmail.com>2021-08-23 14:20:38 +0200
commit70433955f4531f2742ddeb986e6ac19a8fd4792f (patch)
tree2a41b158bc39450cb00051e35269b2be6bad4013 /compiler/rustc_codegen_llvm/src
parentd50abd024901176f8b21081713bf4a2779d9aadb (diff)
downloadrust-70433955f4531f2742ddeb986e6ac19a8fd4792f.tar.gz
rust-70433955f4531f2742ddeb986e6ac19a8fd4792f.zip
implement contains_zero method
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
-rw-r--r--compiler/rustc_codegen_llvm/src/builder.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_llvm/src/builder.rs b/compiler/rustc_codegen_llvm/src/builder.rs
index 2b72b167426..7986d1d9cb2 100644
--- a/compiler/rustc_codegen_llvm/src/builder.rs
+++ b/compiler/rustc_codegen_llvm/src/builder.rs
@@ -462,7 +462,6 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
             load: &'ll Value,
             scalar: &abi::Scalar,
         ) {
-            let vr = scalar.valid_range;
             match scalar.value {
                 abi::Int(..) => {
                     let range = scalar.valid_range_exclusive(bx);
@@ -470,7 +469,7 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
                         bx.range_metadata(load, range);
                     }
                 }
-                abi::Pointer if vr.start < vr.end && !vr.contains(0) => {
+                abi::Pointer if !scalar.valid_range.contains_zero() => {
                     bx.nonnull_metadata(load);
                 }
                 _ => {}