1
Fork 0

Properly gate safe keyword in pre-expansion

This commit is contained in:
Michael Goulet 2024-06-20 14:14:36 -04:00
parent 1aaab8b9f8
commit 108b3f214a
4 changed files with 27 additions and 1 deletions

View file

@ -1214,6 +1214,9 @@ impl<'a> Parser<'a> {
if self.eat_keyword_case(kw::Unsafe, case) {
Safety::Unsafe(self.prev_token.uninterpolated_span())
} else if self.eat_keyword_case(kw::Safe, case) {
self.psess
.gated_spans
.gate(sym::unsafe_extern_blocks, self.prev_token.uninterpolated_span());
Safety::Safe(self.prev_token.uninterpolated_span())
} else {
Safety::Default