about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNick Hamann <nick@wabbo.org>2016-05-18 13:09:25 -0500
committerNick Hamann <nick@wabbo.org>2016-05-18 13:09:25 -0500
commita50c82bc3bde5988a8f32ef2b593f0b051545e8a (patch)
tree7cb217fb50f278da5dcdfeb95474bfeedd92ab68
parent7fef1628735622ad005245ea2294449720ba7c5c (diff)
Simplify report_elision_failure a little bit.
-rw-r--r--src/librustc_typeck/astconv.rs8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs
index c3633625436..8fc6b552e14 100644
--- a/src/librustc_typeck/astconv.rs
+++ b/src/librustc_typeck/astconv.rs
@@ -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
@@ -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 \