This commit is contained in:
Pramod Bisht 2018-07-05 23:42:03 +05:30
parent a178cba9f1
commit d5f443d81d

View File

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