File tree Expand file tree Collapse file tree 2 files changed +2
-15
lines changed
compiler/rustc_mir_build/src/thir/pattern Expand file tree Collapse file tree 2 files changed +2
-15
lines changed Original file line number Diff line number Diff line change @@ -848,16 +848,7 @@ impl<'tcx> Constructor<'tcx> {
848
848
( Str ( self_val) , Str ( other_val) ) => {
849
849
// FIXME Once valtrees are available we can directly use the bytes
850
850
// in the `Str` variant of the valtree for the comparison here.
851
- match compare_const_vals (
852
- pcx. cx . tcx ,
853
- * self_val,
854
- * other_val,
855
- pcx. cx . param_env ,
856
- pcx. ty ,
857
- ) {
858
- Some ( comparison) => comparison == Ordering :: Equal ,
859
- None => false ,
860
- }
851
+ self_val == other_val
861
852
}
862
853
( Slice ( self_slice) , Slice ( other_slice) ) => self_slice. is_covered_by ( * other_slice) ,
863
854
Original file line number Diff line number Diff line change @@ -755,16 +755,12 @@ pub(crate) fn compare_const_vals<'tcx>(
755
755
ty : Ty < ' tcx > ,
756
756
) -> Option < Ordering > {
757
757
assert_eq ! ( a. ty( ) , b. ty( ) ) ;
758
+ assert_eq ! ( a. ty( ) , ty) ;
758
759
759
760
let from_bool = |v : bool | v. then_some ( Ordering :: Equal ) ;
760
761
761
762
let fallback = || from_bool ( a == b) ;
762
763
763
- // Use the fallback if any type differs
764
- if a. ty ( ) != ty {
765
- return fallback ( ) ;
766
- }
767
-
768
764
if a == b {
769
765
return from_bool ( true ) ;
770
766
}
You can’t perform that action at this time.
0 commit comments