@@ -908,18 +908,10 @@ impl<'a> FromIterator<&'a DocFragment> for String {
908
908
}
909
909
}
910
910
911
- /// The attributes on an [`Item`], including attributes like `#[derive(...)]` and `#[inline]`,
912
- /// as well as doc comments.
913
- #[ derive( Clone , Debug , Default ) ]
914
- crate struct Attributes {
915
- crate doc_strings : Vec < DocFragment > ,
916
- crate other_attrs : Vec < ast:: Attribute > ,
917
- }
918
-
919
- #[ derive( Clone , Debug , PartialEq , Eq , Hash ) ]
920
911
/// A link that has not yet been rendered.
921
912
///
922
913
/// This link will be turned into a rendered link by [`Item::links`].
914
+ #[ derive( Clone , Debug , PartialEq , Eq , Hash ) ]
923
915
crate struct ItemLink {
924
916
/// The original link written in the markdown
925
917
pub ( crate ) link : String ,
@@ -944,6 +936,14 @@ pub struct RenderedLink {
944
936
pub ( crate ) href : String ,
945
937
}
946
938
939
+ /// The attributes on an [`Item`], including attributes like `#[derive(...)]` and `#[inline]`,
940
+ /// as well as doc comments.
941
+ #[ derive( Clone , Debug , Default ) ]
942
+ crate struct Attributes {
943
+ crate doc_strings : Vec < DocFragment > ,
944
+ crate other_attrs : Vec < ast:: Attribute > ,
945
+ }
946
+
947
947
impl Attributes {
948
948
crate fn lists ( & self , name : Symbol ) -> ListAttributesIter < ' _ > {
949
949
self . other_attrs . lists ( name)
@@ -1424,37 +1424,6 @@ crate enum Type {
1424
1424
ImplTrait ( Vec < GenericBound > ) ,
1425
1425
}
1426
1426
1427
- #[ derive( Clone , PartialEq , Eq , Hash , Copy , Debug ) ]
1428
- /// N.B. this has to be different from `hir::PrimTy` because it also includes types that aren't
1429
- /// paths, like `Unit`.
1430
- crate enum PrimitiveType {
1431
- Isize ,
1432
- I8 ,
1433
- I16 ,
1434
- I32 ,
1435
- I64 ,
1436
- I128 ,
1437
- Usize ,
1438
- U8 ,
1439
- U16 ,
1440
- U32 ,
1441
- U64 ,
1442
- U128 ,
1443
- F32 ,
1444
- F64 ,
1445
- Char ,
1446
- Bool ,
1447
- Str ,
1448
- Slice ,
1449
- Array ,
1450
- Tuple ,
1451
- Unit ,
1452
- RawPointer ,
1453
- Reference ,
1454
- Fn ,
1455
- Never ,
1456
- }
1457
-
1458
1427
crate trait GetDefId {
1459
1428
/// Use this method to get the [`DefId`] of a [`clean`] AST node.
1460
1429
/// This will return [`None`] when called on a primitive [`clean::Type`].
@@ -1569,9 +1538,7 @@ impl Type {
1569
1538
} ;
1570
1539
Some ( ( & self_, trait_did, * name) )
1571
1540
}
1572
- }
1573
1541
1574
- impl Type {
1575
1542
fn inner_def_id ( & self , cache : Option < & Cache > ) -> Option < DefId > {
1576
1543
let t: PrimitiveType = match * self {
1577
1544
ResolvedPath { did, .. } => return Some ( did) ,
@@ -1608,6 +1575,37 @@ impl GetDefId for Type {
1608
1575
}
1609
1576
}
1610
1577
1578
+ /// N.B. this has to be different from `hir::PrimTy` because it also includes types that aren't
1579
+ /// paths, like `Unit`.
1580
+ #[ derive( Clone , PartialEq , Eq , Hash , Copy , Debug ) ]
1581
+ crate enum PrimitiveType {
1582
+ Isize ,
1583
+ I8 ,
1584
+ I16 ,
1585
+ I32 ,
1586
+ I64 ,
1587
+ I128 ,
1588
+ Usize ,
1589
+ U8 ,
1590
+ U16 ,
1591
+ U32 ,
1592
+ U64 ,
1593
+ U128 ,
1594
+ F32 ,
1595
+ F64 ,
1596
+ Char ,
1597
+ Bool ,
1598
+ Str ,
1599
+ Slice ,
1600
+ Array ,
1601
+ Tuple ,
1602
+ Unit ,
1603
+ RawPointer ,
1604
+ Reference ,
1605
+ Fn ,
1606
+ Never ,
1607
+ }
1608
+
1611
1609
impl PrimitiveType {
1612
1610
crate fn from_hir ( prim : hir:: PrimTy ) -> PrimitiveType {
1613
1611
use ast:: { FloatTy , IntTy , UintTy } ;
0 commit comments