-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add async example to bindgen_examples #9822
Conversation
Thanks, and looks good to me! I think there's some errors on CI though? |
Can you take a look into the clippy error please? The error seems to originate from |
Ah I believe this is exposing a preexisting bug in the I'm not sure of a way to work around this other than fixing the issue at hand (tracking down the |
I think for the purpose of documentation, it's okay to let clippy skip this file.
IIUC, #9823 maybe unblock this?
Can you try to fix this please? I'm not very familiar proc_macros or bindgen internals. |
Yes #9823 would probably help. Unfortunately I don't have time right now to fix this myself, and this can't land unless it's passing CI. |
OK...... Can you find the issue tracking the "preexisting bug" you mentioned? I can't find one to link here. Or, I can file a new one. |
I don't believe there's a preexisting issue since this is I think the first time it's come up, but feel free to file an issue of course |
OK, let's take a step back. Why need to build bindgen_examples inside |
It's not necessarily strictly required, but it's quite useful to be distributed as part of docs.rs integration. That gives nice API docs all in one place. Personally I think it'd probably be less effort to fix the code generation than it would be to move all the documentation somewhere else. |
OK, fine. I made a new commit which fixes the bug of bindgen. I know I should have open another PR/issue but it seems I need to provide an example to reproduce the bug, which is this very example, so I think it's okay to just fix it in this PR. |
Thanks! I think some test expectations may need an update, but otherwise looks good 👍 |
# Conflicts: # crates/component-macro/tests/expanded/char_async.rs # crates/component-macro/tests/expanded/char_tracing_async.rs # crates/component-macro/tests/expanded/dead-code_async.rs # crates/component-macro/tests/expanded/dead-code_tracing_async.rs # crates/component-macro/tests/expanded/floats_async.rs # crates/component-macro/tests/expanded/floats_tracing_async.rs # crates/component-macro/tests/expanded/integers_async.rs # crates/component-macro/tests/expanded/integers_tracing_async.rs # crates/component-macro/tests/expanded/multi-return_async.rs # crates/component-macro/tests/expanded/multi-return_tracing_async.rs # crates/component-macro/tests/expanded/multiversion_async.rs # crates/component-macro/tests/expanded/multiversion_tracing_async.rs # crates/component-macro/tests/expanded/path1_async.rs # crates/component-macro/tests/expanded/path1_tracing_async.rs # crates/component-macro/tests/expanded/path2_async.rs # crates/component-macro/tests/expanded/path2_tracing_async.rs # crates/component-macro/tests/expanded/simple-functions_async.rs # crates/component-macro/tests/expanded/simple-functions_tracing_async.rs # crates/component-macro/tests/expanded/simple-lists_async.rs # crates/component-macro/tests/expanded/simple-lists_tracing_async.rs # crates/component-macro/tests/expanded/simple-wasi_async.rs # crates/component-macro/tests/expanded/simple-wasi_tracing_async.rs # crates/component-macro/tests/expanded/smoke_async.rs # crates/component-macro/tests/expanded/smoke_tracing_async.rs # crates/component-macro/tests/expanded/strings_async.rs # crates/component-macro/tests/expanded/strings_tracing_async.rs
Closes #9776
I reused most of example 4 to avoid extra complication. Also adds a reference to code example
wasi_async
, so it'd better if this gets merged after #9788.cc @alexcrichton