rust-lang / futures-rs

Zero-cost asynchronous programming in Rust
https://rust-lang.github.io/futures-rs/
Apache License 2.0
5.34k stars 616 forks source link

Ignore clippy::needless_pass_by_ref_mut lint #2762

Closed taiki-e closed 1 year ago

taiki-e commented 1 year ago
warning: this argument is a mutable reference, but not used mutably
   --> futures-channel/src/oneshot.rs:154:33
    |
154 |     fn poll_canceled(&self, cx: &mut Context<'_>) -> Poll<()> {
    |                                 ^^^^^^^^^^^^^^^^ help: consider changing to: `&Context<'_>`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut
    = note: `#[warn(clippy::needless_pass_by_ref_mut)]` on by default

warning: this argument is a mutable reference, but not used mutably
   --> futures-channel/src/oneshot.rs:256:24
    |
256 | ... recv(&self, cx: &mut Context<'_>) -> Poll<Result<T, Cancel...
    |                     ^^^^^^^^^^^^^^^^ help: consider changing to: `&Context<'_>`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut

warning: this argument is a mutable reference, but not used mutably
   --> futures-util/src/future/future/shared.rs:212:55
    |
212 | ... &mut usize, cx: &mut Context<'_>) {
    |                     ^^^^^^^^^^^^^^^^ help: consider changing to: `&Context<'_>`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut
    = note: `#[warn(clippy::needless_pass_by_ref_mut)]` on by default

warning: this argument is a mutable reference, but not used mutably
   --> futures-util/src/stream/stream/flatten_unordered.rs:212:39
    |
212 | ..._waker(self_arc: &mut Arc<Self>, cx: &Context<'_>) {
    |                     ^^^^^^^^^^^^^^ help: consider changing to: `&Arc<Self>`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut

warning: this argument is a mutable reference, but not used mutably
  --> futures-util/src/compat/compat01as03.rs:36:36
   |
36 | ...>(&mut self, cx: &mut Context<'_>, f: impl FnOnce(&mut T) ->...
   |                     ^^^^^^^^^^^^^^^^ help: consider changing to: `&Context<'_>`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut

warning: this argument is a mutable reference, but not used mutably
   --> futures-util/src/compat/compat01as03.rs:199:36
    |
199 | ...>(&mut self, cx: &mut Context<'_>, f: impl FnOnce(&mut S) -...
    |                     ^^^^^^^^^^^^^^^^ help: consider changing to: `&Context<'_>`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut

warning: this argument is a mutable reference, but not used mutably
  --> futures-util/src/lock/bilock.rs:90:33
   |
90 | ..._lock(&self, cx: &mut Context<'_>) -> Poll<BiLockGuard<'_, T...
   |                     ^^^^^^^^^^^^^^^^ help: consider changing to: `&Context<'_>`
   |
   = warning: changing this function will impact semver compatibility
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut

warning: this argument is a mutable reference, but not used mutably
   --> futures/tests/sink.rs:160:25
    |
160 |     fn check(&self, cx: &mut Context<'_>) -> bool {
    |                         ^^^^^^^^^^^^^^^^ help: consider changing to: `&Context<'_>`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut
    = note: `#[warn(clippy::needless_pass_by_ref_mut)]` on by default