]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
nr2.0: Fix test macros/mbe/macro43.rs
authorOwen Avery <powerboat9.gamer@gmail.com>
Mon, 24 Mar 2025 01:04:32 +0000 (21:04 -0400)
committerP-E-P <32375388+P-E-P@users.noreply.github.com>
Fri, 28 Mar 2025 12:10:51 +0000 (12:10 +0000)
gcc/testsuite/ChangeLog:

* rust/compile/macros/mbe/macro43.rs: Adjust test to pass with
name resolution 2.0.
* rust/compile/nr2/exclude: Remove macros/mbe/macro43.rs.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
gcc/testsuite/rust/compile/macros/mbe/macro43.rs
gcc/testsuite/rust/compile/nr2/exclude

index fbc36a9d6e550d68876afad182ef7ed42b1d01de..0a7f038ef3698fae806dbd4647abc38d796dd336 100644 (file)
@@ -1,3 +1,10 @@
+use Option::{None, Some};
+
+enum Option<T> {
+    None,
+    Some(T)
+}
+
 macro_rules! nonzero_integers {
     ( $( $Ty: ident($Int: ty); )+ ) => {
         $(
@@ -14,7 +21,7 @@ macro_rules! nonzero_integers {
             // not all derive macros are implemented yet, and this test does not test these anyways
             // #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
             #[repr(transparent)]
-            pub struct $Ty(NonZero<$Int>);
+            pub struct $Ty($Int);
 
             impl $Ty {
                 /// Create a non-zero without checking the value.
@@ -25,7 +32,7 @@ macro_rules! nonzero_integers {
                 #[stable(feature = "nonzero", since = "1.28.0")]
                 #[inline]
                 pub const unsafe fn new_unchecked(n: $Int) -> Self {
-                    $Ty(NonZero(n))
+                    $Ty(n)
                 }
 
                 /// Create a non-zero if the given value is not zero.
@@ -33,7 +40,7 @@ macro_rules! nonzero_integers {
                 #[inline]
                 pub fn new(n: $Int) -> Option<Self> {
                     if n != 0 {
-                        Some($Ty(NonZero(n)))
+                        Some($Ty(n))
                     } else {
                         None
                     }
@@ -43,7 +50,7 @@ macro_rules! nonzero_integers {
                 #[stable(feature = "nonzero", since = "1.28.0")]
                 #[inline]
                 pub fn get(self) -> $Int {
-                    self.0 .0
+                    self.0
                 }
 
             }
index 75a0ae0ea0ed468dae417336e6ae2fae75d804ed..19bf6f8f6091d5eca892320c26ebec912a20acc2 100644 (file)
@@ -5,7 +5,6 @@ issue-2043.rs
 issue-2812.rs
 issue-3315-2.rs
 lookup_err1.rs
-macros/mbe/macro43.rs
 macros/mbe/macro6.rs
 multiple_bindings1.rs
 multiple_bindings2.rs