rust/clippy_utils
Jason Newcomb eafef84736
missing_const_for_fn: consider constness of instance (#14759)
When determining when a function or method can be called from a `const`
context, the determination must be made on the instance, not on the
declaration. This makes a difference, for example, with `const_trait`
traits whose implementations may or may not be `const`.

changelog: [`missing_const_for_fn`]: when checking if a function or
method can be called from a `const` context, look at the concrete
implementation rather than at the trait definition

Fixes rust-lang/rust-clippy#14658

r? @Jarcho
2025-06-03 14:03:51 +00:00
..
src missing_const_for_fn: consider constness of instance (#14759) 2025-06-03 14:03:51 +00:00
Cargo.toml Merge commit 'cadf98bb7d' into clippy-subtree-update 2025-05-21 15:15:38 +02:00
README.md Bump nightly version -> 2025-05-31 2025-05-31 14:11:00 +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-05-31

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.