@@ -1475,7 +1475,9 @@ pub(crate) enum Type {
1475
1475
///
1476
1476
/// This is mostly Rustdoc's version of [`hir::Path`].
1477
1477
/// It has to be different because Rustdoc's [`PathSegment`] can contain cleaned generics.
1478
- Path { path : Path } ,
1478
+ Path {
1479
+ path : Path ,
1480
+ } ,
1479
1481
/// A `dyn Trait` object: `dyn for<'a> Trait<'a> + Send + 'static`
1480
1482
DynTrait ( Vec < PolyTrait > , Option < Lifetime > ) ,
1481
1483
/// A type parameter.
@@ -1492,10 +1494,15 @@ pub(crate) enum Type {
1492
1494
///
1493
1495
/// The `String` field is a stringified version of the array's length parameter.
1494
1496
Array ( Box < Type > , Box < str > ) ,
1497
+ Pat ( Box < Type > , Box < str > ) ,
1495
1498
/// A raw pointer type: `*const i32`, `*mut i32`
1496
1499
RawPointer ( Mutability , Box < Type > ) ,
1497
1500
/// A reference type: `&i32`, `&'a mut Foo`
1498
- BorrowedRef { lifetime : Option < Lifetime > , mutability : Mutability , type_ : Box < Type > } ,
1501
+ BorrowedRef {
1502
+ lifetime : Option < Lifetime > ,
1503
+ mutability : Mutability ,
1504
+ type_ : Box < Type > ,
1505
+ } ,
1499
1506
1500
1507
/// A qualified path to an associated item: `<Type as Trait>::Name`
1501
1508
QPath ( Box < QPathData > ) ,
@@ -1692,6 +1699,7 @@ impl Type {
1692
1699
BareFunction ( ..) => PrimitiveType :: Fn ,
1693
1700
Slice ( ..) => PrimitiveType :: Slice ,
1694
1701
Array ( ..) => PrimitiveType :: Array ,
1702
+ Type :: Pat ( ..) => PrimitiveType :: Pat ,
1695
1703
RawPointer ( ..) => PrimitiveType :: RawPointer ,
1696
1704
QPath ( box QPathData { ref self_type, .. } ) => return self_type. inner_def_id ( cache) ,
1697
1705
Generic ( _) | Infer | ImplTrait ( _) => return None ,
@@ -1745,6 +1753,7 @@ pub(crate) enum PrimitiveType {
1745
1753
Str ,
1746
1754
Slice ,
1747
1755
Array ,
1756
+ Pat ,
1748
1757
Tuple ,
1749
1758
Unit ,
1750
1759
RawPointer ,
@@ -1895,6 +1904,7 @@ impl PrimitiveType {
1895
1904
Bool => sym:: bool,
1896
1905
Char => sym:: char,
1897
1906
Array => sym:: array,
1907
+ Pat => sym:: pat,
1898
1908
Slice => sym:: slice,
1899
1909
Tuple => sym:: tuple,
1900
1910
Unit => sym:: unit,
0 commit comments