@@ -102,19 +102,18 @@ macro_rules! midpoint_impl {
102
102
( $SelfT: ty, unsigned) => {
103
103
/// Calculates the middle point of `self` and `rhs`.
104
104
///
105
- /// `midpoint(a, b)` is `(a + b) >> 1 ` as if it were performed in a
106
- /// sufficiently-large signed integral type. This implies that the result is
107
- /// always rounded towards negative infinity and that no overflow will ever occur.
105
+ /// `midpoint(a, b)` is `(a + b) / 2 ` as if it were performed in a
106
+ /// sufficiently-large unsigned integral type. This implies that the result is
107
+ /// always rounded towards zero and that no overflow will ever occur.
108
108
///
109
109
/// # Examples
110
110
///
111
111
/// ```
112
- /// #![feature(num_midpoint)]
113
112
#[ doc = concat!( "assert_eq!(0" , stringify!( $SelfT) , ".midpoint(4), 2);" ) ]
114
113
#[ doc = concat!( "assert_eq!(1" , stringify!( $SelfT) , ".midpoint(4), 2);" ) ]
115
114
/// ```
116
- #[ unstable ( feature = "num_midpoint" , issue = "110840 " ) ]
117
- #[ rustc_const_unstable ( feature = "const_num_midpoint" , issue = "110840 " ) ]
115
+ #[ stable ( feature = "num_midpoint" , since = "CURRENT_RUSTC_VERSION " ) ]
116
+ #[ rustc_const_stable ( feature = "const_num_midpoint" , since = "CURRENT_RUSTC_VERSION " ) ]
118
117
#[ must_use = "this returns the result of the operation, \
119
118
without modifying the original"]
120
119
#[ inline]
@@ -134,15 +133,15 @@ macro_rules! midpoint_impl {
134
133
/// # Examples
135
134
///
136
135
/// ```
137
- /// #![feature(num_midpoint )]
136
+ /// #![feature(num_midpoint_signed )]
138
137
#[ doc = concat!( "assert_eq!(0" , stringify!( $SelfT) , ".midpoint(4), 2);" ) ]
139
138
#[ doc = concat!( "assert_eq!((-1" , stringify!( $SelfT) , ").midpoint(2), 0);" ) ]
140
139
#[ doc = concat!( "assert_eq!((-7" , stringify!( $SelfT) , ").midpoint(0), -3);" ) ]
141
140
#[ doc = concat!( "assert_eq!(0" , stringify!( $SelfT) , ".midpoint(-7), -3);" ) ]
142
141
#[ doc = concat!( "assert_eq!(0" , stringify!( $SelfT) , ".midpoint(7), 3);" ) ]
143
142
/// ```
144
- #[ unstable( feature = "num_midpoint " , issue = "110840" ) ]
145
- #[ rustc_const_unstable( feature = "const_num_midpoint " , issue = "110840" ) ]
143
+ #[ unstable( feature = "num_midpoint_signed " , issue = "110840" ) ]
144
+ #[ rustc_const_unstable( feature = "num_midpoint_signed " , issue = "110840" ) ]
146
145
#[ must_use = "this returns the result of the operation, \
147
146
without modifying the original"]
148
147
#[ inline]
@@ -158,19 +157,18 @@ macro_rules! midpoint_impl {
158
157
( $SelfT: ty, $WideT: ty, unsigned) => {
159
158
/// Calculates the middle point of `self` and `rhs`.
160
159
///
161
- /// `midpoint(a, b)` is `(a + b) >> 1 ` as if it were performed in a
162
- /// sufficiently-large signed integral type. This implies that the result is
163
- /// always rounded towards negative infinity and that no overflow will ever occur.
160
+ /// `midpoint(a, b)` is `(a + b) / 2 ` as if it were performed in a
161
+ /// sufficiently-large unsigned integral type. This implies that the result is
162
+ /// always rounded towards zero and that no overflow will ever occur.
164
163
///
165
164
/// # Examples
166
165
///
167
166
/// ```
168
- /// #![feature(num_midpoint)]
169
167
#[ doc = concat!( "assert_eq!(0" , stringify!( $SelfT) , ".midpoint(4), 2);" ) ]
170
168
#[ doc = concat!( "assert_eq!(1" , stringify!( $SelfT) , ".midpoint(4), 2);" ) ]
171
169
/// ```
172
- #[ unstable ( feature = "num_midpoint" , issue = "110840 " ) ]
173
- #[ rustc_const_unstable ( feature = "const_num_midpoint" , issue = "110840 " ) ]
170
+ #[ stable ( feature = "num_midpoint" , since = "CURRENT_RUSTC_VERSION " ) ]
171
+ #[ rustc_const_stable ( feature = "const_num_midpoint" , since = "CURRENT_RUSTC_VERSION " ) ]
174
172
#[ must_use = "this returns the result of the operation, \
175
173
without modifying the original"]
176
174
#[ inline]
@@ -188,15 +186,15 @@ macro_rules! midpoint_impl {
188
186
/// # Examples
189
187
///
190
188
/// ```
191
- /// #![feature(num_midpoint )]
189
+ /// #![feature(num_midpoint_signed )]
192
190
#[ doc = concat!( "assert_eq!(0" , stringify!( $SelfT) , ".midpoint(4), 2);" ) ]
193
191
#[ doc = concat!( "assert_eq!((-1" , stringify!( $SelfT) , ").midpoint(2), 0);" ) ]
194
192
#[ doc = concat!( "assert_eq!((-7" , stringify!( $SelfT) , ").midpoint(0), -3);" ) ]
195
193
#[ doc = concat!( "assert_eq!(0" , stringify!( $SelfT) , ".midpoint(-7), -3);" ) ]
196
194
#[ doc = concat!( "assert_eq!(0" , stringify!( $SelfT) , ".midpoint(7), 3);" ) ]
197
195
/// ```
198
- #[ unstable( feature = "num_midpoint " , issue = "110840" ) ]
199
- #[ rustc_const_unstable( feature = "const_num_midpoint " , issue = "110840" ) ]
196
+ #[ unstable( feature = "num_midpoint_signed " , issue = "110840" ) ]
197
+ #[ rustc_const_unstable( feature = "num_midpoint_signed " , issue = "110840" ) ]
200
198
#[ must_use = "this returns the result of the operation, \
201
199
without modifying the original"]
202
200
#[ inline]
0 commit comments