-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Error linting project using wasm-bindgen on nighlty #4507
Comments
It seems that if let Some(firstch) = src.chars().next();
if char::to_digit(firstch, 10).is_some(); was necessary. I think, we should add this back in, instead of the rust-clippy/clippy_lints/src/misc_early.rs Lines 434 to 439 in c3d4294
hack. But this time we should document, why this exists. |
I added it back in #4510. But unfortunately, proc-macro is out of my league. |
@alexlapa Can you provide a minimal reproducible example or share the code this lint triggered on? |
Thanks! Extract from expanded code: // ...
unsafe fn __wbg_foo_new(_: u32) -> u32 {
{
::std::rt::begin_panic("cannot convert to JsValue outside of the wasm target",
&("src/lib.rs", 3u32, 1u32))
}
}
// ... It seems, we only have to write a proc macro which produces code with rust-clippy/mini-macro/src/lib.rs Lines 7 to 8 in 9672a04
@lzutao do you want to take a shot at this? Otherwise I can add a test case to the PR this weekend. |
Fixed in #4510. |
cargo clippy --all -- -D clippy::pedantic -D warnings
is okrunning
cargo +nightly clippy --all -- -D clippy::pedantic -D warnings
produces:Reproduction.
The text was updated successfully, but these errors were encountered: