aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2024-09-26 22:59:48 +0200
committerArthur Cohen <arthur.cohen@embecosm.com>2025-03-19 15:32:15 +0100
commit141b2f9c7bb9b4060d39a0ae404c50b0c71b5ba0 (patch)
treefdd460d7681a59018e02a36ddcd6f1cc06cb2faa
parent6f8ca7f2516012326d2a68927543fff5e1a29611 (diff)
downloadgcc-141b2f9c7bb9b4060d39a0ae404c50b0c71b5ba0.zip
gcc-141b2f9c7bb9b4060d39a0ae404c50b0c71b5ba0.tar.gz
gcc-141b2f9c7bb9b4060d39a0ae404c50b0c71b5ba0.tar.bz2
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>
-rw-r--r--gcc/testsuite/rust/compile/box_syntax_feature_gate.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/testsuite/rust/compile/box_syntax_feature_gate.rs b/gcc/testsuite/rust/compile/box_syntax_feature_gate.rs
index 8eb5503..5f62a59 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 *-*-* } }