Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manually allow clippy::await_holding_invalid_type #13680

Open
scw00 opened this issue Nov 13, 2024 · 0 comments
Open

Manually allow clippy::await_holding_invalid_type #13680

scw00 opened this issue Nov 13, 2024 · 0 comments

Comments

@scw00
Copy link

scw00 commented Nov 13, 2024

Description

I've designed a struct that can't across the pending point for some specified api. So I deny clippy::await_holding_invalid_type but manually allow the this lint in some cases. But it seems doesn't work.

#![deny(clippy::await_holding_invalid_type)]

struct A {} // invalid type

struct B;

async fn do_a(_a: &mut A) -> B {
    B
}

#[tokio::main]
async fn main() {
    let _v = {
        #[allow(clippy::await_holding_invalid_type)] // doesn't work.
        let mut _a = A {};
        #[allow(clippy::await_holding_invalid_type)] // doesn't work.
        let b = &mut _a;
        #[allow(clippy::await_holding_invalid_type)] // doesn't work.
        do_a(b).await
    };
}

Version

rustc 1.84.0-nightly (439284741 2024-10-21)
binary: rustc
commit-hash: 4392847410ddd67f6734dd9845f9742ff9e85c83
commit-date: 2024-10-21
host: x86_64-apple-darwin
release: 1.84.0-nightly
LLVM version: 19.1.1

Additional Labels

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant