@@ -102,19 +102,18 @@ macro_rules! midpoint_impl {
102102 ( $SelfT: ty, unsigned) => {
103103 /// Calculates the middle point of `self` and `rhs`.
104104 ///
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.
108108 ///
109109 /// # Examples
110110 ///
111111 /// ```
112- /// #![feature(num_midpoint)]
113112 #[ doc = concat!( "assert_eq!(0" , stringify!( $SelfT) , ".midpoint(4), 2);" ) ]
114113 #[ doc = concat!( "assert_eq!(1" , stringify!( $SelfT) , ".midpoint(4), 2);" ) ]
115114 /// ```
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 " ) ]
118117 #[ must_use = "this returns the result of the operation, \
119118 without modifying the original"]
120119 #[ inline]
@@ -134,15 +133,15 @@ macro_rules! midpoint_impl {
134133 /// # Examples
135134 ///
136135 /// ```
137- /// #![feature(num_midpoint )]
136+ /// #![feature(num_midpoint_signed )]
138137 #[ doc = concat!( "assert_eq!(0" , stringify!( $SelfT) , ".midpoint(4), 2);" ) ]
139138 #[ doc = concat!( "assert_eq!((-1" , stringify!( $SelfT) , ").midpoint(2), 0);" ) ]
140139 #[ doc = concat!( "assert_eq!((-7" , stringify!( $SelfT) , ").midpoint(0), -3);" ) ]
141140 #[ doc = concat!( "assert_eq!(0" , stringify!( $SelfT) , ".midpoint(-7), -3);" ) ]
142141 #[ doc = concat!( "assert_eq!(0" , stringify!( $SelfT) , ".midpoint(7), 3);" ) ]
143142 /// ```
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" ) ]
146145 #[ must_use = "this returns the result of the operation, \
147146 without modifying the original"]
148147 #[ inline]
@@ -158,19 +157,18 @@ macro_rules! midpoint_impl {
158157 ( $SelfT: ty, $WideT: ty, unsigned) => {
159158 /// Calculates the middle point of `self` and `rhs`.
160159 ///
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.
164163 ///
165164 /// # Examples
166165 ///
167166 /// ```
168- /// #![feature(num_midpoint)]
169167 #[ doc = concat!( "assert_eq!(0" , stringify!( $SelfT) , ".midpoint(4), 2);" ) ]
170168 #[ doc = concat!( "assert_eq!(1" , stringify!( $SelfT) , ".midpoint(4), 2);" ) ]
171169 /// ```
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 " ) ]
174172 #[ must_use = "this returns the result of the operation, \
175173 without modifying the original"]
176174 #[ inline]
@@ -188,15 +186,15 @@ macro_rules! midpoint_impl {
188186 /// # Examples
189187 ///
190188 /// ```
191- /// #![feature(num_midpoint )]
189+ /// #![feature(num_midpoint_signed )]
192190 #[ doc = concat!( "assert_eq!(0" , stringify!( $SelfT) , ".midpoint(4), 2);" ) ]
193191 #[ doc = concat!( "assert_eq!((-1" , stringify!( $SelfT) , ").midpoint(2), 0);" ) ]
194192 #[ doc = concat!( "assert_eq!((-7" , stringify!( $SelfT) , ").midpoint(0), -3);" ) ]
195193 #[ doc = concat!( "assert_eq!(0" , stringify!( $SelfT) , ".midpoint(-7), -3);" ) ]
196194 #[ doc = concat!( "assert_eq!(0" , stringify!( $SelfT) , ".midpoint(7), 3);" ) ]
197195 /// ```
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" ) ]
200198 #[ must_use = "this returns the result of the operation, \
201199 without modifying the original"]
202200 #[ inline]
0 commit comments