-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
False positive for boxed local with wasm_bindgen
#4351
Comments
Documentation for convenience. |
I'm not familiar with If this is only necessary for the |
It also uses boxed number slices ( |
I'm not sure I know of a time when a |
Yeah you're write, that would be a good fix to just check for |
(s/write/right btw) |
rust-clippy/clippy_lints/src/escape.rs Line 200 in 5c1e30a
I'm guessing this needs a sister method called |
Oops yeah of course thanks. Won't edit because ¯\_(ツ)_/¯ I think we already have a |
Ah rustc's |
Yeah I'm working on a PR. Should be really fast. |
I'm against the change of allowing this for unsized types. For example, you should always use The fix for this issue is adding an exception for |
I see what you're saying. Is the philosophy of clippy to warn unless it can prove that what you're doing is reasonable, or is the philosophy to warn if it can prove that what you're doing is unreasonable?
|
We can and do check if is consumed or moved. Log a bug (with a MCVE) If you find any false positives due to that.
Please provide a code sample of this. AFAIK, it's a Javascript TypedArray either way.
Yes, |
Got it. I didn't realize this was the case. Thanks!
I think you're right that this is true for
Well, you just taught me this. =) My critical reading skills are not what they once were. Given that I can't think of any other objections, I think you're entirely correct that |
wasm_bindgen
is a little bit different than the issue that's been resolved with traits. In particular,wasm_bindgen
just generates code around the non-trait implemented function, and the only way to use native JS arrays as parameters is to useBox<[...]>
.In general, I think maybe boxed slices should be considered ok for local parameters, as they're conceptually very similar to vectors.
The text was updated successfully, but these errors were encountered: