Skip to content

Translate #[deprecated] on Rust functions to deprecated attribute  #408

@MarkMcCaskey

Description

@MarkMcCaskey

Hello! Thanks for making and maintaining cbindgen, it's very useful!

We have a C API and would like to mark some of our older functions as deprecated, in Rust this can be done with the deprecated attribute. There is also a deprecated attribute in C. Unfortunately it's not standardized and it appears that some compilers don't support it.

It seems like for this to be more portable, we'd have to generate some preprocessor logic.

Another nice to have feature would be to be able to put all the deprecated functions in a separate header file so that the user has to opt-in to use them, too. The progression for us would then be, mark them as deprecated, move them to a separate deprecated.h, and then remove them.

What are your thoughts on deprecation with cbindgen? Maybe there's a better solution!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions