about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-01-18 16:55:31 +0000
committerbors <bors@rust-lang.org>2024-01-18 16:55:31 +0000
commitb08ffeee5c931ef8db04a9ca9641868d84c3b69a (patch)
tree57c5abe0ffb0d3b27f5023d916e48d3270650c1e /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parentbb2d4973648b1af18d7ba6a3028ed7c92fde07fb (diff)
parentefd8dafa2f701280c2dd5ee31716ffa0c18e484b (diff)
downloadrust-b08ffeee5c931ef8db04a9ca9641868d84c3b69a.tar.gz
rust-b08ffeee5c931ef8db04a9ca9641868d84c3b69a.zip
Auto merge of #12168 - y21:issue12159, r=blyxyas
[`default_numeric_fallback`]: improve const context detection

Fixes #12159

The lint didn't actually recognize any of the associated consts (in the linked issue), because in those cases the parent is an `ImplItem` and not an `Item`, but it only actually emitted a lint for i32 and f64 because the other cases failed the very last check here
https://github.com/rust-lang/rust-clippy/blob/bb2d4973648b1af18d7ba6a3028ed7c92fde07fb/clippy_lints/src/default_numeric_fallback.rs#L91-L96

A better check for detecting constness would be using `body_const_context`, which is what this PR does.

changelog: [`default_numeric_fallback`]: recognize associated consts
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions