Skip to content

Commit d5a13e2

Browse files
committed
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.
1 parent be6c364 commit d5a13e2

File tree

1 file changed

+0
-11
lines changed
  • compiler/rustc_mir_build/src/thir/pattern

1 file changed

+0
-11
lines changed

compiler/rustc_mir_build/src/thir/pattern/mod.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ use rustc_hir::def::{CtorOf, DefKind, Res};
1515
use rustc_hir::pat_util::EnumerateAndAdjustIterator;
1616
use rustc_hir::RangeEnd;
1717
use rustc_index::vec::Idx;
18-
use rustc_middle::mir::interpret::{get_slice_bytes, ConstValue};
1918
use rustc_middle::mir::interpret::{ErrorHandled, LitToConstError, LitToConstInput};
2019
use rustc_middle::mir::{self, UserTypeProjection};
2120
use rustc_middle::mir::{BorrowKind, Field, Mutability};
@@ -795,15 +794,5 @@ pub(crate) fn compare_const_vals<'tcx>(
795794
};
796795
}
797796

798-
if let ty::Str = ty.kind() && let (
799-
Some(a_val @ ConstValue::Slice { .. }),
800-
Some(b_val @ ConstValue::Slice { .. }),
801-
) = (a.try_to_value(tcx), b.try_to_value(tcx))
802-
{
803-
let a_bytes = get_slice_bytes(&tcx, a_val);
804-
let b_bytes = get_slice_bytes(&tcx, b_val);
805-
return from_bool(a_bytes == b_bytes);
806-
}
807-
808797
fallback()
809798
}

0 commit comments

Comments
 (0)