rust-lang/rust-clippy

False positive for boxed local with `wasm_bindgen`

Open

#4,351 创建于 2019年8月7日

在 GitHub 查看
 (14 评论) (0 反应) (0 负责人)Rust (1,391 fork)batch import
C-bugI-false-positivegood first issue

仓库指标

Star
 (10,406 star)
PR 合并指标
 (平均合并 19天 22小时) (30 天内合并 113 个 PR)

描述

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 use Box<[...]>.

In general, I think maybe boxed slices should be considered ok for local parameters, as they're conceptually very similar to vectors.

贡献者指南