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> {
848848 ( Str ( self_val) , Str ( other_val) ) => {
849849 // FIXME Once valtrees are available we can directly use the bytes
850850 // 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
861852 }
862853 ( Slice ( self_slice) , Slice ( other_slice) ) => self_slice. is_covered_by ( * other_slice) ,
863854
Original file line number Diff line number Diff line change @@ -755,16 +755,12 @@ pub(crate) fn compare_const_vals<'tcx>(
755755 ty : Ty < ' tcx > ,
756756) -> Option < Ordering > {
757757 assert_eq ! ( a. ty( ) , b. ty( ) ) ;
758+ assert_eq ! ( a. ty( ) , ty) ;
758759
759760 let from_bool = |v : bool | v. then_some ( Ordering :: Equal ) ;
760761
761762 let fallback = || from_bool ( a == b) ;
762763
763- // Use the fallback if any type differs
764- if a. ty ( ) != ty {
765- return fallback ( ) ;
766- }
767-
768764 if a == b {
769765 return from_bool ( true ) ;
770766 }
You can’t perform that action at this time.
0 commit comments