]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Add box definition to avoid error
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Thu, 26 Sep 2024 20:59:48 +0000 (22:59 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Wed, 19 Mar 2025 14:32:15 +0000 (15:32 +0100)
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>
gcc/testsuite/rust/compile/box_syntax_feature_gate.rs

index 8eb5503dde6c7d35c2a7fec73f140abb1b0e25b2..5f62a59a04bf937df546d1915b2da847c7bafd5f 100644 (file)
@@ -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 *-*-* }  }