about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPramod Bisht <pramodpsb@outlook.com>2018-07-05 23:42:03 +0530
committerPramod Bisht <pramodpsb@outlook.com>2018-07-07 09:32:41 +0530
commitd5f443d81de64a6b551ce2f09fb129b03941b05c (patch)
treea1d6ad899d7e7ed443b1a84d4793212aab386d54
parenta178cba9f1be1dc5f9da47a9ed5d291c19821aab (diff)
downloadrust-d5f443d81de64a6b551ce2f09fb129b03941b05c.tar.gz
rust-d5f443d81de64a6b551ce2f09fb129b03941b05c.zip
Addresses #52049
-rw-r--r--src/librustc_borrowck/borrowck/mod.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/librustc_borrowck/borrowck/mod.rs b/src/librustc_borrowck/borrowck/mod.rs
index 4bd8e6afa76..530f266aa1f 100644
--- a/src/librustc_borrowck/borrowck/mod.rs
+++ b/src/librustc_borrowck/borrowck/mod.rs
@@ -1009,7 +1009,10 @@ impl<'a, 'tcx> BorrowckCtxt<'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");
+                            }
+
                         }
                         _ => {}
                     }