@@ -103,18 +103,18 @@ macro_rules! midpoint_impl {
103103 ( $SelfT: ty, unsigned) => {
104104 /// Calculates the middle point of `self` and `rhs`.
105105 ///
106- /// `midpoint(a, b)` is `(a + b) >> 1 ` as if it were performed in a
107- /// sufficiently-large signed integral type. This implies that the result is
108- /// always rounded towards negative infinity and that no overflow will ever occur.
106+ /// `midpoint(a, b)` is `(a + b) / 2 ` as if it were performed in a
107+ /// sufficiently-large unsigned integral type. This implies that the result is
108+ /// always rounded towards zero and that no overflow will ever occur.
109109 ///
110110 /// # Examples
111111 ///
112112 /// ```
113- /// #![feature(num_midpoint)]
114113 #[ doc = concat!( "assert_eq!(0" , stringify!( $SelfT) , ".midpoint(4), 2);" ) ]
115114 #[ doc = concat!( "assert_eq!(1" , stringify!( $SelfT) , ".midpoint(4), 2);" ) ]
116115 /// ```
117- #[ unstable( feature = "num_midpoint" , issue = "110840" ) ]
116+ #[ stable( feature = "num_midpoint" , since = "CURRENT_RUSTC_VERSION" ) ]
117+ #[ rustc_const_stable( feature = "num_midpoint" , since = "CURRENT_RUSTC_VERSION" ) ]
118118 #[ must_use = "this returns the result of the operation, \
119119 without modifying the original"]
120120 #[ inline]
@@ -134,14 +134,14 @@ macro_rules! midpoint_impl {
134134 /// # Examples
135135 ///
136136 /// ```
137- /// #![feature(num_midpoint )]
137+ /// #![feature(num_midpoint_signed )]
138138 #[ doc = concat!( "assert_eq!(0" , stringify!( $SelfT) , ".midpoint(4), 2);" ) ]
139139 #[ doc = concat!( "assert_eq!((-1" , stringify!( $SelfT) , ").midpoint(2), 0);" ) ]
140140 #[ doc = concat!( "assert_eq!((-7" , stringify!( $SelfT) , ").midpoint(0), -3);" ) ]
141141 #[ doc = concat!( "assert_eq!(0" , stringify!( $SelfT) , ".midpoint(-7), -3);" ) ]
142142 #[ doc = concat!( "assert_eq!(0" , stringify!( $SelfT) , ".midpoint(7), 3);" ) ]
143143 /// ```
144- #[ unstable( feature = "num_midpoint " , issue = "110840" ) ]
144+ #[ unstable( feature = "num_midpoint_signed " , issue = "110840" ) ]
145145 #[ must_use = "this returns the result of the operation, \
146146 without modifying the original"]
147147 #[ inline]
@@ -157,18 +157,18 @@ macro_rules! midpoint_impl {
157157 ( $SelfT: ty, $WideT: ty, unsigned) => {
158158 /// Calculates the middle point of `self` and `rhs`.
159159 ///
160- /// `midpoint(a, b)` is `(a + b) >> 1 ` as if it were performed in a
161- /// sufficiently-large signed integral type. This implies that the result is
162- /// 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.
163163 ///
164164 /// # Examples
165165 ///
166166 /// ```
167- /// #![feature(num_midpoint)]
168167 #[ doc = concat!( "assert_eq!(0" , stringify!( $SelfT) , ".midpoint(4), 2);" ) ]
169168 #[ doc = concat!( "assert_eq!(1" , stringify!( $SelfT) , ".midpoint(4), 2);" ) ]
170169 /// ```
171- #[ unstable( feature = "num_midpoint" , issue = "110840" ) ]
170+ #[ stable( feature = "num_midpoint" , since = "CURRENT_RUSTC_VERSION" ) ]
171+ #[ rustc_const_stable( feature = "num_midpoint" , since = "CURRENT_RUSTC_VERSION" ) ]
172172 #[ must_use = "this returns the result of the operation, \
173173 without modifying the original"]
174174 #[ inline]
@@ -186,14 +186,14 @@ macro_rules! midpoint_impl {
186186 /// # Examples
187187 ///
188188 /// ```
189- /// #![feature(num_midpoint )]
189+ /// #![feature(num_midpoint_signed )]
190190 #[ doc = concat!( "assert_eq!(0" , stringify!( $SelfT) , ".midpoint(4), 2);" ) ]
191191 #[ doc = concat!( "assert_eq!((-1" , stringify!( $SelfT) , ").midpoint(2), 0);" ) ]
192192 #[ doc = concat!( "assert_eq!((-7" , stringify!( $SelfT) , ").midpoint(0), -3);" ) ]
193193 #[ doc = concat!( "assert_eq!(0" , stringify!( $SelfT) , ".midpoint(-7), -3);" ) ]
194194 #[ doc = concat!( "assert_eq!(0" , stringify!( $SelfT) , ".midpoint(7), 3);" ) ]
195195 /// ```
196- #[ unstable( feature = "num_midpoint " , issue = "110840" ) ]
196+ #[ unstable( feature = "num_midpoint_signed " , issue = "110840" ) ]
197197 #[ must_use = "this returns the result of the operation, \
198198 without modifying the original"]
199199 #[ inline]
0 commit comments