]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/src/docs/fn_address_comparisons.txt
New upstream version 1.66.0+dfsg1
[rustc.git] / src / tools / clippy / src / docs / fn_address_comparisons.txt
CommitLineData
f2b60f7d
FG
1### What it does
2Checks for comparisons with an address of a function item.
3
4### Why is this bad?
5Function item address is not guaranteed to be unique and could vary
6between different code generation units. Furthermore different function items could have
7the same address after being merged together.
8
9### Example
10```
11type F = fn();
12fn a() {}
13let f: F = a;
14if f == a {
15 // ...
16}
17```