Skip to content

Conversation

ghost
Copy link

@ghost ghost commented Jul 5, 2014

I forget we now have byte string literals.

@bluss
Copy link
Contributor

bluss commented Jul 5, 2014

It would be nice if every commit or PR had at least a summary line of the issue it fixes.

@ghost
Copy link
Author

ghost commented Jul 5, 2014

@blake2-ppc Oh sorry. Definitely. Will keep in mind.

bors added a commit that referenced this pull request Jul 6, 2014
I forget we now have byte string literals.
@bors bors closed this Jul 6, 2014
@ghost ghost deleted the 15453 branch July 13, 2014 22:07
flip1995 pushed a commit to flip1995/rust that referenced this pull request Aug 22, 2025
)

Per the root readme, `clippy::style` is a category with

> code that should be written in a more idiomatic way

description.

The code this lint guards from may be much worse than badly styled:

```rs
use std::sync::LazyLock;

// `const` instead of `static` causes `dbg!` to be printed 10 times
// instead of one.
const LICENSE_FILE_NAME_REGEX: LazyLock<String> = LazyLock::new(|| {
    dbg!("I am a large regex initialized in a lazy lock!");
    format!("Hello {}", "World".to_string())
});

fn main() {
    for _ in 0..10 {
        let _ = LICENSE_FILE_NAME_REGEX.split(" ");
    }
}
```

In large projects, it's unfortunate but sometimes possible to see style
lints suppressed with

```toml
[workspace.lints.clippy]
style = { level = "allow", priority = -1 }
```

effectively turning off crucial checks for the code like above.

To keep them, promote this lint to `clippy::suspicious`:

> code that is most likely wrong or useless

category that has the same, `warn` default level, thus not failing on
false-positives which lead to
rust-lang/rust-clippy#5863

---

changelog: [`declare_interior_mutable_const`]: promote lint's category
to `clippy::suspicious`
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

Successfully merging this pull request may close these issues.

2 participants