@@ -33,9 +33,6 @@ pub struct Type {
33
33
kind : TypeKind ,
34
34
/// Whether this type is const-qualified.
35
35
is_const : bool ,
36
- /// Don't go into an infinite loop when detecting if we have a vtable or
37
- /// not.
38
- detect_has_vtable_cycle : Cell < bool > ,
39
36
}
40
37
41
38
/// The maximum number of items in an array for which Rust implements common
@@ -75,7 +72,6 @@ impl Type {
75
72
layout : layout,
76
73
kind : kind,
77
74
is_const : is_const,
78
- detect_has_vtable_cycle : Cell :: new ( false ) ,
79
75
}
80
76
}
81
77
@@ -244,25 +240,15 @@ impl Type {
244
240
245
241
/// Whether this type has a vtable.
246
242
pub fn has_vtable ( & self , ctx : & BindgenContext ) -> bool {
247
- if self . detect_has_vtable_cycle . get ( ) {
248
- return false ;
249
- }
250
-
251
- self . detect_has_vtable_cycle . set ( true ) ;
252
-
253
243
// FIXME: Can we do something about template parameters? Huh...
254
- let result = match self . kind {
244
+ match self . kind {
255
245
TypeKind :: TemplateAlias ( t, _) |
256
246
TypeKind :: Alias ( t) |
257
247
TypeKind :: ResolvedTypeRef ( t) => ctx. resolve_type ( t) . has_vtable ( ctx) ,
258
248
TypeKind :: Comp ( ref info) => info. has_vtable ( ctx) ,
259
249
TypeKind :: TemplateInstantiation ( ref inst) => inst. has_vtable ( ctx) ,
260
250
_ => false ,
261
- } ;
262
-
263
- self . detect_has_vtable_cycle . set ( false ) ;
264
-
265
- result
251
+ }
266
252
}
267
253
268
254
/// Returns whether this type has a destructor.
0 commit comments