@@ -814,8 +814,7 @@ pub fn is_useful<'p, 'a: 'p, 'tcx: 'a>(cx: &mut MatchCheckCtxt<'a, 'tcx>,
814
814
// FIXME: this might lead to "unstable" behavior with macro hygiene
815
815
// introducing uninhabited patterns for inaccessible fields. We
816
816
// need to figure out how to model that.
817
- ty : rows. iter ( ) . map ( |r| r[ 0 ] . ty ) . find ( |ty| !ty. references_error ( ) )
818
- . unwrap_or ( v[ 0 ] . ty ) ,
817
+ ty : rows. iter ( ) . map ( |r| r[ 0 ] . ty ) . find ( |ty| !ty. references_error ( ) ) . unwrap_or ( v[ 0 ] . ty ) ,
819
818
max_slice_length : max_slice_length ( cx, rows. iter ( ) . map ( |r| r[ 0 ] ) . chain ( Some ( v[ 0 ] ) ) )
820
819
} ;
821
820
@@ -1046,7 +1045,7 @@ fn is_useful_specialized<'p, 'a:'p, 'tcx: 'a>(
1046
1045
/// Slice patterns, however, can match slices of different lengths. For instance,
1047
1046
/// `[a, b, ..tail]` can match a slice of length 2, 3, 4 and so on.
1048
1047
///
1049
- /// Returns None in case of a catch-all, which can't be specialized.
1048
+ /// Returns ` None` in case of a catch-all, which can't be specialized.
1050
1049
fn pat_constructors < ' tcx > ( cx : & mut MatchCheckCtxt ,
1051
1050
pat : & Pattern < ' tcx > ,
1052
1051
pcx : PatternContext )
@@ -1319,13 +1318,13 @@ fn specialize<'p, 'a: 'p, 'tcx: 'a>(
1319
1318
span_bug ! ( pat. span,
1320
1319
"unexpected const-val {:?} with ctor {:?}" , value, constructor)
1321
1320
}
1322
- } ,
1321
+ }
1323
1322
_ => {
1324
1323
match constructor_covered_by_range (
1325
1324
cx. tcx ,
1326
1325
constructor, value, value, RangeEnd :: Included ,
1327
1326
value. ty ,
1328
- ) {
1327
+ ) {
1329
1328
Ok ( true ) => Some ( vec ! [ ] ) ,
1330
1329
Ok ( false ) => None ,
1331
1330
Err ( ErrorReported ) => None ,
0 commit comments