Skip to content

Commit d5f443d

Browse files
committed
Addresses #52049
1 parent a178cba commit d5f443d

File tree

1 file changed

+4
-1
lines changed
  • src/librustc_borrowck/borrowck

1 file changed

+4
-1
lines changed

src/librustc_borrowck/borrowck/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,10 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
10091009
let node_id = scope.node_id(self.tcx, &self.region_scope_tree);
10101010
match self.tcx.hir.find(node_id) {
10111011
Some(hir_map::NodeStmt(_)) => {
1012-
db.note("consider using a `let` binding to increase its lifetime");
1012+
if *sub_scope != ty::ReStatic {
1013+
db.note("consider using a `let` binding to increase its lifetime");
1014+
}
1015+
10131016
}
10141017
_ => {}
10151018
}

0 commit comments

Comments
 (0)