]> git.lizzy.rs Git - rust.git/commitdiff
Addresses #52049
authorPramod Bisht <pramodpsb@outlook.com>
Thu, 5 Jul 2018 18:12:03 +0000 (23:42 +0530)
committerPramod Bisht <pramodpsb@outlook.com>
Sat, 7 Jul 2018 04:02:41 +0000 (09:32 +0530)
src/librustc_borrowck/borrowck/mod.rs

index 4bd8e6afa76e3da07fb6b9b776205d0bd5d60583..530f266aa1f3245b397c060180fc606d78230d3b 100644 (file)
@@ -1009,7 +1009,10 @@ fn report_bckerr(&self, err: &BckError<'a, 'tcx>) {
                     let node_id = scope.node_id(self.tcx, &self.region_scope_tree);
                     match self.tcx.hir.find(node_id) {
                         Some(hir_map::NodeStmt(_)) => {
-                            db.note("consider using a `let` binding to increase its lifetime");
+                            if *sub_scope != ty::ReStatic {
+                                db.note("consider using a `let` binding to increase its lifetime");
+                            }
+
                         }
                         _ => {}
                     }