From 3c3c140d8a85dacca44241ea4fdfa0cf5ee1960b Mon Sep 17 00:00:00 2001 From: León Orell Valerian Liehr Date: Tue, 5 Aug 2025 14:52:02 +0200 Subject: Gate const trait syntax (cherry picked from commit 092c6f3a188ec8b261ec3368e49ad3b07bcc13dc) --- compiler/rustc_parse/src/parser/item.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'compiler/rustc_parse/src/parser') 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)) { -- cgit 1.4.1-3-g733a5