@@ -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
@@ -638,10 +634,6 @@ impl Cursor {
638
634
639
635
/// Get the offset of the field represented by the Cursor.
640
636
pub fn offset_of_field ( & self ) -> Result < usize , LayoutError > {
641
- if !clang_Cursor_getOffsetOfField:: is_loaded ( ) {
642
- return Err ( LayoutError :: from ( -1 ) ) ;
643
- }
644
-
645
637
let offset = unsafe { clang_Cursor_getOffsetOfField ( self . x ) } ;
646
638
647
639
if offset < 0 {
@@ -1108,13 +1100,6 @@ impl Type {
1108
1100
/// Get the number of template arguments this type has, or `None` if it is
1109
1101
/// not some kind of template.
1110
1102
pub fn num_template_args ( & self ) -> Option < u32 > {
1111
- // If an old libclang is loaded, we have no hope of answering this
1112
- // question correctly. However, that's no reason to panic when
1113
- // generating bindings for simple C headers with an old libclang.
1114
- if !clang_Type_getNumTemplateArguments:: is_loaded ( ) {
1115
- return None ;
1116
- }
1117
-
1118
1103
let n = unsafe { clang_Type_getNumTemplateArguments ( self . x ) } ;
1119
1104
if n >= 0 {
1120
1105
Some ( n as u32 )
@@ -1854,11 +1839,7 @@ pub fn ast_dump(c: &Cursor, depth: isize) -> CXChildVisitResult {
1854
1839
format ! ( " {}spelling = \" {}\" " , prefix, ty. spelling( ) ) ,
1855
1840
) ;
1856
1841
let num_template_args =
1857
- if clang_Type_getNumTemplateArguments:: is_loaded ( ) {
1858
- unsafe { clang_Type_getNumTemplateArguments ( ty. x ) }
1859
- } else {
1860
- -1
1861
- } ;
1842
+ unsafe { clang_Type_getNumTemplateArguments ( ty. x ) } ;
1862
1843
if num_template_args >= 0 {
1863
1844
print_indent (
1864
1845
depth,
0 commit comments