Skip to content

Commit 1e44fee

Browse files
committed
Auto merge of #46130 - kennytm:rollup, r=kennytm
Rollup of 9 pull requests - Successful merges: #46082, #46088, #46092, #46107, #46119, #46121, #46122, #46124, #46128 - Failed merges:
2 parents 33374fa + 079a6e4 commit 1e44fee

File tree

21 files changed

+114
-49
lines changed

21 files changed

+114
-49
lines changed

src/liballoc/arc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1328,7 +1328,7 @@ impl<T: ?Sized + fmt::Debug> fmt::Debug for Arc<T> {
13281328
#[stable(feature = "rust1", since = "1.0.0")]
13291329
impl<T: ?Sized> fmt::Pointer for Arc<T> {
13301330
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1331-
fmt::Pointer::fmt(&self.ptr, f)
1331+
fmt::Pointer::fmt(&(&**self as *const T), f)
13321332
}
13331333
}
13341334

src/liballoc/fmt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
//! Utilities for formatting and printing `String`s
11+
//! Utilities for formatting and printing `String`s.
1212
//!
1313
//! This module contains the runtime support for the [`format!`] syntax extension.
1414
//! This macro is implemented in the compiler to emit calls to this module in

src/liballoc/rc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1072,7 +1072,7 @@ impl<T: ?Sized + fmt::Debug> fmt::Debug for Rc<T> {
10721072
#[stable(feature = "rust1", since = "1.0.0")]
10731073
impl<T: ?Sized> fmt::Pointer for Rc<T> {
10741074
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1075-
fmt::Pointer::fmt(&self.ptr, f)
1075+
fmt::Pointer::fmt(&(&**self as *const T), f)
10761076
}
10771077
}
10781078

src/liballoc/str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1734,7 +1734,7 @@ impl str {
17341734
/// A more complex pattern, using a closure:
17351735
///
17361736
/// ```
1737-
/// assert_eq!("1fooX".trim_left_matches(|c| c == '1' || c == 'X'), "fooX");
1737+
/// assert_eq!("1fooX".trim_right_matches(|c| c == '1' || c == 'X'), "1foo");
17381738
/// ```
17391739
#[stable(feature = "rust1", since = "1.0.0")]
17401740
pub fn trim_right_matches<'a, P: Pattern<'a>>(&'a self, pat: P) -> &'a str

src/libcore/macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ macro_rules! try {
361361
})
362362
}
363363

364-
/// Write formatted data into a buffer
364+
/// Write formatted data into a buffer.
365365
///
366366
/// This macro accepts a format string, a list of arguments, and a 'writer'. Arguments will be
367367
/// formatted according to the specified format string and the result will be passed to the writer.

src/librustc_mir/borrow_check.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ fn do_mir_borrowck<'a, 'gcx, 'tcx>(infcx: &InferCtxt<'a, 'gcx, 'tcx>,
9191
IllegalMoveOriginKind::Static =>
9292
tcx.cannot_move_out_of(span, "static item", origin),
9393
IllegalMoveOriginKind::BorrowedContent =>
94-
tcx.cannot_move_out_of(span, "borrowed_content", origin),
94+
tcx.cannot_move_out_of(span, "borrowed content", origin),
9595
IllegalMoveOriginKind::InteriorOfTypeWithDestructor { container_ty: ty } =>
9696
tcx.cannot_move_out_of_interior_of_drop(span, ty, origin),
9797
IllegalMoveOriginKind::InteriorOfSliceOrArray { ty, is_index } =>

src/libstd/f32.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
// except according to those terms.
1010

1111
//! This module provides constants which are specific to the implementation
12-
//! of the `f32` floating point data type. Mathematically significant
13-
//! numbers are provided in the `consts` sub-module.
12+
//! of the `f32` floating point data type.
13+
//!
14+
//! Mathematically significant numbers are provided in the `consts` sub-module.
1415
//!
1516
//! *[See also the `f32` primitive type](../primitive.f32.html).*
1617

src/libstd/f64.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
// except according to those terms.
1010

1111
//! This module provides constants which are specific to the implementation
12-
//! of the `f64` floating point data type. Mathematically significant
13-
//! numbers are provided in the `consts` sub-module.
12+
//! of the `f64` floating point data type.
13+
//!
14+
//! Mathematically significant numbers are provided in the `consts` sub-module.
1415
//!
1516
//! *[See also the `f64` primitive type](../primitive.f64.html).*
1617

src/libstd/io/mod.rs

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -419,14 +419,8 @@ fn read_to_end<R: Read + ?Sized>(r: &mut R, buf: &mut Vec<u8>) -> Result<usize>
419419
///
420420
/// [`File`]s implement `Read`:
421421
///
422-
/// [`read()`]: trait.Read.html#tymethod.read
423-
/// [`std::io`]: ../../std/io/index.html
424-
/// [`File`]: ../fs/struct.File.html
425-
/// [`BufRead`]: trait.BufRead.html
426-
/// [`BufReader`]: struct.BufReader.html
427-
///
428422
/// ```
429-
/// use std::io;
423+
/// # use std::io;
430424
/// use std::io::prelude::*;
431425
/// use std::fs::File;
432426
///
@@ -449,6 +443,32 @@ fn read_to_end<R: Read + ?Sized>(r: &mut R, buf: &mut Vec<u8>) -> Result<usize>
449443
/// # Ok(())
450444
/// # }
451445
/// ```
446+
///
447+
/// Read from `&str` because [`&[u8]`] implements [`Read`]:
448+
///
449+
/// ```
450+
/// # use std::io;
451+
/// use std::io::prelude::*;
452+
///
453+
/// # fn foo() -> io::Result<()> {
454+
/// let mut b = "This string will be read".as_bytes();
455+
/// let mut buffer = [0; 10];
456+
///
457+
/// // read up to 10 bytes
458+
/// b.read(&mut buffer)?;
459+
///
460+
/// // etc... it works exactly as a File does!
461+
/// # Ok(())
462+
/// # }
463+
/// ```
464+
///
465+
/// [`read()`]: trait.Read.html#tymethod.read
466+
/// [`std::io`]: ../../std/io/index.html
467+
/// [`File`]: ../fs/struct.File.html
468+
/// [`BufRead`]: trait.BufRead.html
469+
/// [`BufReader`]: struct.BufReader.html
470+
/// [`&[u8]`]: primitive.slice.html
471+
///
452472
#[stable(feature = "rust1", since = "1.0.0")]
453473
pub trait Read {
454474
/// Pull some bytes from this source into the specified buffer, returning

src/libstd/panic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
//! Panic support in the standard library
11+
//! Panic support in the standard library.
1212
1313
#![stable(feature = "std_panic", since = "1.9.0")]
1414

0 commit comments

Comments
 (0)