]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Add missing test for lang item feature gate
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Sat, 29 Nov 2025 00:56:52 +0000 (01:56 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Wed, 3 Dec 2025 12:26:05 +0000 (13:26 +0100)
We recently modified all tests with lang items to add the lang feature
gate switch but we did not introduce any test to check that a proper
error message is printed when this switch is not used.

gcc/testsuite/ChangeLog:

* rust/compile/lang_feature_gate.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/testsuite/rust/compile/lang_feature_gate.rs [new file with mode: 0644]

diff --git a/gcc/testsuite/rust/compile/lang_feature_gate.rs b/gcc/testsuite/rust/compile/lang_feature_gate.rs
new file mode 100644 (file)
index 0000000..4cd485e
--- /dev/null
@@ -0,0 +1,2 @@
+#[lang = "sized"] // { dg-error "lang items are subject to change. add .#!.feature.lang_items... to the crate attributes to enable" }
+pub trait Sized {}