@@ -431,7 +431,7 @@ pub struct Attributes {
431
431
432
432
impl Attributes {
433
433
/// Extracts the content from an attribute `#[doc(cfg(content))]`.
434
- fn extract_cfg ( mi : & ast:: MetaItem ) -> Option < & ast:: MetaItem > {
434
+ pub fn extract_cfg ( mi : & ast:: MetaItem ) -> Option < & ast:: MetaItem > {
435
435
use syntax:: ast:: NestedMetaItem :: MetaItem ;
436
436
437
437
if let ast:: MetaItemKind :: List ( ref nmis) = mi. kind {
@@ -456,7 +456,7 @@ impl Attributes {
456
456
/// Reads a `MetaItem` from within an attribute, looks for whether it is a
457
457
/// `#[doc(include="file")]`, and returns the filename and contents of the file as loaded from
458
458
/// its expansion.
459
- fn extract_include ( mi : & ast:: MetaItem )
459
+ pub fn extract_include ( mi : & ast:: MetaItem )
460
460
-> Option < ( String , String ) >
461
461
{
462
462
mi. meta_item_list ( ) . and_then ( |list| {
@@ -710,7 +710,7 @@ pub enum GenericBound {
710
710
}
711
711
712
712
impl GenericBound {
713
- fn maybe_sized ( cx : & DocContext < ' _ > ) -> GenericBound {
713
+ pub fn maybe_sized ( cx : & DocContext < ' _ > ) -> GenericBound {
714
714
let did = cx. tcx . require_lang_item ( lang_items:: SizedTraitLangItem , None ) ;
715
715
let empty = cx. tcx . intern_substs ( & [ ] ) ;
716
716
let path = external_path ( cx, cx. tcx . item_name ( did) ,
@@ -727,7 +727,7 @@ impl GenericBound {
727
727
} , hir:: TraitBoundModifier :: Maybe )
728
728
}
729
729
730
- fn is_sized_bound ( & self , cx : & DocContext < ' _ > ) -> bool {
730
+ pub fn is_sized_bound ( & self , cx : & DocContext < ' _ > ) -> bool {
731
731
use rustc:: hir:: TraitBoundModifier as TBM ;
732
732
if let GenericBound :: TraitBound ( PolyTrait { ref trait_, .. } , TBM :: None ) = * self {
733
733
if trait_. def_id ( ) == cx. tcx . lang_items ( ) . sized_trait ( ) {
@@ -737,14 +737,14 @@ impl GenericBound {
737
737
false
738
738
}
739
739
740
- fn get_poly_trait ( & self ) -> Option < PolyTrait > {
740
+ pub fn get_poly_trait ( & self ) -> Option < PolyTrait > {
741
741
if let GenericBound :: TraitBound ( ref p, _) = * self {
742
742
return Some ( p. clone ( ) )
743
743
}
744
744
None
745
745
}
746
746
747
- fn get_trait_type ( & self ) -> Option < Type > {
747
+ pub fn get_trait_type ( & self ) -> Option < Type > {
748
748
if let GenericBound :: TraitBound ( PolyTrait { ref trait_, .. } , _) = * self {
749
749
Some ( trait_. clone ( ) )
750
750
} else {
@@ -1205,7 +1205,7 @@ impl GetDefId for Type {
1205
1205
}
1206
1206
1207
1207
impl PrimitiveType {
1208
- fn from_str ( s : & str ) -> Option < PrimitiveType > {
1208
+ pub fn from_str ( s : & str ) -> Option < PrimitiveType > {
1209
1209
match s {
1210
1210
"isize" => Some ( PrimitiveType :: Isize ) ,
1211
1211
"i8" => Some ( PrimitiveType :: I8 ) ,
0 commit comments