1 error[E0308]: mismatched types
2 --> $DIR/deref-multi.rs:2:5
4 LL | fn a(x: &&i32) -> i32 {
5 | --- expected `i32` because of return type
7 | ^ expected `i32`, found `&&i32`
9 help: consider dereferencing the borrow
14 error[E0308]: mismatched types
15 --> $DIR/deref-multi.rs:7:5
17 LL | fn a2(x: &&&&&i32) -> i32 {
18 | --- expected `i32` because of return type
20 | ^ expected `i32`, found `&&&&&i32`
22 help: consider dereferencing the borrow
27 error[E0308]: mismatched types
28 --> $DIR/deref-multi.rs:12:5
30 LL | fn b(x: &i32) -> i32 {
31 | --- expected `i32` because of return type
33 | ^^ expected `i32`, found `&&i32`
35 help: consider removing the `&` and dereferencing the borrow instead
40 error[E0308]: mismatched types
41 --> $DIR/deref-multi.rs:17:5
43 LL | fn c(x: Box<i32>) -> i32 {
44 | --- expected `i32` because of return type
46 | ^^ expected `i32`, found `&Box<i32>`
48 = note: expected type `i32`
49 found reference `&Box<i32>`
50 help: consider removing the `&` and dereferencing the borrow instead
55 error[E0308]: mismatched types
56 --> $DIR/deref-multi.rs:22:5
58 LL | fn d(x: std::sync::Mutex<&i32>) -> i32 {
59 | --- expected `i32` because of return type
60 LL | x.lock().unwrap()
61 | ^^^^^^^^^^^^^^^^^ expected `i32`, found `MutexGuard<'_, &i32>`
63 = note: expected type `i32`
64 found struct `MutexGuard<'_, &i32>`
65 help: consider dereferencing the type
67 LL | **x.lock().unwrap()
70 error: aborting due to 5 previous errors
72 For more information about this error, try `rustc --explain E0308`.