]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/src/docs/fn_address_comparisons.txt
Auto merge of #98559 - jackh726:remove-reempty, r=oli-obk
[rust.git] / src / tools / clippy / src / docs / fn_address_comparisons.txt
1 ### What it does
2 Checks for comparisons with an address of a function item.
3
4 ### Why is this bad?
5 Function item address is not guaranteed to be unique and could vary
6 between different code generation units. Furthermore different function items could have
7 the same address after being merged together.
8
9 ### Example
10 ```
11 type F = fn();
12 fn a() {}
13 let f: F = a;
14 if f == a {
15     // ...
16 }
17 ```