rust/clippy_utils
Samuel Tardieu d289009eea
Const eval changes (#15773)
First commit treats all constants containing a macro call as non-local
and renames `eval_simple` to be a little clearer.

Second commit removes `CoreConstant` and treats most of them as though
they were local. A couple of the constants like `usize::MAX` are treated
as non-local as different targets may have different values.
`const_is_empty` will now ignore non-local constants since there's no
guarantee that they are the same across all targets/features/versions.

The third commit just changes some `eval` calls to `eval_local`. Most of
these were style lints which shouldn't be assuming the value of a
constant won't ever change.

changelog: none
2025-10-04 18:16:35 +00:00
..
src Const eval changes (#15773) 2025-10-04 18:16:35 +00:00
Cargo.toml Bump Clippy version -> 0.1.92 2025-09-18 16:59:44 +02:00
README.md Bump nightly version -> 2025-09-18 2025-09-18 16:59:20 +02:00

clippy-utils

Helpful tools for writing lints, provided as they are used in Clippy.

Usage

This crate is only guaranteed to build with this nightly toolchain:

nightly-2025-09-18

To use clippy-utils in your lint, add the following to your Cargo.toml:

clippy_utils = "0.1.XY"

XY is the version of the nightly toolchain above and can be determined with rustc +nightly-YYYY-MM-DD -V.

⚠️ Stability ⚠️

No stability guarantees are made for this crate! Use at your own risk.

Function signatures can change or be removed without replacement without any prior notice.

LICENSE

Copyright 2014-2025 The Rust Project Developers

Licensed under the Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> or the MIT license <https://opensource.org/licenses/MIT>, at your option. Files in the project may not be copied, modified, or distributed except according to those terms.