@@ -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)
@@ -1419,37 +1419,6 @@ crate enum Type {
1419
1419
ImplTrait ( Vec < GenericBound > ) ,
1420
1420
}
1421
1421
1422
- #[ derive( Clone , PartialEq , Eq , Hash , Copy , Debug ) ]
1423
- /// N.B. this has to be different from `hir::PrimTy` because it also includes types that aren't
1424
- /// paths, like `Unit`.
1425
- crate enum PrimitiveType {
1426
- Isize ,
1427
- I8 ,
1428
- I16 ,
1429
- I32 ,
1430
- I64 ,
1431
- I128 ,
1432
- Usize ,
1433
- U8 ,
1434
- U16 ,
1435
- U32 ,
1436
- U64 ,
1437
- U128 ,
1438
- F32 ,
1439
- F64 ,
1440
- Char ,
1441
- Bool ,
1442
- Str ,
1443
- Slice ,
1444
- Array ,
1445
- Tuple ,
1446
- Unit ,
1447
- RawPointer ,
1448
- Reference ,
1449
- Fn ,
1450
- Never ,
1451
- }
1452
-
1453
1422
crate trait GetDefId {
1454
1423
/// Use this method to get the [`DefId`] of a [`clean`] AST node.
1455
1424
/// This will return [`None`] when called on a primitive [`clean::Type`].
@@ -1565,9 +1534,7 @@ impl Type {
1565
1534
} ;
1566
1535
Some ( ( & self_, trait_did, * name) )
1567
1536
}
1568
- }
1569
1537
1570
- impl Type {
1571
1538
fn inner_def_id ( & self , cache : Option < & Cache > ) -> Option < DefId > {
1572
1539
let t: PrimitiveType = match * self {
1573
1540
ResolvedPath { did, .. } => return Some ( did) ,
@@ -1604,6 +1571,37 @@ impl GetDefId for Type {
1604
1571
}
1605
1572
}
1606
1573
1574
+ /// N.B. this has to be different from `hir::PrimTy` because it also includes types that aren't
1575
+ /// paths, like `Unit`.
1576
+ #[ derive( Clone , PartialEq , Eq , Hash , Copy , Debug ) ]
1577
+ crate enum PrimitiveType {
1578
+ Isize ,
1579
+ I8 ,
1580
+ I16 ,
1581
+ I32 ,
1582
+ I64 ,
1583
+ I128 ,
1584
+ Usize ,
1585
+ U8 ,
1586
+ U16 ,
1587
+ U32 ,
1588
+ U64 ,
1589
+ U128 ,
1590
+ F32 ,
1591
+ F64 ,
1592
+ Char ,
1593
+ Bool ,
1594
+ Str ,
1595
+ Slice ,
1596
+ Array ,
1597
+ Tuple ,
1598
+ Unit ,
1599
+ RawPointer ,
1600
+ Reference ,
1601
+ Fn ,
1602
+ Never ,
1603
+ }
1604
+
1607
1605
impl PrimitiveType {
1608
1606
crate fn from_hir ( prim : hir:: PrimTy ) -> PrimitiveType {
1609
1607
use ast:: { FloatTy , IntTy , UintTy } ;
0 commit comments