about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src/coverage/debug.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-08-28 18:27:53 +0000
committerbors <bors@rust-lang.org>2023-08-28 18:27:53 +0000
commit5cc5f2789912f3516b37c7e79887feafa768cc44 (patch)
treeb940623969709abf8589fc382cd5acad0818ead5 /compiler/rustc_mir_transform/src/coverage/debug.rs
parent4118738998993f0c4b0eb30eda502f21ebd28c4e (diff)
parente43c23416832d61d906512c73c205823f1b6eea5 (diff)
downloadrust-5cc5f2789912f3516b37c7e79887feafa768cc44.tar.gz
rust-5cc5f2789912f3516b37c7e79887feafa768cc44.zip
Auto merge of #11385 - markhuang1212:master, r=blyxyas
skip float_cmp check if lhs is a custom type

*Please write a short comment explaining your change (or "none" for internal only changes)*

changelog: [`float_cmp`]: allow float eq comparison when lhs is a custom type that implements PartialEq<f32/f64>

If the lhs of a comparison is not float, it means there is a user implemented PartialEq, and the caller is invoking that custom version of `==`, instead of the default floating point equal comparison.

People may wrap f32 with a struct (say `MyF32`) and implement its PartialEq that will do the `is_close()` check, so that `MyF32` can be compared with either f32 or `MyF32`.
Diffstat (limited to 'compiler/rustc_mir_transform/src/coverage/debug.rs')
0 files changed, 0 insertions, 0 deletions