From: Pierre-Emmanuel Patry <[email protected]>

rust-for-linux uses some nightly features that appeared with rust 1.50,
this patch provides a new mechanism dedicated to features required for
rfl that were not available back then.

gcc/rust/ChangeLog:

        * checks/errors/feature/contrib/fetch: Bump version from 1.49.0 to
        1.50.0. Change brace expansion to explicit file fetch.
        * checks/errors/feature/rust-feature-defs.h: Regenerate.
        * checks/errors/feature/contrib/copyright-stub.h: Add rfl include
        directive.
        * checks/errors/feature/rust-feature-defs-rfl.h: New file.

Signed-off-by: Pierre-Emmanuel Patry <[email protected]>
---
This change was merged into the gccrs repository and is posted here for
upstream visibility and potential drive-by review, as requested by GCC
release managers.
Each commit email contains a link to its details on github from where you can
find the Pull-Request and associated discussions.


Commit on github: 
https://github.com/Rust-GCC/gccrs/commit/8f84f52cb16faff0f778959b5e7308b9e825f082

The commit has been mentioned in the following pull-request(s):
 - https://github.com/Rust-GCC/gccrs/pull/4425

 .../errors/feature/contrib/copyright-stub.h   |  2 ++
 gcc/rust/checks/errors/feature/contrib/fetch  |  2 +-
 .../errors/feature/rust-feature-defs-rfl.h    | 26 +++++++++++++++++++
 .../checks/errors/feature/rust-feature-defs.h |  2 ++
 4 files changed, 31 insertions(+), 1 deletion(-)
 create mode 100644 gcc/rust/checks/errors/feature/rust-feature-defs-rfl.h

diff --git a/gcc/rust/checks/errors/feature/contrib/copyright-stub.h 
b/gcc/rust/checks/errors/feature/contrib/copyright-stub.h
index 1a5f52c5d..662bad37b 100644
--- a/gcc/rust/checks/errors/feature/contrib/copyright-stub.h
+++ b/gcc/rust/checks/errors/feature/contrib/copyright-stub.h
@@ -17,3 +17,5 @@
 // <http://www.gnu.org/licenses/>.
 
 // AUTO-GENERATED -- SEE LOCAL contrib SUBDIRECTORY
+
+#include "rust-feature-defs-rfl.h"
diff --git a/gcc/rust/checks/errors/feature/contrib/fetch 
b/gcc/rust/checks/errors/feature/contrib/fetch
index c37688b11..c3104e319 100755
--- a/gcc/rust/checks/errors/feature/contrib/fetch
+++ b/gcc/rust/checks/errors/feature/contrib/fetch
@@ -27,4 +27,4 @@ RUST_VERSION="1.49.0"
 URL_PREFIX='https://raw.githubusercontent.com/rust-lang/rust/refs/tags'
 URL_TEMPLATE="$URL_PREFIX/$RUST_VERSION/compiler/rustc_feature/src"
 
-wget -O $1 "$URL_TEMPLATE"/{accepted,active,removed}.rs
+wget -O $1 "$URL_TEMPLATE/accepted.rs" "$URL_TEMPLATE/active.rs" 
"$URL_TEMPLATE/removed.rs"
diff --git a/gcc/rust/checks/errors/feature/rust-feature-defs-rfl.h 
b/gcc/rust/checks/errors/feature/rust-feature-defs-rfl.h
new file mode 100644
index 000000000..8d5cc32e5
--- /dev/null
+++ b/gcc/rust/checks/errors/feature/rust-feature-defs-rfl.h
@@ -0,0 +1,26 @@
+// Copyright (C) 2025-2026 Free Software Foundation, Inc.
+
+// This file is part of GCC.
+
+// GCC is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 3, or (at your option) any later
+// version.
+
+// GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with GCC; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+/* Included by auto-generated rust-feature-defs.h
+ *
+ * This file gathers the features required for rust-for-linux that were not
+ * available in the version targeted by the compiler.
+ */
+
+FEATURE_ACTIVE ("extended_key_value_attributes", EXTENDED_KEY_VALUE_ATTRIBUTES,
+               "1.50.0", ISSUE_SOME (78835), EDITION_NONE)
diff --git a/gcc/rust/checks/errors/feature/rust-feature-defs.h 
b/gcc/rust/checks/errors/feature/rust-feature-defs.h
index 864390565..b541bbd23 100644
--- a/gcc/rust/checks/errors/feature/rust-feature-defs.h
+++ b/gcc/rust/checks/errors/feature/rust-feature-defs.h
@@ -18,6 +18,8 @@
 
 // AUTO-GENERATED -- SEE LOCAL contrib SUBDIRECTORY
 
+#include "rust-feature-defs-rfl.h"
+
 FEATURE_ACCEPTED ("issue_5723_bootstrap", ISSUE_5723_BOOTSTRAP, "1.0.0",
                  ISSUE_NONE)
 FEATURE_ACCEPTED ("test_accepted_feature", TEST_ACCEPTED_FEATURE, "1.0.0",
-- 
2.53.0

Reply via email to