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

No warning for unused thread_local #111288

Open
juchiast opened this issue May 6, 2023 · 4 comments
Open

No warning for unused thread_local #111288

juchiast opened this issue May 6, 2023 · 4 comments
Assignees
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@juchiast
Copy link
Contributor

juchiast commented May 6, 2023

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

@juchiast juchiast added the C-bug Category: This is a bug. label May 6, 2023
@Noratrieb Noratrieb added A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 6, 2023
@mj10021
Copy link
Contributor

mj10021 commented May 8, 2023

@rustbot claim

bors added a commit to rust-lang-ci/rust that referenced this issue Jul 24, 2023
delete [allow(unused_unsafe)] from issue rust-lang#74838

While looking into issue rust-lang#111288 I noticed the following `#[allow(...)]` with a `FIXME` asking for it to be removed.  Deleting the `#[allow(...)]` does not seem to break anything, it seems like the lint has been updated for unsafe blocks in macros?
@ChrisDenton
Copy link
Member

ChrisDenton commented Dec 22, 2023

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

@klensy
Copy link
Contributor

klensy commented Dec 22, 2023

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

Wrong linked pr?

@ChrisDenton
Copy link
Member

Oh! I missed a digit. Edited.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants