Check for borrow of local variable introduced within static block.

(Rather than ICE on it.)

Fix #18118.
auto merge of #18124 : pnkfelix/rust/fsk-add-check-of-borrow-local-static, r=thestinger

Check for borrow of local variable introduced within static block.

(Rather than ICE on it.)

Fix #18118.