diff options
| author | bors <bors@rust-lang.org> | 2024-06-21 04:22:02 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-06-21 04:22:02 +0000 |
| commit | 4e6de37349c7838df095b085a2640cb6a007c96a (patch) | |
| tree | 11f20712d6ea2677bc2824b83bc7314ca60e9e61 /compiler/rustc_parse/src/parser | |
| parent | 7a08f84627ff3035de4d66ff3209e5fc93165dcb (diff) | |
| parent | 108b3f214a7e160ecb7ac2ec05bbb41aedd05a95 (diff) | |
| download | rust-4e6de37349c7838df095b085a2640cb6a007c96a.tar.gz rust-4e6de37349c7838df095b085a2640cb6a007c96a.zip | |
Auto merge of #126757 - compiler-errors:safe, r=spastorino
Properly gate `safe` keyword in pre-expansion This PR gates `safe` keyword in pre-expansion contexts. Should mitigate the fallout of https://github.com/rust-lang/rust/issues/126755, which is that `safe` is now usable on beta lol. r? `@spastorino` or `@oli-obk` cc #124482 tracking #123743
Diffstat (limited to 'compiler/rustc_parse/src/parser')
| -rw-r--r-- | compiler/rustc_parse/src/parser/mod.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_parse/src/parser/mod.rs b/compiler/rustc_parse/src/parser/mod.rs index 2f12459da57..cfd0a72c056 100644 --- a/compiler/rustc_parse/src/parser/mod.rs +++ b/compiler/rustc_parse/src/parser/mod.rs @@ -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 |
