@@ -70,11 +70,7 @@ impl Cursor {
70
70
71
71
/// Get the mangled name of this cursor's referent.
72
72
pub fn mangling ( & self ) -> String {
73
- if clang_Cursor_getMangling:: is_loaded ( ) {
74
- unsafe { cxstring_into_string ( clang_Cursor_getMangling ( self . x ) ) }
75
- } else {
76
- self . spelling ( )
77
- }
73
+ unsafe { cxstring_into_string ( clang_Cursor_getMangling ( self . x ) ) }
78
74
}
79
75
80
76
/// Gets the C++ manglings for this cursor, or an error if the manglings
@@ -632,10 +628,6 @@ impl Cursor {
632
628
633
629
/// Get the offset of the field represented by the Cursor.
634
630
pub fn offset_of_field ( & self ) -> Result < usize , LayoutError > {
635
- if !clang_Cursor_getOffsetOfField:: is_loaded ( ) {
636
- return Err ( LayoutError :: from ( -1 ) ) ;
637
- }
638
-
639
631
let offset = unsafe { clang_Cursor_getOffsetOfField ( self . x ) } ;
640
632
641
633
if offset < 0 {
@@ -1102,13 +1094,6 @@ impl Type {
1102
1094
/// Get the number of template arguments this type has, or `None` if it is
1103
1095
/// not some kind of template.
1104
1096
pub fn num_template_args ( & self ) -> Option < u32 > {
1105
- // If an old libclang is loaded, we have no hope of answering this
1106
- // question correctly. However, that's no reason to panic when
1107
- // generating bindings for simple C headers with an old libclang.
1108
- if !clang_Type_getNumTemplateArguments:: is_loaded ( ) {
1109
- return None ;
1110
- }
1111
-
1112
1097
let n = unsafe { clang_Type_getNumTemplateArguments ( self . x ) } ;
1113
1098
if n >= 0 {
1114
1099
Some ( n as u32 )
@@ -1848,11 +1833,7 @@ pub fn ast_dump(c: &Cursor, depth: isize) -> CXChildVisitResult {
1848
1833
format ! ( " {}spelling = \" {}\" " , prefix, ty. spelling( ) ) ,
1849
1834
) ;
1850
1835
let num_template_args =
1851
- if clang_Type_getNumTemplateArguments:: is_loaded ( ) {
1852
- unsafe { clang_Type_getNumTemplateArguments ( ty. x ) }
1853
- } else {
1854
- -1
1855
- } ;
1836
+ unsafe { clang_Type_getNumTemplateArguments ( ty. x ) } ;
1856
1837
if num_template_args >= 0 {
1857
1838
print_indent (
1858
1839
depth,
0 commit comments