Skip to content

Commit a50c82b

Browse files
author
Nick Hamann
committed
Simplify report_elision_failure a little bit.
1 parent 7fef162 commit a50c82b

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/librustc_typeck/astconv.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,6 @@ fn report_elision_failure(
222222

223223
let elided_len = elided_params.len();
224224

225-
let any_lifetimes = if elided_len > 0 {
226-
true
227-
} else {
228-
false
229-
};
230-
231225
for (i, info) in elided_params.into_iter().enumerate() {
232226
let ElisionFailureInfo {
233227
name, lifetime_count: n, have_bound_regions
@@ -262,7 +256,7 @@ fn report_elision_failure(
262256
there is no value for it to be borrowed from");
263257
help!(db,
264258
"consider giving it a 'static lifetime");
265-
} else if !any_lifetimes {
259+
} else if elided_len == 0 {
266260
help!(db,
267261
"this function's return type contains a borrowed value with \
268262
an elided lifetime, but the lifetime cannot be derived from \

0 commit comments

Comments
 (0)