[gcc r15-8414] gccrs: Add box definition to avoid error
Arthur Cohen
cohenarthur@gcc.gnu.org
Wed Mar 19 14:43:53 GMT 2025
https://gcc.gnu.org/g:141b2f9c7bb9b4060d39a0ae404c50b0c71b5ba0
commit r15-8414-g141b2f9c7bb9b4060d39a0ae404c50b0c71b5ba0
Author: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Date: Thu Sep 26 22:59:48 2024 +0200
gccrs: Add box definition to avoid error
Box definition is part of the standard library and cannot be found during
name resolution. This simple definition prevent any error from being
emitted.
gcc/testsuite/ChangeLog:
* rust/compile/box_syntax_feature_gate.rs: Add box land item
definition.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Diff:
---
gcc/testsuite/rust/compile/box_syntax_feature_gate.rs | 2 ++
1 file changed, 2 insertions(+)
diff --git a/gcc/testsuite/rust/compile/box_syntax_feature_gate.rs b/gcc/testsuite/rust/compile/box_syntax_feature_gate.rs
index 8eb5503dde6c..5f62a59a04bf 100644
--- a/gcc/testsuite/rust/compile/box_syntax_feature_gate.rs
+++ b/gcc/testsuite/rust/compile/box_syntax_feature_gate.rs
@@ -1,4 +1,6 @@
// { dg-options "-frust-compile-until=lowering" }
+#[lang = "owned_box"]
+pub struct Box<T>;
fn main() {
let x: Box<_> = box 1; //{ dg-error "box expression syntax is experimental." "" { target *-*-* } }
More information about the Gcc-cvs
mailing list