From f14da1e4fe7dcee7f6f5240b5272e8ef428b60f7 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Sat, 8 Nov 2014 21:56:47 +0100 Subject: [PATCH] Fix the ICE --- src/gl_generator/generators/global_gen.rs | 9 ++++++--- src/gl_generator/generators/struct_gen.rs | 16 ++++++++++------ 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/gl_generator/generators/global_gen.rs b/src/gl_generator/generators/global_gen.rs index 32e5b926..5ca4b442 100644 --- a/src/gl_generator/generators/global_gen.rs +++ b/src/gl_generator/generators/global_gen.rs @@ -130,16 +130,19 @@ fn write_fnptr_struct_def(ecx: &ExtCtxt) -> Vec> { vec![ (quote_item!(ecx, pub struct FnPtr { - /// The function pointer that will be used when calling the function. + // TODO: put back doccomment + // The function pointer that will be used when calling the function. f: *const __gl_imports::libc::c_void, - /// True if the pointer points to a real function, false if points to a `panic!` fn. + // TODO: put back doccomment + // True if the pointer points to a real function, false if points to a `panic!` fn. is_loaded: bool, } )).unwrap(), (quote_item!(ecx, impl FnPtr { - /// Creates a `FnPtr` from a load attempt. + // TODO: put back doccomment + // Creates a `FnPtr` from a load attempt. pub fn new(ptr: *const __gl_imports::libc::c_void, failing_fn: *const __gl_imports::libc::c_void) -> FnPtr { if ptr.is_null() { FnPtr { f: failing_fn, is_loaded: false } diff --git a/src/gl_generator/generators/struct_gen.rs b/src/gl_generator/generators/struct_gen.rs index fe667f35..1d6147ba 100644 --- a/src/gl_generator/generators/struct_gen.rs +++ b/src/gl_generator/generators/struct_gen.rs @@ -80,16 +80,19 @@ fn write_fnptr_struct_def(ecx: &ExtCtxt) -> Vec> { (quote_item!(ecx, #[allow(dead_code)] pub struct FnPtr { - /// The function pointer that will be used when calling the function. + // TODO: put back doccomment + // The function pointer that will be used when calling the function. f: *const __gl_imports::libc::c_void, - /// True if the pointer points to a real function, false if points to a `panic!` fn. + // TODO: put back doccomment + // True if the pointer points to a real function, false if points to a `panic!` fn. is_loaded: bool, } )).unwrap(), (quote_item!(ecx, impl FnPtr { - /// Creates a `FnPtr` from a load attempt. + // TODO: put back doccomment + // Creates a `FnPtr` from a load attempt. fn new(ptr: *const __gl_imports::libc::c_void, failing_fn: *const __gl_imports::libc::c_void) -> FnPtr { if ptr.is_null() { @@ -99,9 +102,10 @@ fn write_fnptr_struct_def(ecx: &ExtCtxt) -> Vec> { } } - /// Returns `true` if the function has been successfully loaded. - /// - /// If it returns `false`, calling the corresponding function will fail. + // TODO: put back doccomment + // Returns `true` if the function has been successfully loaded. + // + // If it returns `false`, calling the corresponding function will fail. #[inline] #[allow(dead_code)] pub fn is_loaded(&self) -> bool {