@@ -102,18 +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" ) ]
115+ #[ stable( feature = "num_midpoint" , since = "CURRENT_RUSTC_VERSION" ) ]
116+ #[ rustc_const_stable( feature = "num_midpoint" , since = "CURRENT_RUSTC_VERSION" ) ]
117117 #[ must_use = "this returns the result of the operation, \
118118 without modifying the original"]
119119 #[ inline]
@@ -133,14 +133,14 @@ macro_rules! midpoint_impl {
133133 /// # Examples
134134 ///
135135 /// ```
136- /// #![feature(num_midpoint )]
136+ /// #![feature(num_midpoint_signed )]
137137 #[ doc = concat!( "assert_eq!(0" , stringify!( $SelfT) , ".midpoint(4), 2);" ) ]
138138 #[ doc = concat!( "assert_eq!((-1" , stringify!( $SelfT) , ").midpoint(2), 0);" ) ]
139139 #[ doc = concat!( "assert_eq!((-7" , stringify!( $SelfT) , ").midpoint(0), -3);" ) ]
140140 #[ doc = concat!( "assert_eq!(0" , stringify!( $SelfT) , ".midpoint(-7), -3);" ) ]
141141 #[ doc = concat!( "assert_eq!(0" , stringify!( $SelfT) , ".midpoint(7), 3);" ) ]
142142 /// ```
143- #[ unstable( feature = "num_midpoint " , issue = "110840" ) ]
143+ #[ unstable( feature = "num_midpoint_signed " , issue = "110840" ) ]
144144 #[ must_use = "this returns the result of the operation, \
145145 without modifying the original"]
146146 #[ inline]
@@ -156,18 +156,18 @@ macro_rules! midpoint_impl {
156156 ( $SelfT: ty, $WideT: ty, unsigned) => {
157157 /// Calculates the middle point of `self` and `rhs`.
158158 ///
159- /// `midpoint(a, b)` is `(a + b) >> 1 ` as if it were performed in a
160- /// sufficiently-large signed integral type. This implies that the result is
161- /// always rounded towards negative infinity and that no overflow will ever occur.
159+ /// `midpoint(a, b)` is `(a + b) / 2 ` as if it were performed in a
160+ /// sufficiently-large unsigned integral type. This implies that the result is
161+ /// always rounded towards zero and that no overflow will ever occur.
162162 ///
163163 /// # Examples
164164 ///
165165 /// ```
166- /// #![feature(num_midpoint)]
167166 #[ doc = concat!( "assert_eq!(0" , stringify!( $SelfT) , ".midpoint(4), 2);" ) ]
168167 #[ doc = concat!( "assert_eq!(1" , stringify!( $SelfT) , ".midpoint(4), 2);" ) ]
169168 /// ```
170- #[ unstable( feature = "num_midpoint" , issue = "110840" ) ]
169+ #[ stable( feature = "num_midpoint" , since = "CURRENT_RUSTC_VERSION" ) ]
170+ #[ rustc_const_stable( feature = "num_midpoint" , since = "CURRENT_RUSTC_VERSION" ) ]
171171 #[ must_use = "this returns the result of the operation, \
172172 without modifying the original"]
173173 #[ inline]
@@ -185,14 +185,14 @@ macro_rules! midpoint_impl {
185185 /// # Examples
186186 ///
187187 /// ```
188- /// #![feature(num_midpoint )]
188+ /// #![feature(num_midpoint_signed )]
189189 #[ doc = concat!( "assert_eq!(0" , stringify!( $SelfT) , ".midpoint(4), 2);" ) ]
190190 #[ doc = concat!( "assert_eq!((-1" , stringify!( $SelfT) , ").midpoint(2), 0);" ) ]
191191 #[ doc = concat!( "assert_eq!((-7" , stringify!( $SelfT) , ").midpoint(0), -3);" ) ]
192192 #[ doc = concat!( "assert_eq!(0" , stringify!( $SelfT) , ".midpoint(-7), -3);" ) ]
193193 #[ doc = concat!( "assert_eq!(0" , stringify!( $SelfT) , ".midpoint(7), 3);" ) ]
194194 /// ```
195- #[ unstable( feature = "num_midpoint " , issue = "110840" ) ]
195+ #[ unstable( feature = "num_midpoint_signed " , issue = "110840" ) ]
196196 #[ must_use = "this returns the result of the operation, \
197197 without modifying the original"]
198198 #[ inline]
0 commit comments