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"); + } + } _ => {} }