Skip to content

Commit 4019d70

Browse files
powerboat9P-E-P
authored andcommitted
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>
1 parent 898d55a commit 4019d70

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

gcc/testsuite/rust/compile/macros/mbe/macro43.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
use Option::{None, Some};
2+
3+
enum Option<T> {
4+
None,
5+
Some(T)
6+
}
7+
18
macro_rules! nonzero_integers {
29
( $( $Ty: ident($Int: ty); )+ ) => {
310
$(
@@ -14,7 +21,7 @@ macro_rules! nonzero_integers {
1421
// not all derive macros are implemented yet, and this test does not test these anyways
1522
// #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1623
#[repr(transparent)]
17-
pub struct $Ty(NonZero<$Int>);
24+
pub struct $Ty($Int);
1825

1926
impl $Ty {
2027
/// Create a non-zero without checking the value.
@@ -25,15 +32,15 @@ macro_rules! nonzero_integers {
2532
#[stable(feature = "nonzero", since = "1.28.0")]
2633
#[inline]
2734
pub const unsafe fn new_unchecked(n: $Int) -> Self {
28-
$Ty(NonZero(n))
35+
$Ty(n)
2936
}
3037

3138
/// Create a non-zero if the given value is not zero.
3239
#[stable(feature = "nonzero", since = "1.28.0")]
3340
#[inline]
3441
pub fn new(n: $Int) -> Option<Self> {
3542
if n != 0 {
36-
Some($Ty(NonZero(n)))
43+
Some($Ty(n))
3744
} else {
3845
None
3946
}
@@ -43,7 +50,7 @@ macro_rules! nonzero_integers {
4350
#[stable(feature = "nonzero", since = "1.28.0")]
4451
#[inline]
4552
pub fn get(self) -> $Int {
46-
self.0 .0
53+
self.0
4754
}
4855

4956
}

gcc/testsuite/rust/compile/nr2/exclude

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ issue-2043.rs
55
issue-2812.rs
66
issue-3315-2.rs
77
lookup_err1.rs
8-
macros/mbe/macro43.rs
98
macros/mbe/macro6.rs
109
multiple_bindings1.rs
1110
multiple_bindings2.rs

0 commit comments

Comments
 (0)