]>
Commit | Line | Data |
---|---|---|
f2b60f7d FG |
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 | ``` |