@@ -35,10 +35,9 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
3535 }
3636 }
3737
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.
4241 Test {
4342 span : match_pair. pattern . span ,
4443 kind : TestKind :: SwitchInt {
@@ -253,12 +252,12 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
253252 TestKind :: Eq { value, mut ty } => {
254253 let val = Operand :: Copy ( place. clone ( ) ) ;
255254 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`
257256 // (the binop can only handle primitives)
258257 let fail = self . cfg . start_new_block ( ) ;
259258 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]` .
262261 //
263262 // We want to do this even when the scrutinee is a reference to an
264263 // 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> {
503502 resulting_candidates[ variant_index. as_usize ( ) ] . push ( new_candidate) ;
504503 true
505504 }
505+
506506 ( & TestKind :: Switch { .. } , _) => false ,
507507
508508 // If we are performing a switch over integers, then this informs integer
@@ -539,7 +539,6 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
539539
540540 ( & TestKind :: SwitchInt { .. } , _) => false ,
541541
542-
543542 ( & TestKind :: Len { len : test_len, op : BinOp :: Eq } ,
544543 & PatternKind :: Slice { ref prefix, ref slice, ref suffix } ) => {
545544 let pat_len = ( prefix. len ( ) + suffix. len ( ) ) as u64 ;
0 commit comments