diff options
| author | bors <bors@rust-lang.org> | 2017-07-12 17:04:14 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-07-12 17:04:14 +0000 |
| commit | f85579d4a2c342654f9b158fafd565eb159fdb59 (patch) | |
| tree | e0ab8d41914e967769ee6422ad434d85c9fbcc31 /src/libstd | |
| parent | b2b19ec92e233b7f91617e4cc2130e70d6e7a5fd (diff) | |
| parent | 388fce9dab429e2cc90588727ae07a4c878bd7b3 (diff) | |
| download | rust-f85579d4a2c342654f9b158fafd565eb159fdb59.tar.gz rust-f85579d4a2c342654f9b158fafd565eb159fdb59.zip | |
Auto merge of #43181 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
Rollup of 8 pull requests - Successful merges: #42670, #42826, #43000, #43011, #43098, #43100, #43136, #43137 - Failed merges:
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/error.rs | 2 | ||||
| -rw-r--r-- | src/libstd/io/buffered.rs | 6 | ||||
| -rw-r--r-- | src/libstd/macros.rs | 5 | ||||
| -rw-r--r-- | src/libstd/sync/mutex.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sync/rwlock.rs | 4 | ||||
| -rw-r--r-- | src/libstd/sys/redox/ext/fs.rs | 15 | ||||
| -rw-r--r-- | src/libstd/sys/redox/fs.rs | 4 |
7 files changed, 31 insertions, 7 deletions
diff --git a/src/libstd/error.rs b/src/libstd/error.rs index d77f817659c..d1c2bfb96b3 100644 --- a/src/libstd/error.rs +++ b/src/libstd/error.rs @@ -340,7 +340,7 @@ impl Error for char::CharTryFromError { } } -#[stable(feature = "char_from_str", since = "1.19.0")] +#[stable(feature = "char_from_str", since = "1.20.0")] impl Error for char::ParseCharError { fn description(&self) -> &str { self.__description() diff --git a/src/libstd/io/buffered.rs b/src/libstd/io/buffered.rs index 296ee78aadb..1b832453523 100644 --- a/src/libstd/io/buffered.rs +++ b/src/libstd/io/buffered.rs @@ -276,7 +276,10 @@ impl<R: Seek> Seek for BufReader<R> { /// `BufWriter` keeps an in-memory buffer of data and writes it to an underlying /// writer in large, infrequent batches. /// -/// The buffer will be written out when the writer is dropped. +/// When the `BufWriter` is dropped, the contents of its buffer will be written +/// out. However, any errors that happen in the process of flushing the buffer +/// when the writer is dropped will be ignored. Code that wishes to handle such +/// errors must manually call [`flush`] before the writer is dropped. /// /// # Examples /// @@ -316,6 +319,7 @@ impl<R: Seek> Seek for BufReader<R> { /// [`Write`]: ../../std/io/trait.Write.html /// [`Tcpstream::write`]: ../../std/net/struct.TcpStream.html#method.write /// [`TcpStream`]: ../../std/net/struct.TcpStream.html +/// [`flush`]: #method.flush #[stable(feature = "rust1", since = "1.0.0")] pub struct BufWriter<W: Write> { inner: Option<W>, diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs index 6eb9faacf7f..6ad22820a7d 100644 --- a/src/libstd/macros.rs +++ b/src/libstd/macros.rs @@ -24,6 +24,11 @@ /// The multi-argument form of this macro panics with a string and has the /// `format!` syntax for building a string. /// +/// # Current implementation +/// +/// If the main thread panics it will terminate all your threads and end your +/// program with code `101`. +/// /// # Examples /// /// ```should_panic diff --git a/src/libstd/sync/mutex.rs b/src/libstd/sync/mutex.rs index fc6c7de9ef0..62d8de18f4b 100644 --- a/src/libstd/sync/mutex.rs +++ b/src/libstd/sync/mutex.rs @@ -440,7 +440,7 @@ impl<'a, T: ?Sized + fmt::Debug> fmt::Debug for MutexGuard<'a, T> { } } -#[stable(feature = "std_guard_impls", since = "1.20")] +#[stable(feature = "std_guard_impls", since = "1.20.0")] impl<'a, T: ?Sized + fmt::Display> fmt::Display for MutexGuard<'a, T> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { (**self).fmt(f) diff --git a/src/libstd/sync/rwlock.rs b/src/libstd/sync/rwlock.rs index 944801e8a3b..5c5231f4e84 100644 --- a/src/libstd/sync/rwlock.rs +++ b/src/libstd/sync/rwlock.rs @@ -370,7 +370,7 @@ impl<'a, T: fmt::Debug> fmt::Debug for RwLockReadGuard<'a, T> { } } -#[stable(feature = "std_guard_impls", since = "1.20")] +#[stable(feature = "std_guard_impls", since = "1.20.0")] impl<'a, T: ?Sized + fmt::Display> fmt::Display for RwLockReadGuard<'a, T> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { (**self).fmt(f) @@ -386,7 +386,7 @@ impl<'a, T: fmt::Debug> fmt::Debug for RwLockWriteGuard<'a, T> { } } -#[stable(feature = "std_guard_impls", since = "1.20")] +#[stable(feature = "std_guard_impls", since = "1.20.0")] impl<'a, T: ?Sized + fmt::Display> fmt::Display for RwLockWriteGuard<'a, T> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { (**self).fmt(f) diff --git a/src/libstd/sys/redox/ext/fs.rs b/src/libstd/sys/redox/ext/fs.rs index 4437cf43920..9a0d1e06da3 100644 --- a/src/libstd/sys/redox/ext/fs.rs +++ b/src/libstd/sys/redox/ext/fs.rs @@ -177,6 +177,8 @@ pub trait MetadataExt { #[stable(feature = "metadata_ext", since = "1.1.0")] fn mode(&self) -> u32; #[stable(feature = "metadata_ext", since = "1.1.0")] + fn nlink(&self) -> u64; + #[stable(feature = "metadata_ext", since = "1.1.0")] fn uid(&self) -> u32; #[stable(feature = "metadata_ext", since = "1.1.0")] fn gid(&self) -> u32; @@ -194,6 +196,10 @@ pub trait MetadataExt { fn ctime(&self) -> i64; #[stable(feature = "metadata_ext", since = "1.1.0")] fn ctime_nsec(&self) -> i64; + #[stable(feature = "metadata_ext", since = "1.1.0")] + fn blksize(&self) -> u64; + #[stable(feature = "metadata_ext", since = "1.1.0")] + fn blocks(&self) -> u64; } #[stable(feature = "metadata_ext", since = "1.1.0")] @@ -207,6 +213,9 @@ impl MetadataExt for fs::Metadata { fn mode(&self) -> u32 { self.as_inner().as_inner().st_mode as u32 } + fn nlink(&self) -> u64 { + self.as_inner().as_inner().st_nlink as u64 + } fn uid(&self) -> u32 { self.as_inner().as_inner().st_uid as u32 } @@ -234,6 +243,12 @@ impl MetadataExt for fs::Metadata { fn ctime_nsec(&self) -> i64 { self.as_inner().as_inner().st_ctime_nsec as i64 } + fn blksize(&self) -> u64 { + self.as_inner().as_inner().st_blksize as u64 + } + fn blocks(&self) -> u64 { + self.as_inner().as_inner().st_blocks as u64 + } } /// Add special Redox types (block/char device, fifo and socket) diff --git a/src/libstd/sys/redox/fs.rs b/src/libstd/sys/redox/fs.rs index 4dcaec6edb8..87e50c40148 100644 --- a/src/libstd/sys/redox/fs.rs +++ b/src/libstd/sys/redox/fs.rs @@ -119,10 +119,10 @@ impl FilePermissions { impl FileType { pub fn is_dir(&self) -> bool { self.is(syscall::MODE_DIR) } pub fn is_file(&self) -> bool { self.is(syscall::MODE_FILE) } - pub fn is_symlink(&self) -> bool { false /*FIXME: Implement symlink mode*/ } + pub fn is_symlink(&self) -> bool { self.is(syscall::MODE_SYMLINK) } pub fn is(&self, mode: u16) -> bool { - self.mode & (syscall::MODE_DIR | syscall::MODE_FILE) == mode + self.mode & syscall::MODE_TYPE == mode } } |
