about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2022-06-09 09:08:04 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2022-06-16 10:52:56 +1000
commitd5a13e2ca0c45a7f25d783cc94e447246cb97afd (patch)
tree8a5e04824e621c7f7b2432a7474a19db1fda4cab
parentbe6c36414226d8ff6ad5047870d6ec7a0b2bd505 (diff)
downloadrust-d5a13e2ca0c45a7f25d783cc94e447246cb97afd.tar.gz
rust-d5a13e2ca0c45a7f25d783cc94e447246cb97afd.zip
Remove dead code from `compare_const_vals`.
It's never executed when running the entire test suite. I think it's
because of the early return at the top of the function if `a.ty() != ty`
succeeds.
-rw-r--r--compiler/rustc_mir_build/src/thir/pattern/mod.rs11
1 files changed, 0 insertions, 11 deletions
diff --git a/compiler/rustc_mir_build/src/thir/pattern/mod.rs b/compiler/rustc_mir_build/src/thir/pattern/mod.rs
index f5d957e30ff..1c35e402a99 100644
--- a/compiler/rustc_mir_build/src/thir/pattern/mod.rs
+++ b/compiler/rustc_mir_build/src/thir/pattern/mod.rs
@@ -15,7 +15,6 @@ use rustc_hir::def::{CtorOf, DefKind, Res};
 use rustc_hir::pat_util::EnumerateAndAdjustIterator;
 use rustc_hir::RangeEnd;
 use rustc_index::vec::Idx;
-use rustc_middle::mir::interpret::{get_slice_bytes, ConstValue};
 use rustc_middle::mir::interpret::{ErrorHandled, LitToConstError, LitToConstInput};
 use rustc_middle::mir::{self, UserTypeProjection};
 use rustc_middle::mir::{BorrowKind, Field, Mutability};
@@ -795,15 +794,5 @@ pub(crate) fn compare_const_vals<'tcx>(
         };
     }
 
-    if let ty::Str = ty.kind() && let (
-        Some(a_val @ ConstValue::Slice { .. }),
-        Some(b_val @ ConstValue::Slice { .. }),
-    ) = (a.try_to_value(tcx), b.try_to_value(tcx))
-    {
-        let a_bytes = get_slice_bytes(&tcx, a_val);
-        let b_bytes = get_slice_bytes(&tcx, b_val);
-        return from_bool(a_bytes == b_bytes);
-    }
-
     fallback()
 }