@@ -13,7 +13,19 @@ LL + println!("x");
1313 |
1414
1515error: this let-binding has unit value
16- --> tests/ui/let_unit.rs:65:5
16+ --> tests/ui/let_unit.rs:30:9
17+ |
18+ LL | let _a: () = returns_unit();
19+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
20+ |
21+ help: omit the `let` binding
22+ |
23+ LL - let _a: () = returns_unit();
24+ LL + returns_unit();
25+ |
26+
27+ error: this let-binding has unit value
28+ --> tests/ui/let_unit.rs:68:5
1729 |
1830LL | / let _ = v
1931LL | |
@@ -31,7 +43,63 @@ LL + v
3143 |
3244
3345error: this let-binding has unit value
34- --> tests/ui/let_unit.rs:115:5
46+ --> tests/ui/let_unit.rs:96:5
47+ |
48+ LL | let x: () = f();
49+ | ^^^^-^^^^^^^^^^^
50+ | |
51+ | help: use a wildcard binding: `_`
52+
53+ error: this let-binding has unit value
54+ --> tests/ui/let_unit.rs:100:5
55+ |
56+ LL | let x: () = f2(0i32);
57+ | ^^^^-^^^^^^^^^^^^^^^^
58+ | |
59+ | help: use a wildcard binding: `_`
60+
61+ error: this let-binding has unit value
62+ --> tests/ui/let_unit.rs:103:5
63+ |
64+ LL | let _: () = f3(());
65+ | ^^^^^^^^^^^^^^^^^^^
66+ |
67+ help: omit the `let` binding
68+ |
69+ LL - let _: () = f3(());
70+ LL + f3(());
71+ |
72+
73+ error: this let-binding has unit value
74+ --> tests/ui/let_unit.rs:105:5
75+ |
76+ LL | let x: () = f3(());
77+ | ^^^^^^^^^^^^^^^^^^^
78+ |
79+ help: omit the `let` binding
80+ |
81+ LL - let x: () = f3(());
82+ LL + f3(());
83+ |
84+
85+ error: this let-binding has unit value
86+ --> tests/ui/let_unit.rs:112:5
87+ |
88+ LL | let x: () = f4(vec![()]);
89+ | ^^^^-^^^^^^^^^^^^^^^^^^^^
90+ | |
91+ | help: use a wildcard binding: `_`
92+
93+ error: this let-binding has unit value
94+ --> tests/ui/let_unit.rs:121:5
95+ |
96+ LL | let x: () = if true { f() } else { f2(0) };
97+ | ^^^^-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
98+ | |
99+ | help: use a wildcard binding: `_`
100+
101+ error: this let-binding has unit value
102+ --> tests/ui/let_unit.rs:124:5
35103 |
36104LL | / let x = match Some(0) {
37105LL | |
@@ -49,7 +117,19 @@ LL + match Some(0) {
49117 |
50118
51119error: this let-binding has unit value
52- --> tests/ui/let_unit.rs:195:9
120+ --> tests/ui/let_unit.rs:172:13
121+ |
122+ LL | let _: () = z;
123+ | ^^^^^^^^^^^^^^
124+ |
125+ help: omit the `let` binding
126+ |
127+ LL - let _: () = z;
128+ LL + z;
129+ |
130+
131+ error: this let-binding has unit value
132+ --> tests/ui/let_unit.rs:205:9
53133 |
54134LL | let res = returns_unit();
55135 | ^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -63,7 +143,7 @@ LL ~ returns_result(()).unwrap();
63143 |
64144
65145error: this let-binding has unit value
66- --> tests/ui/let_unit.rs:208 :5
146+ --> tests/ui/let_unit.rs:218 :5
67147 |
68148LL | let res = returns_unit();
69149 | ^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -77,7 +157,7 @@ LL ~ takes_unit(());
77157 |
78158
79159error: this let-binding has unit value
80- --> tests/ui/let_unit.rs:216 :14
160+ --> tests/ui/let_unit.rs:226 :14
81161 |
82162LL | _ => _ = returns_unit(),
83163 | ^^^^^^^^^^^^^^^^^^
@@ -89,7 +169,7 @@ LL + _ => returns_unit(),
89169 |
90170
91171error: this let-binding has unit value
92- --> tests/ui/let_unit.rs:220 :5
172+ --> tests/ui/let_unit.rs:230 :5
93173 |
94174LL | _ = if true {}
95175 | ^^^^^^^^^^^^^^
@@ -101,7 +181,7 @@ LL + if true {}
101181 |
102182
103183error: this let-binding has unit value
104- --> tests/ui/let_unit.rs:225 :5
184+ --> tests/ui/let_unit.rs:235 :5
105185 |
106186LL | let res = eprintln!("I return unit");
107187 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -115,7 +195,7 @@ LL ~ takes_unit(());
115195 |
116196
117197error: this let-binding has unit value
118- --> tests/ui/let_unit.rs:235 :5
198+ --> tests/ui/let_unit.rs:245 :5
119199 |
120200LL | let value = println!();
121201 | ^^^^^^^^^^^^^^^^^^^^^^^
128208LL ~ Foo { value: () };
129209 |
130210
131- error: aborting due to 9 previous errors
211+ error: aborting due to 17 previous errors
132212
0 commit comments