No warning for unused thread_local

70a5e31
Opened by Duy Do at 2023-12-22 18:09:31
<!-- Thank you for filing a bug report! 🐛 Please provide a short summary of the bug, along with any information you feel relevant to replicating the bug. -->

I tried this code:

thread_local! {
    static LOCAL: String = String::new();
}

fn main() {}

I expected to see this happen: rust outputs warning for unused static LOCAL.

Instead, this happened: no warning

Meta

Rust version: current stable (1.69.0), beta, and nightly

  1. <!-- Thank you for filing a bug report! 🐛 Please provide a short summary of the bug, along with any information you feel relevant to replicating the bug. -->

    I tried this code:

    thread_local! {
        static LOCAL: String = String::new();
    }
    
    fn main() {}
    

    I expected to see this happen: rust outputs warning for unused static LOCAL.

    Instead, this happened: no warning

    Meta

    Rust version: current stable (1.69.0), beta, and nightly

    <!-- TRIAGEBOT_START --> <!-- TRIAGEBOT_ASSIGN_START --> <!-- TRIAGEBOT_ASSIGN_DATA_START$${"user":"mj10021"}$$TRIAGEBOT_ASSIGN_DATA_END --> <!-- TRIAGEBOT_ASSIGN_END --> <!-- TRIAGEBOT_END -->

    rustbot at 2023-05-08 14:29:48

  2. @rustbot claim

    mj10021 at 2023-05-08 14:29:46

  3. Seems like this was fixed by #111362, so it can be closed2

    Chris Denton at 2023-12-22 16:48:16

  4. Seems like this was fixed by #11136, so it can be closed2

    Wrong linked pr?

    klensy at 2023-12-22 18:08:21

  5. Oh! I missed a digit. Edited.

    Chris Denton at 2023-12-22 18:09:31