Skip to content

Commit

Permalink
Add regression test for issue 277
Browse files Browse the repository at this point in the history
    warning: the type of the `self` parameter does not need to be arbitrary
        --> tests/test.rs:1656:24
         |
    1656 |         async fn f(mut self: &Self) {
         |                        ^^^^^^^^^^^ help: consider to change this parameter to: `&'life0 self`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_arbitrary_self_type
         = note: `#[warn(clippy::needless_arbitrary_self_type)]` on by default
  • Loading branch information
dtolnay committed Sep 24, 2024
1 parent f8e5bb4 commit b53b4e7
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1641,3 +1641,22 @@ pub mod issue266 {
}
}
}

// https://github.com/dtolnay/async-trait/issues/277
pub mod issue277 {
use async_trait::async_trait;

#[async_trait]
pub trait Trait {
async fn f(&self);
}

#[async_trait]
impl Trait for () {
async fn f(mut self: &Self) {
g(&mut self);
}
}

fn g(_: &mut &()) {}
}

0 comments on commit b53b4e7

Please sign in to comment.