@@ -14,7 +14,7 @@ fn default() -> Result<()> {
14
14
} ;
15
15
#[ cfg( not( feature = "nightly" ) ) ]
16
16
let partial_ord = quote ! {
17
- fn __discriminant( __this: & Test ) -> isize {
17
+ const fn __discriminant( __this: & Test ) -> isize {
18
18
match __this {
19
19
Test :: A => 0 ,
20
20
Test :: B => ( 0 ) + 1 ,
@@ -152,7 +152,7 @@ fn default_reverse() -> Result<()> {
152
152
} ;
153
153
#[ cfg( not( feature = "nightly" ) ) ]
154
154
let partial_ord = quote ! {
155
- fn __discriminant( __this: & Test ) -> isize {
155
+ const fn __discriminant( __this: & Test ) -> isize {
156
156
match __this {
157
157
Test :: A => 2 ,
158
158
Test :: B => 1 ,
@@ -199,7 +199,7 @@ fn default_mix() -> Result<()> {
199
199
} ;
200
200
#[ cfg( not( feature = "nightly" ) ) ]
201
201
let partial_ord = quote ! {
202
- fn __discriminant( __this: & Test ) -> isize {
202
+ const fn __discriminant( __this: & Test ) -> isize {
203
203
match __this {
204
204
Test :: A => 1 ,
205
205
Test :: B => 0 ,
@@ -248,7 +248,7 @@ fn default_skip() -> Result<()> {
248
248
} ;
249
249
#[ cfg( not( feature = "nightly" ) ) ]
250
250
let partial_ord = quote ! {
251
- fn __discriminant( __this: & Test ) -> isize {
251
+ const fn __discriminant( __this: & Test ) -> isize {
252
252
match __this {
253
253
Test :: A => 0 ,
254
254
Test :: B => 3 ,
@@ -299,7 +299,7 @@ fn default_expr() -> Result<()> {
299
299
} ;
300
300
#[ cfg( not( feature = "nightly" ) ) ]
301
301
let partial_ord = quote ! {
302
- fn __discriminant( __this: & Test ) -> isize {
302
+ const fn __discriminant( __this: & Test ) -> isize {
303
303
match __this {
304
304
Test :: A => isize :: MAX - 2 ,
305
305
Test :: B => ( isize :: MAX - 2 ) + 1 ,
@@ -349,7 +349,7 @@ fn repr_c() -> Result<()> {
349
349
#[ repr( C ) ]
350
350
enum EnsureReprCIsIsize { Test = 0_isize }
351
351
352
- fn __discriminant( __this: & Test ) -> isize {
352
+ const fn __discriminant( __this: & Test ) -> isize {
353
353
match __this {
354
354
Test :: A => 0 ,
355
355
Test :: B => ( 0 ) + 1 ,
@@ -397,7 +397,7 @@ fn repr_c_without_discriminant() -> Result<()> {
397
397
} ;
398
398
#[ cfg( not( feature = "nightly" ) ) ]
399
399
let partial_ord = quote ! {
400
- fn __discriminant( __this: & Test ) -> isize {
400
+ const fn __discriminant( __this: & Test ) -> isize {
401
401
match __this {
402
402
Test :: A => 0 ,
403
403
Test :: B => 1 ,
@@ -640,7 +640,7 @@ fn repr_c_reverse() -> Result<()> {
640
640
#[ repr( C ) ]
641
641
enum EnsureReprCIsIsize { Test = 0_isize }
642
642
643
- fn __discriminant( __this: & Test ) -> isize {
643
+ const fn __discriminant( __this: & Test ) -> isize {
644
644
match __this {
645
645
Test :: A => 2 ,
646
646
Test :: B => 1 ,
@@ -691,7 +691,7 @@ fn repr_c_mix() -> Result<()> {
691
691
#[ repr( C ) ]
692
692
enum EnsureReprCIsIsize { Test = 0_isize }
693
693
694
- fn __discriminant( __this: & Test ) -> isize {
694
+ const fn __discriminant( __this: & Test ) -> isize {
695
695
match __this {
696
696
Test :: A => 1 ,
697
697
Test :: B => 0 ,
@@ -744,7 +744,7 @@ fn repr_c_skip() -> Result<()> {
744
744
#[ repr( C ) ]
745
745
enum EnsureReprCIsIsize { Test = 0_isize }
746
746
747
- fn __discriminant( __this: & Test ) -> isize {
747
+ const fn __discriminant( __this: & Test ) -> isize {
748
748
match __this {
749
749
Test :: A => 0 ,
750
750
Test :: B => 3 ,
@@ -799,7 +799,7 @@ fn repr_c_expr() -> Result<()> {
799
799
#[ repr( C ) ]
800
800
enum EnsureReprCIsIsize { Test = 0_isize }
801
801
802
- fn __discriminant( __this: & Test ) -> isize {
802
+ const fn __discriminant( __this: & Test ) -> isize {
803
803
match __this {
804
804
Test :: A => u64 :: MAX - 2 ,
805
805
Test :: B => ( u64 :: MAX - 2 ) + 1 ,
@@ -861,7 +861,7 @@ fn repr_c_with_value() -> Result<()> {
861
861
} ;
862
862
#[ cfg( all( not( feature = "nightly" ) , feature = "safe" ) ) ]
863
863
let partial_ord = quote ! {
864
- fn __discriminant<T >( __this: & Test <T >) -> u8 {
864
+ const fn __discriminant<T >( __this: & Test <T >) -> u8 {
865
865
match __this {
866
866
Test :: A ( ref __field_0) => 0 ,
867
867
Test :: B => ( 0 ) + 1 ,
@@ -931,7 +931,7 @@ fn repr_c_with_value_reverse() -> Result<()> {
931
931
} ;
932
932
#[ cfg( all( not( feature = "nightly" ) , feature = "safe" ) ) ]
933
933
let partial_ord = quote ! {
934
- fn __discriminant<T >( __this: & Test <T >) -> u8 {
934
+ const fn __discriminant<T >( __this: & Test <T >) -> u8 {
935
935
match __this {
936
936
Test :: A ( ref __field_0) => 2 ,
937
937
Test :: B => 1 ,
@@ -1001,7 +1001,7 @@ fn repr_c_with_value_mix() -> Result<()> {
1001
1001
} ;
1002
1002
#[ cfg( all( not( feature = "nightly" ) , feature = "safe" ) ) ]
1003
1003
let partial_ord = quote ! {
1004
- fn __discriminant<T >( __this: & Test <T >) -> u8 {
1004
+ const fn __discriminant<T >( __this: & Test <T >) -> u8 {
1005
1005
match __this {
1006
1006
Test :: A ( ref __field_0) => 1 ,
1007
1007
Test :: B => 0 ,
@@ -1071,7 +1071,7 @@ fn repr_c_with_value_skip() -> Result<()> {
1071
1071
} ;
1072
1072
#[ cfg( all( not( feature = "nightly" ) , feature = "safe" ) ) ]
1073
1073
let partial_ord = quote ! {
1074
- fn __discriminant<T >( __this: & Test <T >) -> u8 {
1074
+ const fn __discriminant<T >( __this: & Test <T >) -> u8 {
1075
1075
match __this {
1076
1076
Test :: A ( ref __field_0) => 0 ,
1077
1077
Test :: B => 3 ,
@@ -1143,7 +1143,7 @@ fn repr_c_with_value_expr() -> Result<()> {
1143
1143
} ;
1144
1144
#[ cfg( all( not( feature = "nightly" ) , feature = "safe" ) ) ]
1145
1145
let partial_ord = quote ! {
1146
- fn __discriminant<T >( __this: & Test <T >) -> u8 {
1146
+ const fn __discriminant<T >( __this: & Test <T >) -> u8 {
1147
1147
match __this {
1148
1148
Test :: A ( ref __field_0) => isize :: MAX - 2 ,
1149
1149
Test :: B => ( isize :: MAX - 2 ) + 1 ,
@@ -1206,7 +1206,7 @@ fn repr() -> Result<()> {
1206
1206
} ;
1207
1207
#[ cfg( all( not( feature = "nightly" ) , feature = "safe" ) ) ]
1208
1208
let partial_ord = quote ! {
1209
- fn __discriminant( __this: & Test ) -> u64 {
1209
+ const fn __discriminant( __this: & Test ) -> u64 {
1210
1210
match __this {
1211
1211
Test :: A => 0 ,
1212
1212
Test :: B => ( 0 ) + 1 ,
@@ -1354,7 +1354,7 @@ fn repr_reverse() -> Result<()> {
1354
1354
} ;
1355
1355
#[ cfg( all( not( feature = "nightly" ) , feature = "safe" ) ) ]
1356
1356
let partial_ord = quote ! {
1357
- fn __discriminant( __this: & Test ) -> u64 {
1357
+ const fn __discriminant( __this: & Test ) -> u64 {
1358
1358
match __this {
1359
1359
Test :: A => 2 ,
1360
1360
Test :: B => 1 ,
@@ -1409,7 +1409,7 @@ fn repr_mix() -> Result<()> {
1409
1409
} ;
1410
1410
#[ cfg( all( not( feature = "nightly" ) , feature = "safe" ) ) ]
1411
1411
let partial_ord = quote ! {
1412
- fn __discriminant( __this: & Test ) -> u64 {
1412
+ const fn __discriminant( __this: & Test ) -> u64 {
1413
1413
match __this {
1414
1414
Test :: A => 1 ,
1415
1415
Test :: B => 0 ,
@@ -1466,7 +1466,7 @@ fn repr_skip() -> Result<()> {
1466
1466
} ;
1467
1467
#[ cfg( all( not( feature = "nightly" ) , feature = "safe" ) ) ]
1468
1468
let partial_ord = quote ! {
1469
- fn __discriminant( __this: & Test ) -> u64 {
1469
+ const fn __discriminant( __this: & Test ) -> u64 {
1470
1470
match __this {
1471
1471
Test :: A => 0 ,
1472
1472
Test :: B => 3 ,
@@ -1525,7 +1525,7 @@ fn repr_expr() -> Result<()> {
1525
1525
} ;
1526
1526
#[ cfg( all( not( feature = "nightly" ) , feature = "safe" ) ) ]
1527
1527
let partial_ord = quote ! {
1528
- fn __discriminant( __this: & Test ) -> u64 {
1528
+ const fn __discriminant( __this: & Test ) -> u64 {
1529
1529
match __this {
1530
1530
Test :: A => u64 :: MAX - 2 ,
1531
1531
Test :: B => ( u64 :: MAX - 2 ) + 1 ,
@@ -1587,7 +1587,7 @@ fn repr_with_value() -> Result<()> {
1587
1587
} ;
1588
1588
#[ cfg( all( not( feature = "nightly" ) , feature = "safe" ) ) ]
1589
1589
let partial_ord = quote ! {
1590
- fn __discriminant<T >( __this: & Test <T >) -> u8 {
1590
+ const fn __discriminant<T >( __this: & Test <T >) -> u8 {
1591
1591
match __this {
1592
1592
Test :: A ( ref __field_0) => 0 ,
1593
1593
Test :: B => ( 0 ) + 1 ,
@@ -1657,7 +1657,7 @@ fn repr_with_value_reverse() -> Result<()> {
1657
1657
} ;
1658
1658
#[ cfg( all( not( feature = "nightly" ) , feature = "safe" ) ) ]
1659
1659
let partial_ord = quote ! {
1660
- fn __discriminant<T >( __this: & Test <T >) -> u8 {
1660
+ const fn __discriminant<T >( __this: & Test <T >) -> u8 {
1661
1661
match __this {
1662
1662
Test :: A ( ref __field_0) => 2 ,
1663
1663
Test :: B => 1 ,
@@ -1727,7 +1727,7 @@ fn repr_with_value_mix() -> Result<()> {
1727
1727
} ;
1728
1728
#[ cfg( all( not( feature = "nightly" ) , feature = "safe" ) ) ]
1729
1729
let partial_ord = quote ! {
1730
- fn __discriminant<T >( __this: & Test <T >) -> u8 {
1730
+ const fn __discriminant<T >( __this: & Test <T >) -> u8 {
1731
1731
match __this {
1732
1732
Test :: A ( ref __field_0) => 1 ,
1733
1733
Test :: B => 0 ,
@@ -1797,7 +1797,7 @@ fn repr_with_value_skip() -> Result<()> {
1797
1797
} ;
1798
1798
#[ cfg( all( not( feature = "nightly" ) , feature = "safe" ) ) ]
1799
1799
let partial_ord = quote ! {
1800
- fn __discriminant<T >( __this: & Test <T >) -> u8 {
1800
+ const fn __discriminant<T >( __this: & Test <T >) -> u8 {
1801
1801
match __this {
1802
1802
Test :: A ( ref __field_0) => 0 ,
1803
1803
Test :: B => 3 ,
@@ -1869,7 +1869,7 @@ fn repr_with_value_expr() -> Result<()> {
1869
1869
} ;
1870
1870
#[ cfg( all( not( feature = "nightly" ) , feature = "safe" ) ) ]
1871
1871
let partial_ord = quote ! {
1872
- fn __discriminant<T >( __this: & Test <T >) -> u8 {
1872
+ const fn __discriminant<T >( __this: & Test <T >) -> u8 {
1873
1873
match __this {
1874
1874
Test :: A ( ref __field_0) => isize :: MAX - 2 ,
1875
1875
Test :: B => ( isize :: MAX - 2 ) + 1 ,
0 commit comments