diff options
author | Owen Avery <powerboat9.gamer@gmail.com> | 2025-03-23 21:04:32 -0400 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2025-03-31 21:07:21 +0200 |
commit | a69ba47dfeb26adafe1d0f011cd134fadcab7cea (patch) | |
tree | 7aef9d72f59ebc2eeff0647f5628f2dbe9ff6423 | |
parent | 732c9d0cd5d1ebfee57aa1f4ee5d1487765d5ca7 (diff) | |
download | gcc-a69ba47dfeb26adafe1d0f011cd134fadcab7cea.zip gcc-a69ba47dfeb26adafe1d0f011cd134fadcab7cea.tar.gz gcc-a69ba47dfeb26adafe1d0f011cd134fadcab7cea.tar.bz2 |
gccrs: 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 <powerboat9.gamer@gmail.com>
-rw-r--r-- | gcc/testsuite/rust/compile/macros/mbe/macro43.rs | 15 | ||||
-rw-r--r-- | gcc/testsuite/rust/compile/nr2/exclude | 1 |
2 files changed, 11 insertions, 5 deletions
diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro43.rs b/gcc/testsuite/rust/compile/macros/mbe/macro43.rs index fbc36a9..0a7f038 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<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 } } diff --git a/gcc/testsuite/rust/compile/nr2/exclude b/gcc/testsuite/rust/compile/nr2/exclude index 75a0ae0..19bf6f8 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 |