fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1error: this expression creates a reference which is immediately dereferenced by the compiler 2 --> $DIR/needless_borrow.rs:15:15 3 | 4LL | let _ = x(&&a); // warn 5 | ^^^ help: change this to: `&a` 6 | 7 = note: `-D clippy::needless-borrow` implied by `-D warnings` 8 = help: to override `-D warnings` add `#[allow(clippy::needless_borrow)]` 9 10error: this expression creates a reference which is immediately dereferenced by the compiler 11 --> $DIR/needless_borrow.rs:19:13 12 | 13LL | mut_ref(&mut &mut b); // warn 14 | ^^^^^^^^^^^ help: change this to: `&mut b` 15 16error: this expression creates a reference which is immediately dereferenced by the compiler 17 --> $DIR/needless_borrow.rs:31:13 18 | 19LL | &&a 20 | ^^^ help: change this to: `&a` 21 22error: this expression creates a reference which is immediately dereferenced by the compiler 23 --> $DIR/needless_borrow.rs:33:15 24 | 25LL | 46 => &&a, 26 | ^^^ help: change this to: `&a` 27 28error: this expression creates a reference which is immediately dereferenced by the compiler 29 --> $DIR/needless_borrow.rs:39:27 30 | 31LL | break &ref_a; 32 | ^^^^^^ help: change this to: `ref_a` 33 34error: this expression creates a reference which is immediately dereferenced by the compiler 35 --> $DIR/needless_borrow.rs:46:15 36 | 37LL | let _ = x(&&&a); 38 | ^^^^ help: change this to: `&a` 39 40error: this expression creates a reference which is immediately dereferenced by the compiler 41 --> $DIR/needless_borrow.rs:47:15 42 | 43LL | let _ = x(&mut &&a); 44 | ^^^^^^^^ help: change this to: `&a` 45 46error: this expression creates a reference which is immediately dereferenced by the compiler 47 --> $DIR/needless_borrow.rs:48:15 48 | 49LL | let _ = x(&&&mut b); 50 | ^^^^^^^^ help: change this to: `&mut b` 51 52error: this expression creates a reference which is immediately dereferenced by the compiler 53 --> $DIR/needless_borrow.rs:49:15 54 | 55LL | let _ = x(&&ref_a); 56 | ^^^^^^^ help: change this to: `ref_a` 57 58error: this expression creates a reference which is immediately dereferenced by the compiler 59 --> $DIR/needless_borrow.rs:52:11 60 | 61LL | x(&b); 62 | ^^ help: change this to: `b` 63 64error: this expression creates a reference which is immediately dereferenced by the compiler 65 --> $DIR/needless_borrow.rs:59:13 66 | 67LL | mut_ref(&mut x); 68 | ^^^^^^ help: change this to: `x` 69 70error: this expression creates a reference which is immediately dereferenced by the compiler 71 --> $DIR/needless_borrow.rs:60:13 72 | 73LL | mut_ref(&mut &mut x); 74 | ^^^^^^^^^^^ help: change this to: `x` 75 76error: this expression creates a reference which is immediately dereferenced by the compiler 77 --> $DIR/needless_borrow.rs:61:23 78 | 79LL | let y: &mut i32 = &mut x; 80 | ^^^^^^ help: change this to: `x` 81 82error: this expression creates a reference which is immediately dereferenced by the compiler 83 --> $DIR/needless_borrow.rs:62:23 84 | 85LL | let y: &mut i32 = &mut &mut x; 86 | ^^^^^^^^^^^ help: change this to: `x` 87 88error: this expression creates a reference which is immediately dereferenced by the compiler 89 --> $DIR/needless_borrow.rs:71:14 90 | 91LL | 0 => &mut x, 92 | ^^^^^^ help: change this to: `x` 93 94error: this expression creates a reference which is immediately dereferenced by the compiler 95 --> $DIR/needless_borrow.rs:77:14 96 | 97LL | 0 => &mut x, 98 | ^^^^^^ help: change this to: `x` 99 100error: this expression borrows a value the compiler would automatically borrow 101 --> $DIR/needless_borrow.rs:89:13 102 | 103LL | let _ = (&x).0; 104 | ^^^^ help: change this to: `x` 105 106error: this expression borrows a value the compiler would automatically borrow 107 --> $DIR/needless_borrow.rs:91:22 108 | 109LL | let _ = unsafe { (&*x).0 }; 110 | ^^^^^ help: change this to: `(*x)` 111 112error: this expression creates a reference which is immediately dereferenced by the compiler 113 --> $DIR/needless_borrow.rs:101:5 114 | 115LL | (&&()).foo(); 116 | ^^^^^^ help: change this to: `(&())` 117 118error: this expression creates a reference which is immediately dereferenced by the compiler 119 --> $DIR/needless_borrow.rs:110:5 120 | 121LL | (&&5).foo(); 122 | ^^^^^ help: change this to: `(&5)` 123 124error: this expression borrows a value the compiler would automatically borrow 125 --> $DIR/needless_borrow.rs:175:13 126 | 127LL | (&self.f)() 128 | ^^^^^^^^^ help: change this to: `(self.f)` 129 130error: this expression borrows a value the compiler would automatically borrow 131 --> $DIR/needless_borrow.rs:184:13 132 | 133LL | (&mut self.f)() 134 | ^^^^^^^^^^^^^ help: change this to: `(self.f)` 135 136error: aborting due to 22 previous errors 137