]> git.lizzy.rs Git - rust.git/blob - tests/ui/typeck/deref-multi.rs
Rollup merge of #106922 - ChayimFriedman2:patch-5, r=workingjubilee
[rust.git] / tests / ui / typeck / deref-multi.rs
1 fn a(x: &&i32) -> i32 {
2     x
3     //~^ ERROR mismatched types
4 }
5
6 fn a2(x: &&&&&i32) -> i32 {
7     x
8     //~^ ERROR mismatched types
9 }
10
11 fn b(x: &i32) -> i32 {
12     &x
13     //~^ ERROR mismatched types
14 }
15
16 fn c(x: Box<i32>) -> i32 {
17     &x
18     //~^ ERROR mismatched types
19 }
20
21 fn d(x: std::sync::Mutex<&i32>) -> i32 {
22     x.lock().unwrap()
23     //~^ ERROR mismatched types
24 }
25
26 fn main() {}