@@ -35,10 +35,9 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
35
35
}
36
36
}
37
37
38
- PatternKind :: Constant { .. }
39
- if is_switch_ty ( match_pair. pattern . ty ) => {
40
- // for integers, we use a SwitchInt match, which allows
41
- // us to handle more cases
38
+ PatternKind :: Constant { .. } if is_switch_ty ( match_pair. pattern . ty ) => {
39
+ // For integers, we use a `SwitchInt` match, which allows
40
+ // us to handle more cases.
42
41
Test {
43
42
span : match_pair. pattern . span ,
44
43
kind : TestKind :: SwitchInt {
@@ -253,12 +252,12 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
253
252
TestKind :: Eq { value, mut ty } => {
254
253
let val = Operand :: Copy ( place. clone ( ) ) ;
255
254
let mut expect = self . literal_operand ( test. span , ty, value) ;
256
- // Use PartialEq::eq instead of BinOp::Eq
255
+ // Use ` PartialEq::eq` instead of ` BinOp::Eq`
257
256
// (the binop can only handle primitives)
258
257
let fail = self . cfg . start_new_block ( ) ;
259
258
if !ty. is_scalar ( ) {
260
- // If we're using b"..." as a pattern, we need to insert an
261
- // unsizing coercion, as the byte string has the type &[u8; N].
259
+ // If we're using ` b"..."` as a pattern, we need to insert an
260
+ // unsizing coercion, as the byte string has the type ` &[u8; N]` .
262
261
//
263
262
// We want to do this even when the scrutinee is a reference to an
264
263
// array, so we can call `<[u8]>::eq` rather than having to find an
@@ -503,6 +502,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
503
502
resulting_candidates[ variant_index. as_usize ( ) ] . push ( new_candidate) ;
504
503
true
505
504
}
505
+
506
506
( & TestKind :: Switch { .. } , _) => false ,
507
507
508
508
// If we are performing a switch over integers, then this informs integer
@@ -539,7 +539,6 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
539
539
540
540
( & TestKind :: SwitchInt { .. } , _) => false ,
541
541
542
-
543
542
( & TestKind :: Len { len : test_len, op : BinOp :: Eq } ,
544
543
& PatternKind :: Slice { ref prefix, ref slice, ref suffix } ) => {
545
544
let pat_len = ( prefix. len ( ) + suffix. len ( ) ) as u64 ;
0 commit comments