Skip to content

Commit

Permalink
Simplify report_elision_failure a little bit.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Hamann committed May 18, 2016
1 parent 7fef162 commit a50c82b
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/librustc_typeck/astconv.rs
Expand Up @@ -222,12 +222,6 @@ fn report_elision_failure(

let elided_len = elided_params.len();

let any_lifetimes = if elided_len > 0 {
true
} else {
false
};

for (i, info) in elided_params.into_iter().enumerate() {
let ElisionFailureInfo {
name, lifetime_count: n, have_bound_regions
Expand Down Expand Up @@ -262,7 +256,7 @@ fn report_elision_failure(
there is no value for it to be borrowed from");
help!(db,
"consider giving it a 'static lifetime");
} else if !any_lifetimes {
} else if elided_len == 0 {
help!(db,
"this function's return type contains a borrowed value with \
an elided lifetime, but the lifetime cannot be derived from \
Expand Down

0 comments on commit a50c82b

Please sign in to comment.