]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/src/docs/needless_borrow.txt
Rollup merge of #101151 - jethrogb:jb/sgx-platform, r=JohnTitor
[rust.git] / src / tools / clippy / src / docs / needless_borrow.txt
1 ### What it does
2 Checks for address of operations (`&`) that are going to
3 be dereferenced immediately by the compiler.
4
5 ### Why is this bad?
6 Suggests that the receiver of the expression borrows
7 the expression.
8
9 ### Example
10 ```
11 fn fun(_a: &i32) {}
12
13 let x: &i32 = &&&&&&5;
14 fun(&x);
15 ```
16
17 Use instead:
18 ```
19 let x: &i32 = &5;
20 fun(x);
21 ```