diff options
| author | bors <bors@rust-lang.org> | 2018-11-29 12:23:05 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-11-29 12:23:05 +0000 |
| commit | 0c1dc62c1ec3c23dcb5e90500a2b3b25817ad03a (patch) | |
| tree | 9eff411fcec26978368a52f56a1146e918b2694a /src/libstd | |
| parent | 147e60c5f89cfa2d3ffc247413956a37582c98e7 (diff) | |
| parent | 3b64f86beb82b78496a5d5fe3c43944ef7ebd95d (diff) | |
| download | rust-0c1dc62c1ec3c23dcb5e90500a2b3b25817ad03a.tar.gz rust-0c1dc62c1ec3c23dcb5e90500a2b3b25817ad03a.zip | |
Auto merge of #56340 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 22 pull requests Successful merges: - #55391 (bootstrap: clean up a few clippy findings) - #56021 (avoid features_untracked) - #56023 (atomic::Ordering: Get rid of misleading parts of intro) - #56080 (Reduce the amount of bold text at doc.rlo) - #56114 (Enclose type in backticks for "non-exhaustive patterns" error) - #56124 (Fix small doc mistake on std::io::read::read_to_end) - #56127 (Update an outdated comment in mir building) - #56148 (Add rustc-guide as a submodule) - #56149 (Make std::os::unix/linux::fs::MetadataExt::a/m/ctime* documentation clearer) - #56220 (Suggest appropriate place for lifetime when declared after type arguments) - #56223 (Make JSON output from -Zprofile-json valid) - #56236 (Remove unsafe `unsafe` inner function.) - #56255 (Update outdated code comments in StringReader) - #56257 (rustc-guide has moved to rust-lang/) - #56273 (Add missing doc link) - #56289 (Fix small typo in comment of thread::stack_size) - #56294 (Fix a typo in the documentation of std::ffi) - #56312 (Deduplicate literal -> constant lowering) - #56319 (fix futures creating aliasing mutable and shared ref) - #56321 (rustdoc: add bottom margin spacing to nested lists) - #56322 (resolve: Fix false-positives from lint `absolute_paths_not_starting_with_crate`) - #56330 (Clean up span in non-trailing `..` suggestion) Failed merges: r? @ghost
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/ffi/mod.rs | 4 | ||||
| -rw-r--r-- | src/libstd/future.rs | 4 | ||||
| -rw-r--r-- | src/libstd/io/mod.rs | 2 | ||||
| -rw-r--r-- | src/libstd/os/linux/fs.rs | 18 | ||||
| -rw-r--r-- | src/libstd/sys/unix/ext/fs.rs | 18 | ||||
| -rw-r--r-- | src/libstd/thread/mod.rs | 2 |
6 files changed, 30 insertions, 18 deletions
diff --git a/src/libstd/ffi/mod.rs b/src/libstd/ffi/mod.rs index a3345df5e0d..f1f3742996b 100644 --- a/src/libstd/ffi/mod.rs +++ b/src/libstd/ffi/mod.rs @@ -112,12 +112,12 @@ //! ## On Unix //! //! On Unix, [`OsStr`] implements the -//! `std::os::unix:ffi::`[`OsStrExt`][unix.OsStrExt] trait, which +//! `std::os::unix::ffi::`[`OsStrExt`][unix.OsStrExt] trait, which //! augments it with two methods, [`from_bytes`] and [`as_bytes`]. //! These do inexpensive conversions from and to UTF-8 byte slices. //! //! Additionally, on Unix [`OsString`] implements the -//! `std::os::unix:ffi::`[`OsStringExt`][unix.OsStringExt] trait, +//! `std::os::unix::ffi::`[`OsStringExt`][unix.OsStringExt] trait, //! which provides [`from_vec`] and [`into_vec`] methods that consume //! their arguments, and take or produce vectors of [`u8`]. //! diff --git a/src/libstd/future.rs b/src/libstd/future.rs index 1cadbdc66c3..d5e6cab948b 100644 --- a/src/libstd/future.rs +++ b/src/libstd/future.rs @@ -95,10 +95,10 @@ where }); let _reset_waker = SetOnDrop(waker_ptr); - let mut waker_ptr = waker_ptr.expect( + let waker_ptr = waker_ptr.expect( "TLS LocalWaker not set. This is a rustc bug. \ Please file an issue on https://github.com/rust-lang/rust."); - unsafe { f(waker_ptr.as_mut()) } + unsafe { f(waker_ptr.as_ref()) } } #[unstable(feature = "gen_future", issue = "50547")] diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index e263db24fc2..076524e624a 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -431,7 +431,7 @@ fn read_to_end_with_reservation<R: Read + ?Sized>(r: &mut R, /// // read up to 10 bytes /// f.read(&mut buffer)?; /// -/// let mut buffer = vec![0; 10]; +/// let mut buffer = Vec::new(); /// // read the whole file /// f.read_to_end(&mut buffer)?; /// diff --git a/src/libstd/os/linux/fs.rs b/src/libstd/os/linux/fs.rs index 76fb10da850..b518f524e0b 100644 --- a/src/libstd/os/linux/fs.rs +++ b/src/libstd/os/linux/fs.rs @@ -191,7 +191,7 @@ pub trait MetadataExt { /// ``` #[stable(feature = "metadata_ext2", since = "1.8.0")] fn st_size(&self) -> u64; - /// Returns the last access time. + /// Returns the last access time of the file, in seconds since Unix Epoch. /// /// # Examples /// @@ -208,7 +208,9 @@ pub trait MetadataExt { /// ``` #[stable(feature = "metadata_ext2", since = "1.8.0")] fn st_atime(&self) -> i64; - /// Returns the last access time, nano seconds part. + /// Returns the last access time of the file, in nanoseconds since [`st_atime`]. + /// + /// [`st_atime`]: #tymethod.st_atime /// /// # Examples /// @@ -225,7 +227,7 @@ pub trait MetadataExt { /// ``` #[stable(feature = "metadata_ext2", since = "1.8.0")] fn st_atime_nsec(&self) -> i64; - /// Returns the last modification time. + /// Returns the last modification time of the file, in seconds since Unix Epoch. /// /// # Examples /// @@ -242,7 +244,9 @@ pub trait MetadataExt { /// ``` #[stable(feature = "metadata_ext2", since = "1.8.0")] fn st_mtime(&self) -> i64; - /// Returns the last modification time, nano seconds part. + /// Returns the last modification time of the file, in nanoseconds since [`st_mtime`]. + /// + /// [`st_mtime`]: #tymethod.st_mtime /// /// # Examples /// @@ -259,7 +263,7 @@ pub trait MetadataExt { /// ``` #[stable(feature = "metadata_ext2", since = "1.8.0")] fn st_mtime_nsec(&self) -> i64; - /// Returns the last status change time. + /// Returns the last status change time of the file, in seconds since Unix Epoch. /// /// # Examples /// @@ -276,7 +280,9 @@ pub trait MetadataExt { /// ``` #[stable(feature = "metadata_ext2", since = "1.8.0")] fn st_ctime(&self) -> i64; - /// Returns the last status change time, nano seconds part. + /// Returns the last status change time of the file, in nanoseconds since [`st_ctime`]. + /// + /// [`st_ctime`]: #tymethod.st_ctime /// /// # Examples /// diff --git a/src/libstd/sys/unix/ext/fs.rs b/src/libstd/sys/unix/ext/fs.rs index 507e9d88171..7e65bbdef2a 100644 --- a/src/libstd/sys/unix/ext/fs.rs +++ b/src/libstd/sys/unix/ext/fs.rs @@ -522,7 +522,7 @@ pub trait MetadataExt { /// ``` #[stable(feature = "metadata_ext", since = "1.1.0")] fn size(&self) -> u64; - /// Returns the time of the last access to the file. + /// Returns the last access time of the file, in seconds since Unix Epoch. /// /// # Examples /// @@ -539,7 +539,9 @@ pub trait MetadataExt { /// ``` #[stable(feature = "metadata_ext", since = "1.1.0")] fn atime(&self) -> i64; - /// Returns the time of the last access to the file in nanoseconds. + /// Returns the last access time of the file, in nanoseconds since [`atime`]. + /// + /// [`atime`]: #tymethod.atime /// /// # Examples /// @@ -556,7 +558,7 @@ pub trait MetadataExt { /// ``` #[stable(feature = "metadata_ext", since = "1.1.0")] fn atime_nsec(&self) -> i64; - /// Returns the time of the last modification of the file. + /// Returns the last modification time of the file, in seconds since Unix Epoch. /// /// # Examples /// @@ -573,7 +575,9 @@ pub trait MetadataExt { /// ``` #[stable(feature = "metadata_ext", since = "1.1.0")] fn mtime(&self) -> i64; - /// Returns the time of the last modification of the file in nanoseconds. + /// Returns the last modification time of the file, in nanoseconds since [`mtime`]. + /// + /// [`mtime`]: #tymethod.mtime /// /// # Examples /// @@ -590,7 +594,7 @@ pub trait MetadataExt { /// ``` #[stable(feature = "metadata_ext", since = "1.1.0")] fn mtime_nsec(&self) -> i64; - /// Returns the time of the last status change of the file. + /// Returns the last status change time of the file, in seconds since Unix Epoch. /// /// # Examples /// @@ -607,7 +611,9 @@ pub trait MetadataExt { /// ``` #[stable(feature = "metadata_ext", since = "1.1.0")] fn ctime(&self) -> i64; - /// Returns the time of the last status change of the file in nanoseconds. + /// Returns the last status change time of the file, in nanoseconds since [`ctime`]. + /// + /// [`ctime`]: #tymethod.ctime /// /// # Examples /// diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs index 8a845efd413..3a9f3ec5c6f 100644 --- a/src/libstd/thread/mod.rs +++ b/src/libstd/thread/mod.rs @@ -326,7 +326,7 @@ impl Builder { /// Sets the size of the stack (in bytes) for the new thread. /// /// The actual stack size may be greater than this value if - /// the platform specifies minimal stack size. + /// the platform specifies a minimal stack size. /// /// For more information about the stack size for threads, see /// [this module-level documentation][stack-size]. |
