Skip to content

Commit cbd7ed6

Browse files
committed
auto merge of #19468 : victorvde/rust/master, r=Gankro
1. Made small improvements to the docs for checked_sub, checked_mul and checked_div. 2. Updated a confusingly outdated comment for intrinsics, noticed before at <https://stackoverflow.com/questions/23582931/>.
2 parents 3a325c6 + d8c5269 commit cbd7ed6

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/libcore/intrinsics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
//! rustc compiler intrinsics.
1212
//!
13-
//! The corresponding definitions are in librustc/middle/trans/foreign.rs.
13+
//! The corresponding definitions are in librustc_trans/trans/intrinsic.rs.
1414
//!
1515
//! # Volatiles
1616
//!

src/libcore/num/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ pub trait Int
284284
/// ```
285285
fn checked_add(self, other: Self) -> Option<Self>;
286286

287-
/// Checked integer subtraction. Computes `self + other`, returning `None`
287+
/// Checked integer subtraction. Computes `self - other`, returning `None`
288288
/// if underflow occurred.
289289
///
290290
/// # Example
@@ -297,7 +297,7 @@ pub trait Int
297297
/// ```
298298
fn checked_sub(self, other: Self) -> Option<Self>;
299299

300-
/// Checked integer multiplication. Computes `self + other`, returning
300+
/// Checked integer multiplication. Computes `self * other`, returning
301301
/// `None` if underflow or overflow occurred.
302302
///
303303
/// # Example
@@ -310,8 +310,8 @@ pub trait Int
310310
/// ```
311311
fn checked_mul(self, other: Self) -> Option<Self>;
312312

313-
/// Checked integer division. Computes `self + other` returning `None` if
314-
/// `self == 0` or the operation results in underflow or overflow.
313+
/// Checked integer division. Computes `self / other`, returning `None` if
314+
/// `other == 0` or the operation results in underflow or overflow.
315315
///
316316
/// # Example
317317
///

0 commit comments

Comments
 (0)