]> git.lizzy.rs Git - rust.git/blob - tests/ui/needless_borrow.stderr
Auto merge of #4478 - tsurai:master, r=flip1995
[rust.git] / tests / ui / needless_borrow.stderr
1 error: this expression borrows a reference that is immediately dereferenced by the compiler
2   --> $DIR/needless_borrow.rs:13:15
3    |
4 LL |     let c = x(&&a);
5    |               ^^^ help: change this to: `&a`
6    |
7    = note: `-D clippy::needless-borrow` implied by `-D warnings`
8
9 error: this pattern creates a reference to a reference
10   --> $DIR/needless_borrow.rs:20:17
11    |
12 LL |     if let Some(ref cake) = Some(&5) {}
13    |                 ^^^^^^^^ help: change this to: `cake`
14
15 error: this expression borrows a reference that is immediately dereferenced by the compiler
16   --> $DIR/needless_borrow.rs:27:15
17    |
18 LL |         46 => &&a,
19    |               ^^^ help: change this to: `&a`
20
21 error: this pattern takes a reference on something that is being de-referenced
22   --> $DIR/needless_borrow.rs:49:34
23    |
24 LL |     let _ = v.iter_mut().filter(|&ref a| a.is_empty());
25    |                                  ^^^^^^ help: try removing the `&ref` part and just keep: `a`
26    |
27    = note: `-D clippy::needless-borrowed-reference` implied by `-D warnings`
28
29 error: this pattern takes a reference on something that is being de-referenced
30   --> $DIR/needless_borrow.rs:50:30
31    |
32 LL |     let _ = v.iter().filter(|&ref a| a.is_empty());
33    |                              ^^^^^^ help: try removing the `&ref` part and just keep: `a`
34
35 error: this pattern creates a reference to a reference
36   --> $DIR/needless_borrow.rs:50:31
37    |
38 LL |     let _ = v.iter().filter(|&ref a| a.is_empty());
39    |                               ^^^^^ help: change this to: `a`
40
41 error: aborting due to 6 previous errors
42