about summary refs log tree commit diff
path: root/compiler/rustc_parse/src
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2025-08-06 21:29:30 +0200
committerGitHub <noreply@github.com>2025-08-06 21:29:30 +0200
commit48d57564cfc0da0e5b67580fa49bb86a7bff0325 (patch)
treeb7fd6cd0b5ce66ca600a72cb9afb8eb9b4d9b4fe /compiler/rustc_parse/src
parentf7520353ab54552615b0640f8823bd9a9656cf52 (diff)
parent092c6f3a188ec8b261ec3368e49ad3b07bcc13dc (diff)
downloadrust-48d57564cfc0da0e5b67580fa49bb86a7bff0325.tar.gz
rust-48d57564cfc0da0e5b67580fa49bb86a7bff0325.zip
Rollup merge of #144956 - fmease:gate-const-trait-syntax, r=BoxyUwU
Gate const trait syntax

Missed this during my review of rust-lang/rust#143879, huge apologies!
Fixes [after beta backport] https://github.com/rust-lang/rust/issues/144958.

cc ``@fee1-dead``
r? ``@BoxyUwU`` or anyone
Diffstat (limited to 'compiler/rustc_parse/src')
-rw-r--r--compiler/rustc_parse/src/parser/item.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_parse/src/parser/item.rs b/compiler/rustc_parse/src/parser/item.rs
index 65d84b3e3d9..cb7c5649433 100644
--- a/compiler/rustc_parse/src/parser/item.rs
+++ b/compiler/rustc_parse/src/parser/item.rs
@@ -885,6 +885,9 @@ impl<'a> Parser<'a> {
     /// Parses `unsafe? auto? trait Foo { ... }` or `trait Foo = Bar;`.
     fn parse_item_trait(&mut self, attrs: &mut AttrVec, lo: Span) -> PResult<'a, ItemKind> {
         let constness = self.parse_constness(Case::Sensitive);
+        if let Const::Yes(span) = constness {
+            self.psess.gated_spans.gate(sym::const_trait_impl, span);
+        }
         let safety = self.parse_safety(Case::Sensitive);
         // Parse optional `auto` prefix.
         let is_auto = if self.eat_keyword(exp!(Auto)) {