Properly gate safe
keyword in pre-expansion
This commit is contained in:
parent
1aaab8b9f8
commit
108b3f214a
4 changed files with 27 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue