@@ -1481,7 +1481,9 @@ pub(crate) enum Type {
1481
1481
///
1482
1482
/// This is mostly Rustdoc's version of [`hir::Path`].
1483
1483
/// It has to be different because Rustdoc's [`PathSegment`] can contain cleaned generics.
1484
- Path { path : Path } ,
1484
+ Path {
1485
+ path : Path ,
1486
+ } ,
1485
1487
/// A `dyn Trait` object: `dyn for<'a> Trait<'a> + Send + 'static`
1486
1488
DynTrait ( Vec < PolyTrait > , Option < Lifetime > ) ,
1487
1489
/// A type parameter.
@@ -1498,10 +1500,15 @@ pub(crate) enum Type {
1498
1500
///
1499
1501
/// The `String` field is a stringified version of the array's length parameter.
1500
1502
Array ( Box < Type > , Box < str > ) ,
1503
+ Pat ( Box < Type > , Box < str > ) ,
1501
1504
/// A raw pointer type: `*const i32`, `*mut i32`
1502
1505
RawPointer ( Mutability , Box < Type > ) ,
1503
1506
/// A reference type: `&i32`, `&'a mut Foo`
1504
- BorrowedRef { lifetime : Option < Lifetime > , mutability : Mutability , type_ : Box < Type > } ,
1507
+ BorrowedRef {
1508
+ lifetime : Option < Lifetime > ,
1509
+ mutability : Mutability ,
1510
+ type_ : Box < Type > ,
1511
+ } ,
1505
1512
1506
1513
/// A qualified path to an associated item: `<Type as Trait>::Name`
1507
1514
QPath ( Box < QPathData > ) ,
@@ -1698,6 +1705,7 @@ impl Type {
1698
1705
BareFunction ( ..) => PrimitiveType :: Fn ,
1699
1706
Slice ( ..) => PrimitiveType :: Slice ,
1700
1707
Array ( ..) => PrimitiveType :: Array ,
1708
+ Type :: Pat ( ..) => PrimitiveType :: Pat ,
1701
1709
RawPointer ( ..) => PrimitiveType :: RawPointer ,
1702
1710
QPath ( box QPathData { ref self_type, .. } ) => return self_type. inner_def_id ( cache) ,
1703
1711
Generic ( _) | Infer | ImplTrait ( _) => return None ,
@@ -1749,6 +1757,7 @@ pub(crate) enum PrimitiveType {
1749
1757
Str ,
1750
1758
Slice ,
1751
1759
Array ,
1760
+ Pat ,
1752
1761
Tuple ,
1753
1762
Unit ,
1754
1763
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