Skip to content

Variadic argument member function failure. #402

@kkimdev

Description

@kkimdev

It happens when the variadic argument function is defined as a class member function. Then like the below, rust-bindgen tries to generate ... argument for a non-foreign function, which current rustc doesn't support.

Example:

Header:

// In some class
String& AppendWithFormat(const char* formatString, ...);

Generated code:

// In some impl
    #[inline]
    pub unsafe fn AppendWithFormat(&mut self,
                                   formatString:
                                       *const ::std::os::raw::c_char, ...)
     -> *mut Urho3D_String {
        Urho3D_String_AppendWithFormat(&mut *self, formatString)
    }

Compiling the above generated code:

error: expected pattern, found `...`
    --> src/generated.rs:1203:71
     |
1203 |                                        *const ::std::os::raw::c_char, ...)

I think we should disable code generation for this case and emit a warning for now, unless there is an easy solution for this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions