@@ -14,7 +14,7 @@ fn default() -> Result<()> {
1414 } ;
1515 #[ cfg( not( feature = "nightly" ) ) ]
1616 let partial_ord = quote ! {
17- fn __discriminant( __this: & Test ) -> isize {
17+ const fn __discriminant( __this: & Test ) -> isize {
1818 match __this {
1919 Test :: A => 0 ,
2020 Test :: B => ( 0 ) + 1 ,
@@ -152,7 +152,7 @@ fn default_reverse() -> Result<()> {
152152 } ;
153153 #[ cfg( not( feature = "nightly" ) ) ]
154154 let partial_ord = quote ! {
155- fn __discriminant( __this: & Test ) -> isize {
155+ const fn __discriminant( __this: & Test ) -> isize {
156156 match __this {
157157 Test :: A => 2 ,
158158 Test :: B => 1 ,
@@ -199,7 +199,7 @@ fn default_mix() -> Result<()> {
199199 } ;
200200 #[ cfg( not( feature = "nightly" ) ) ]
201201 let partial_ord = quote ! {
202- fn __discriminant( __this: & Test ) -> isize {
202+ const fn __discriminant( __this: & Test ) -> isize {
203203 match __this {
204204 Test :: A => 1 ,
205205 Test :: B => 0 ,
@@ -248,7 +248,7 @@ fn default_skip() -> Result<()> {
248248 } ;
249249 #[ cfg( not( feature = "nightly" ) ) ]
250250 let partial_ord = quote ! {
251- fn __discriminant( __this: & Test ) -> isize {
251+ const fn __discriminant( __this: & Test ) -> isize {
252252 match __this {
253253 Test :: A => 0 ,
254254 Test :: B => 3 ,
@@ -299,7 +299,7 @@ fn default_expr() -> Result<()> {
299299 } ;
300300 #[ cfg( not( feature = "nightly" ) ) ]
301301 let partial_ord = quote ! {
302- fn __discriminant( __this: & Test ) -> isize {
302+ const fn __discriminant( __this: & Test ) -> isize {
303303 match __this {
304304 Test :: A => isize :: MAX - 2 ,
305305 Test :: B => ( isize :: MAX - 2 ) + 1 ,
@@ -349,7 +349,7 @@ fn repr_c() -> Result<()> {
349349 #[ repr( C ) ]
350350 enum EnsureReprCIsIsize { Test = 0_isize }
351351
352- fn __discriminant( __this: & Test ) -> isize {
352+ const fn __discriminant( __this: & Test ) -> isize {
353353 match __this {
354354 Test :: A => 0 ,
355355 Test :: B => ( 0 ) + 1 ,
@@ -397,7 +397,7 @@ fn repr_c_without_discriminant() -> Result<()> {
397397 } ;
398398 #[ cfg( not( feature = "nightly" ) ) ]
399399 let partial_ord = quote ! {
400- fn __discriminant( __this: & Test ) -> isize {
400+ const fn __discriminant( __this: & Test ) -> isize {
401401 match __this {
402402 Test :: A => 0 ,
403403 Test :: B => 1 ,
@@ -640,7 +640,7 @@ fn repr_c_reverse() -> Result<()> {
640640 #[ repr( C ) ]
641641 enum EnsureReprCIsIsize { Test = 0_isize }
642642
643- fn __discriminant( __this: & Test ) -> isize {
643+ const fn __discriminant( __this: & Test ) -> isize {
644644 match __this {
645645 Test :: A => 2 ,
646646 Test :: B => 1 ,
@@ -691,7 +691,7 @@ fn repr_c_mix() -> Result<()> {
691691 #[ repr( C ) ]
692692 enum EnsureReprCIsIsize { Test = 0_isize }
693693
694- fn __discriminant( __this: & Test ) -> isize {
694+ const fn __discriminant( __this: & Test ) -> isize {
695695 match __this {
696696 Test :: A => 1 ,
697697 Test :: B => 0 ,
@@ -744,7 +744,7 @@ fn repr_c_skip() -> Result<()> {
744744 #[ repr( C ) ]
745745 enum EnsureReprCIsIsize { Test = 0_isize }
746746
747- fn __discriminant( __this: & Test ) -> isize {
747+ const fn __discriminant( __this: & Test ) -> isize {
748748 match __this {
749749 Test :: A => 0 ,
750750 Test :: B => 3 ,
@@ -799,7 +799,7 @@ fn repr_c_expr() -> Result<()> {
799799 #[ repr( C ) ]
800800 enum EnsureReprCIsIsize { Test = 0_isize }
801801
802- fn __discriminant( __this: & Test ) -> isize {
802+ const fn __discriminant( __this: & Test ) -> isize {
803803 match __this {
804804 Test :: A => u64 :: MAX - 2 ,
805805 Test :: B => ( u64 :: MAX - 2 ) + 1 ,
@@ -861,7 +861,7 @@ fn repr_c_with_value() -> Result<()> {
861861 } ;
862862 #[ cfg( all( not( feature = "nightly" ) , feature = "safe" ) ) ]
863863 let partial_ord = quote ! {
864- fn __discriminant<T >( __this: & Test <T >) -> u8 {
864+ const fn __discriminant<T >( __this: & Test <T >) -> u8 {
865865 match __this {
866866 Test :: A ( ref __field_0) => 0 ,
867867 Test :: B => ( 0 ) + 1 ,
@@ -931,7 +931,7 @@ fn repr_c_with_value_reverse() -> Result<()> {
931931 } ;
932932 #[ cfg( all( not( feature = "nightly" ) , feature = "safe" ) ) ]
933933 let partial_ord = quote ! {
934- fn __discriminant<T >( __this: & Test <T >) -> u8 {
934+ const fn __discriminant<T >( __this: & Test <T >) -> u8 {
935935 match __this {
936936 Test :: A ( ref __field_0) => 2 ,
937937 Test :: B => 1 ,
@@ -1001,7 +1001,7 @@ fn repr_c_with_value_mix() -> Result<()> {
10011001 } ;
10021002 #[ cfg( all( not( feature = "nightly" ) , feature = "safe" ) ) ]
10031003 let partial_ord = quote ! {
1004- fn __discriminant<T >( __this: & Test <T >) -> u8 {
1004+ const fn __discriminant<T >( __this: & Test <T >) -> u8 {
10051005 match __this {
10061006 Test :: A ( ref __field_0) => 1 ,
10071007 Test :: B => 0 ,
@@ -1071,7 +1071,7 @@ fn repr_c_with_value_skip() -> Result<()> {
10711071 } ;
10721072 #[ cfg( all( not( feature = "nightly" ) , feature = "safe" ) ) ]
10731073 let partial_ord = quote ! {
1074- fn __discriminant<T >( __this: & Test <T >) -> u8 {
1074+ const fn __discriminant<T >( __this: & Test <T >) -> u8 {
10751075 match __this {
10761076 Test :: A ( ref __field_0) => 0 ,
10771077 Test :: B => 3 ,
@@ -1143,7 +1143,7 @@ fn repr_c_with_value_expr() -> Result<()> {
11431143 } ;
11441144 #[ cfg( all( not( feature = "nightly" ) , feature = "safe" ) ) ]
11451145 let partial_ord = quote ! {
1146- fn __discriminant<T >( __this: & Test <T >) -> u8 {
1146+ const fn __discriminant<T >( __this: & Test <T >) -> u8 {
11471147 match __this {
11481148 Test :: A ( ref __field_0) => isize :: MAX - 2 ,
11491149 Test :: B => ( isize :: MAX - 2 ) + 1 ,
@@ -1206,7 +1206,7 @@ fn repr() -> Result<()> {
12061206 } ;
12071207 #[ cfg( all( not( feature = "nightly" ) , feature = "safe" ) ) ]
12081208 let partial_ord = quote ! {
1209- fn __discriminant( __this: & Test ) -> u64 {
1209+ const fn __discriminant( __this: & Test ) -> u64 {
12101210 match __this {
12111211 Test :: A => 0 ,
12121212 Test :: B => ( 0 ) + 1 ,
@@ -1354,7 +1354,7 @@ fn repr_reverse() -> Result<()> {
13541354 } ;
13551355 #[ cfg( all( not( feature = "nightly" ) , feature = "safe" ) ) ]
13561356 let partial_ord = quote ! {
1357- fn __discriminant( __this: & Test ) -> u64 {
1357+ const fn __discriminant( __this: & Test ) -> u64 {
13581358 match __this {
13591359 Test :: A => 2 ,
13601360 Test :: B => 1 ,
@@ -1409,7 +1409,7 @@ fn repr_mix() -> Result<()> {
14091409 } ;
14101410 #[ cfg( all( not( feature = "nightly" ) , feature = "safe" ) ) ]
14111411 let partial_ord = quote ! {
1412- fn __discriminant( __this: & Test ) -> u64 {
1412+ const fn __discriminant( __this: & Test ) -> u64 {
14131413 match __this {
14141414 Test :: A => 1 ,
14151415 Test :: B => 0 ,
@@ -1466,7 +1466,7 @@ fn repr_skip() -> Result<()> {
14661466 } ;
14671467 #[ cfg( all( not( feature = "nightly" ) , feature = "safe" ) ) ]
14681468 let partial_ord = quote ! {
1469- fn __discriminant( __this: & Test ) -> u64 {
1469+ const fn __discriminant( __this: & Test ) -> u64 {
14701470 match __this {
14711471 Test :: A => 0 ,
14721472 Test :: B => 3 ,
@@ -1525,7 +1525,7 @@ fn repr_expr() -> Result<()> {
15251525 } ;
15261526 #[ cfg( all( not( feature = "nightly" ) , feature = "safe" ) ) ]
15271527 let partial_ord = quote ! {
1528- fn __discriminant( __this: & Test ) -> u64 {
1528+ const fn __discriminant( __this: & Test ) -> u64 {
15291529 match __this {
15301530 Test :: A => u64 :: MAX - 2 ,
15311531 Test :: B => ( u64 :: MAX - 2 ) + 1 ,
@@ -1587,7 +1587,7 @@ fn repr_with_value() -> Result<()> {
15871587 } ;
15881588 #[ cfg( all( not( feature = "nightly" ) , feature = "safe" ) ) ]
15891589 let partial_ord = quote ! {
1590- fn __discriminant<T >( __this: & Test <T >) -> u8 {
1590+ const fn __discriminant<T >( __this: & Test <T >) -> u8 {
15911591 match __this {
15921592 Test :: A ( ref __field_0) => 0 ,
15931593 Test :: B => ( 0 ) + 1 ,
@@ -1657,7 +1657,7 @@ fn repr_with_value_reverse() -> Result<()> {
16571657 } ;
16581658 #[ cfg( all( not( feature = "nightly" ) , feature = "safe" ) ) ]
16591659 let partial_ord = quote ! {
1660- fn __discriminant<T >( __this: & Test <T >) -> u8 {
1660+ const fn __discriminant<T >( __this: & Test <T >) -> u8 {
16611661 match __this {
16621662 Test :: A ( ref __field_0) => 2 ,
16631663 Test :: B => 1 ,
@@ -1727,7 +1727,7 @@ fn repr_with_value_mix() -> Result<()> {
17271727 } ;
17281728 #[ cfg( all( not( feature = "nightly" ) , feature = "safe" ) ) ]
17291729 let partial_ord = quote ! {
1730- fn __discriminant<T >( __this: & Test <T >) -> u8 {
1730+ const fn __discriminant<T >( __this: & Test <T >) -> u8 {
17311731 match __this {
17321732 Test :: A ( ref __field_0) => 1 ,
17331733 Test :: B => 0 ,
@@ -1797,7 +1797,7 @@ fn repr_with_value_skip() -> Result<()> {
17971797 } ;
17981798 #[ cfg( all( not( feature = "nightly" ) , feature = "safe" ) ) ]
17991799 let partial_ord = quote ! {
1800- fn __discriminant<T >( __this: & Test <T >) -> u8 {
1800+ const fn __discriminant<T >( __this: & Test <T >) -> u8 {
18011801 match __this {
18021802 Test :: A ( ref __field_0) => 0 ,
18031803 Test :: B => 3 ,
@@ -1869,7 +1869,7 @@ fn repr_with_value_expr() -> Result<()> {
18691869 } ;
18701870 #[ cfg( all( not( feature = "nightly" ) , feature = "safe" ) ) ]
18711871 let partial_ord = quote ! {
1872- fn __discriminant<T >( __this: & Test <T >) -> u8 {
1872+ const fn __discriminant<T >( __this: & Test <T >) -> u8 {
18731873 match __this {
18741874 Test :: A ( ref __field_0) => isize :: MAX - 2 ,
18751875 Test :: B => ( isize :: MAX - 2 ) + 1 ,
0 commit comments