From: Owen Avery Date: Mon, 24 Mar 2025 01:04:32 +0000 (-0400) Subject: nr2.0: Fix test macros/mbe/macro43.rs X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4019d70517af4d6d95650eb2ee3a793c57cdbe2b;p=thirdparty%2Fgcc.git nr2.0: Fix test macros/mbe/macro43.rs 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 --- diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro43.rs b/gcc/testsuite/rust/compile/macros/mbe/macro43.rs index fbc36a9d6e5..0a7f038ef36 100644 --- a/gcc/testsuite/rust/compile/macros/mbe/macro43.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro43.rs @@ -1,3 +1,10 @@ +use Option::{None, Some}; + +enum Option { + 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 { 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 } } diff --git a/gcc/testsuite/rust/compile/nr2/exclude b/gcc/testsuite/rust/compile/nr2/exclude index 75a0ae0ea0e..19bf6f8f609 100644 --- a/gcc/testsuite/rust/compile/nr2/exclude +++ b/gcc/testsuite/rust/compile/nr2/exclude @@ -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