rust-clippy/tests/ui/waker_clone_wake.rs
Benoît du Garreau ebf6667b57 Apply suggestions
2023-10-25 15:15:29 +02:00

29 lines
438 B
Rust

#[derive(Clone)]
pub struct Custom;
impl Custom {
pub fn wake(self) {}
}
macro_rules! mac {
($cx:ident) => {
$cx.waker()
};
}
pub fn wake(cx: &mut std::task::Context) {
cx.waker().clone().wake();
mac!(cx).clone().wake();
}
pub fn no_lint(cx: &mut std::task::Context, c: &Custom) {
c.clone().wake();
let w = cx.waker().clone();
w.wake();
cx.waker().clone().wake_by_ref();
}
fn main() {}