]> git.proxmox.com Git - rustc.git/blob - src/test/ui/issues/issue-72690.rs
New upstream version 1.60.0+dfsg1
[rustc.git] / src / test / ui / issues / issue-72690.rs
1 fn no_err() {
2 |x: String| x;
3 let _ = String::from("x");
4 }
5
6 fn err() {
7 String::from("x".as_ref()); //~ ERROR type annotations needed
8 //~^ ERROR type annotations needed
9 }
10
11 fn arg_pat_closure_err() {
12 |x| String::from("x".as_ref()); //~ ERROR type annotations needed
13 //~^ ERROR type annotations needed
14 //~| ERROR type annotations needed
15 }
16
17 fn local_pat_closure_err() {
18 let _ = "x".as_ref(); //~ ERROR type annotations needed
19 }
20
21 fn err_first_arg_pat() {
22 String::from("x".as_ref()); //~ ERROR type annotations needed
23 //~^ ERROR type annotations needed
24 |x: String| x;
25 }
26
27 fn err_second_arg_pat() {
28 |x: String| x;
29 String::from("x".as_ref()); //~ ERROR type annotations needed
30 //~^ ERROR type annotations needed
31 }
32
33 fn err_mid_arg_pat() {
34 |x: String| x;
35 |x: String| x;
36 |x: String| x;
37 |x: String| x;
38 String::from("x".as_ref()); //~ ERROR type annotations needed
39 //~^ ERROR type annotations needed
40 |x: String| x;
41 |x: String| x;
42 |x: String| x;
43 |x: String| x;
44 }
45
46 fn err_first_local_pat() {
47 String::from("x".as_ref()); //~ ERROR type annotations needed
48 //~^ ERROR type annotations needed
49 let _ = String::from("x");
50 }
51
52 fn err_second_local_pat() {
53 let _ = String::from("x");
54 String::from("x".as_ref()); //~ ERROR type annotations needed
55 //~^ ERROR type annotations needed
56 }
57
58 fn err_mid_local_pat() {
59 let _ = String::from("x");
60 let _ = String::from("x");
61 let _ = String::from("x");
62 let _ = String::from("x");
63 String::from("x".as_ref()); //~ ERROR type annotations needed
64 //~^ ERROR type annotations needed
65 let _ = String::from("x");
66 let _ = String::from("x");
67 let _ = String::from("x");
68 let _ = String::from("x");
69 }
70
71 fn main() {}