Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass through #[doc(hidden)] attribute #945

Closed
mattiekat opened this issue Oct 5, 2021 · 2 comments · Fixed by #946
Closed

Pass through #[doc(hidden)] attribute #945

mattiekat opened this issue Oct 5, 2021 · 2 comments · Fixed by #946

Comments

@mattiekat
Copy link

Since cxx is so awesome at wrapping C++, it is nice to be able to export the interface directly on the rust side, but sometimes it is preferable to hide certain functions that are used directly by a custom impl MyCxxType. Since all functions are public they all by default want to show up in the docs which I find myself using a lot given proc macro support in IDEs is still early.

@dtolnay
Copy link
Owner

dtolnay commented Oct 5, 2021

Good call — I've published 1.0.56 with support for doc(hidden).

@mattiekat
Copy link
Author

mattiekat commented Oct 5, 2021

Hmm, testing 1.0.56 and I am seeing

#[doc(hidden)]
     ^ expected `=`

Example code (that is an approximation of what I have):

#[cxx::bridge(namespace = "some::ns")]
pub mod ffi {

    unsafe extern "C++" {
        type ExternType;

        #[doc(hidden)]
        #[cxx_name = "doThing"]
        fn _do_thing() -> ExternType;
    }        
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants