@@ -42,7 +42,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
4242 TestKind :: StringEq { value }
4343 }
4444 TestableCase :: Constant { value, kind : PatConstKind :: Float | PatConstKind :: Other } => {
45- TestKind :: ScalarEq { value, pat_ty : match_pair . pattern_ty }
45+ TestKind :: ScalarEq { value }
4646 }
4747
4848 TestableCase :: Range ( ref range) => {
@@ -182,7 +182,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
182182 ) ;
183183 }
184184
185- TestKind :: ScalarEq { value, pat_ty } => {
185+ TestKind :: ScalarEq { value } => {
186186 let tcx = self . tcx ;
187187 let success_block = target_block ( TestBranch :: Success ) ;
188188 let fail_block = target_block ( TestBranch :: Failure ) ;
@@ -191,12 +191,10 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
191191 let mut expected_value_operand =
192192 self . literal_operand ( test. span , Const :: from_ty_value ( tcx, value) ) ;
193193
194- let mut actual_value_ty = pat_ty;
195194 let mut actual_value_place = place;
196195
197- match pat_ty . kind ( ) {
196+ match value . ty . kind ( ) {
198197 & ty:: Pat ( base, _) => {
199- assert_eq ! ( pat_ty, value. ty) ;
200198 assert ! ( base. is_trivially_pure_clone_copy( ) ) ;
201199
202200 let transmuted_place = self . temp ( base, test. span ) ;
@@ -220,15 +218,13 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
220218 ) ;
221219
222220 actual_value_place = transmuted_place;
223- actual_value_ty = base;
224221 expected_value_operand = Operand :: Copy ( transmuted_expect) ;
225222 expected_value_ty = base;
226223 }
227224 _ => { }
228225 }
229226
230- assert_eq ! ( expected_value_ty, actual_value_ty) ;
231- assert ! ( actual_value_ty. is_scalar( ) ) ;
227+ assert ! ( expected_value_ty. is_scalar( ) ) ;
232228
233229 self . compare (
234230 block,
0 commit comments