You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
is now allowed in nightly. However, Clippy gives inaccurate lint:
Checking playground v0.0.1(/playground)
warning: this argument is passed by value, but not consumed in the function body
--> src/main.rs:2:9
|
2 | fn a(f:Box<dyn FnOnce()>){
| ^^^^^^^^^^^^^^^^^ help: consider taking a reference instead: `&Box<dynFnOnce()>`
|
= note: #[warn(clippy::needless_pass_by_value)] on by default
= help:for further information visit https://rust-lang-nursery.github.io/rust-clippy/v0.0.212/index.html#needless_pass_by_valueFinished dev [unoptimized + debuginfo] target(s)in0.66s
Because when run the code above, it do consumes the variable f when using unsized rvalues, and it cannot run without it.
The text was updated successfully, but these errors were encountered:
The following code
Playground
is now allowed in nightly. However, Clippy gives inaccurate lint:
Because when run the code above, it do consumes the variable
f
when using unsized rvalues, and it cannot run without it.The text was updated successfully, but these errors were encountered: