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

Clippy warning in .uniffi.rs file on version 0.1.83 (empty-line-after-doc-comments) #2346

Open
ThomasCle opened this issue Dec 9, 2024 · 1 comment

Comments

@ThomasCle
Copy link

After I upgraded to version 0.1.83, clippy gives me a warning in the .uniffi.rs file, when running:

cargo clippy --workspace -- -D warnings

Warning:

error: empty lines after doc comment
  --> /Users/<user>/Repositories/<project>/target/debug/build/<project-name>-60368a59711cf287/out/<project-name>.uniffi.rs:9:1
   |
9  | / /// See `uniffi_bindgen::macro_metadata` for how this is used.
10 | |
11 | | // ditto for info about the UDL which spawned us.
12 | |
   | |_
13 |   const UNIFFI_META_CONST_UDL_<project-name>: ::uniffi::MetadataBuffer = ::uniffi::MetadataBuffer::from_code(::uniffi::metadata::codes::UDL_FILE)
   |   --------------------------------------------------------------- the comment documents this constant
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments
   = note: `-D clippy::empty-line-after-doc-comments` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::empty_line_after_doc_comments)]`
   = help: if the empty lines are unintentional remove them
help: if the doc comment should not document `UNIFFI_META_CONST_UDL_<project-name>` comment it out
   |
8  ~ // /// Export info about the UDL while used to create us
9  ~ // /// See `uniffi_bindgen::macro_metadata` for how this is used.
   |

error: could not compile `<project-name>` (lib) due to 1 previous error

Are you aware of a work-around for this, e.g. making clippy ignore the uniffi.rs file until the problem is fixed?

@mhammond
Copy link
Member

mhammond commented Dec 9, 2024

This was fixed in #2338. We worked around it by adding the following to our Cargo.tomls

# Temp hack for uniffi 0.28 generated code, will not be necessary after next uniffi update.
[lints.clippy]
empty-line-after-doc-comments = "allow"

We might as well keep this open to help others who stumble on it before our next release.

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

No branches or pull requests

2 participants