diff options
Diffstat (limited to 'src/libstd/sys')
| -rw-r--r-- | src/libstd/sys/common/condvar.rs | 10 | ||||
| -rw-r--r-- | src/libstd/sys/common/mutex.rs | 8 | ||||
| -rw-r--r-- | src/libstd/sys/common/poison.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/common/rwlock.rs | 14 | ||||
| -rw-r--r-- | src/libstd/sys/common/thread_local.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/common/wtf8.rs | 54 | ||||
| -rw-r--r-- | src/libstd/sys/unix/ext.rs | 10 | ||||
| -rw-r--r-- | src/libstd/sys/unix/fd.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/unix/fs.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/unix/mod.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/unix/os.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/windows/ext.rs | 18 | ||||
| -rw-r--r-- | src/libstd/sys/windows/mod.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/windows/os.rs | 2 |
14 files changed, 65 insertions, 65 deletions
diff --git a/src/libstd/sys/common/condvar.rs b/src/libstd/sys/common/condvar.rs index 32fa6ec5903..9f46b0c3824 100644 --- a/src/libstd/sys/common/condvar.rs +++ b/src/libstd/sys/common/condvar.rs @@ -31,15 +31,15 @@ impl Condvar { #[inline] pub unsafe fn new() -> Condvar { Condvar(imp::Condvar::new()) } - /// Signal one waiter on this condition variable to wake up. + /// Signals one waiter on this condition variable to wake up. #[inline] pub unsafe fn notify_one(&self) { self.0.notify_one() } - /// Awaken all current waiters on this condition variable. + /// Awakens all current waiters on this condition variable. #[inline] pub unsafe fn notify_all(&self) { self.0.notify_all() } - /// Wait for a signal on the specified mutex. + /// Waits for a signal on the specified mutex. /// /// Behavior is undefined if the mutex is not locked by the current thread. /// Behavior is also undefined if more than one mutex is used concurrently @@ -47,7 +47,7 @@ impl Condvar { #[inline] pub unsafe fn wait(&self, mutex: &Mutex) { self.0.wait(mutex::raw(mutex)) } - /// Wait for a signal on the specified mutex with a timeout duration + /// Waits for a signal on the specified mutex with a timeout duration /// specified by `dur` (a relative time into the future). /// /// Behavior is undefined if the mutex is not locked by the current thread. @@ -58,7 +58,7 @@ impl Condvar { self.0.wait_timeout(mutex::raw(mutex), dur) } - /// Deallocate all resources associated with this condition variable. + /// Deallocates all resources associated with this condition variable. /// /// Behavior is undefined if there are current or will be future users of /// this condition variable. diff --git a/src/libstd/sys/common/mutex.rs b/src/libstd/sys/common/mutex.rs index 0ca22826700..1f9dd54192c 100644 --- a/src/libstd/sys/common/mutex.rs +++ b/src/libstd/sys/common/mutex.rs @@ -24,14 +24,14 @@ unsafe impl Sync for Mutex {} pub const MUTEX_INIT: Mutex = Mutex(imp::MUTEX_INIT); impl Mutex { - /// Lock the mutex blocking the current thread until it is available. + /// Locks the mutex blocking the current thread until it is available. /// /// Behavior is undefined if the mutex has been moved between this and any /// previous function call. #[inline] pub unsafe fn lock(&self) { self.0.lock() } - /// Attempt to lock the mutex without blocking, returning whether it was + /// Attempts to lock the mutex without blocking, returning whether it was /// successfully acquired or not. /// /// Behavior is undefined if the mutex has been moved between this and any @@ -39,14 +39,14 @@ impl Mutex { #[inline] pub unsafe fn try_lock(&self) -> bool { self.0.try_lock() } - /// Unlock the mutex. + /// Unlocks the mutex. /// /// Behavior is undefined if the current thread does not actually hold the /// mutex. #[inline] pub unsafe fn unlock(&self) { self.0.unlock() } - /// Deallocate all resources associated with this mutex. + /// Deallocates all resources associated with this mutex. /// /// Behavior is undefined if there are current or will be future users of /// this mutex. diff --git a/src/libstd/sys/common/poison.rs b/src/libstd/sys/common/poison.rs index 347cd0b464e..6deb4a48007 100644 --- a/src/libstd/sys/common/poison.rs +++ b/src/libstd/sys/common/poison.rs @@ -116,7 +116,7 @@ impl<T: Send> Error for PoisonError<T> { } impl<T> PoisonError<T> { - /// Create a `PoisonError`. + /// Creates a `PoisonError`. #[unstable(feature = "std_misc")] pub fn new(guard: T) -> PoisonError<T> { PoisonError { guard: guard } diff --git a/src/libstd/sys/common/rwlock.rs b/src/libstd/sys/common/rwlock.rs index f7d7a5715bc..725a09bcc86 100644 --- a/src/libstd/sys/common/rwlock.rs +++ b/src/libstd/sys/common/rwlock.rs @@ -21,7 +21,7 @@ pub struct RWLock(imp::RWLock); pub const RWLOCK_INIT: RWLock = RWLock(imp::RWLOCK_INIT); impl RWLock { - /// Acquire shared access to the underlying lock, blocking the current + /// Acquires shared access to the underlying lock, blocking the current /// thread to do so. /// /// Behavior is undefined if the rwlock has been moved between this and any @@ -29,7 +29,7 @@ impl RWLock { #[inline] pub unsafe fn read(&self) { self.0.read() } - /// Attempt to acquire shared access to this lock, returning whether it + /// Attempts to acquire shared access to this lock, returning whether it /// succeeded or not. /// /// This function does not block the current thread. @@ -39,7 +39,7 @@ impl RWLock { #[inline] pub unsafe fn try_read(&self) -> bool { self.0.try_read() } - /// Acquire write access to the underlying lock, blocking the current thread + /// Acquires write access to the underlying lock, blocking the current thread /// to do so. /// /// Behavior is undefined if the rwlock has been moved between this and any @@ -47,7 +47,7 @@ impl RWLock { #[inline] pub unsafe fn write(&self) { self.0.write() } - /// Attempt to acquire exclusive access to this lock, returning whether it + /// Attempts to acquire exclusive access to this lock, returning whether it /// succeeded or not. /// /// This function does not block the current thread. @@ -57,20 +57,20 @@ impl RWLock { #[inline] pub unsafe fn try_write(&self) -> bool { self.0.try_write() } - /// Unlock previously acquired shared access to this lock. + /// Unlocks previously acquired shared access to this lock. /// /// Behavior is undefined if the current thread does not have shared access. #[inline] pub unsafe fn read_unlock(&self) { self.0.read_unlock() } - /// Unlock previously acquired exclusive access to this lock. + /// Unlocks previously acquired exclusive access to this lock. /// /// Behavior is undefined if the current thread does not currently have /// exclusive access. #[inline] pub unsafe fn write_unlock(&self) { self.0.write_unlock() } - /// Destroy OS-related resources with this RWLock. + /// Destroys OS-related resources with this RWLock. /// /// Behavior is undefined if there are any currently active users of this /// lock. diff --git a/src/libstd/sys/common/thread_local.rs b/src/libstd/sys/common/thread_local.rs index 5995d7ac10f..618a389110a 100644 --- a/src/libstd/sys/common/thread_local.rs +++ b/src/libstd/sys/common/thread_local.rs @@ -207,7 +207,7 @@ impl StaticKey { } impl Key { - /// Create a new managed OS TLS key. + /// Creates a new managed OS TLS key. /// /// This key will be deallocated when the key falls out of scope. /// diff --git a/src/libstd/sys/common/wtf8.rs b/src/libstd/sys/common/wtf8.rs index 987a12293da..34a4a773f8e 100644 --- a/src/libstd/sys/common/wtf8.rs +++ b/src/libstd/sys/common/wtf8.rs @@ -69,7 +69,7 @@ impl fmt::Debug for CodePoint { } impl CodePoint { - /// Unsafely create a new `CodePoint` without checking the value. + /// Unsafely creates a new `CodePoint` without checking the value. /// /// Only use when `value` is known to be less than or equal to 0x10FFFF. #[inline] @@ -77,9 +77,9 @@ impl CodePoint { CodePoint { value: value } } - /// Create a new `CodePoint` if the value is a valid code point. + /// Creates a new `CodePoint` if the value is a valid code point. /// - /// Return `None` if `value` is above 0x10FFFF. + /// Returns `None` if `value` is above 0x10FFFF. #[inline] pub fn from_u32(value: u32) -> Option<CodePoint> { match value { @@ -88,7 +88,7 @@ impl CodePoint { } } - /// Create a new `CodePoint` from a `char`. + /// Creates a new `CodePoint` from a `char`. /// /// Since all Unicode scalar values are code points, this always succeeds. #[inline] @@ -96,15 +96,15 @@ impl CodePoint { CodePoint { value: value as u32 } } - /// Return the numeric value of the code point. + /// Returns the numeric value of the code point. #[inline] pub fn to_u32(&self) -> u32 { self.value } - /// Optionally return a Unicode scalar value for the code point. + /// Optionally returns a Unicode scalar value for the code point. /// - /// Return `None` if the code point is a surrogate (from U+D800 to U+DFFF). + /// Returns `None` if the code point is a surrogate (from U+D800 to U+DFFF). #[inline] pub fn to_char(&self) -> Option<char> { match self.value { @@ -113,9 +113,9 @@ impl CodePoint { } } - /// Return a Unicode scalar value for the code point. + /// Returns a Unicode scalar value for the code point. /// - /// Return `'\u{FFFD}'` (the replacement character “�”) + /// Returns `'\u{FFFD}'` (the replacement character “�”) /// if the code point is a surrogate (from U+D800 to U+DFFF). #[inline] pub fn to_char_lossy(&self) -> char { @@ -151,19 +151,19 @@ impl fmt::Debug for Wtf8Buf { } impl Wtf8Buf { - /// Create an new, empty WTF-8 string. + /// Creates an new, empty WTF-8 string. #[inline] pub fn new() -> Wtf8Buf { Wtf8Buf { bytes: Vec::new() } } - /// Create an new, empty WTF-8 string with pre-allocated capacity for `n` bytes. + /// Creates an new, empty WTF-8 string with pre-allocated capacity for `n` bytes. #[inline] pub fn with_capacity(n: usize) -> Wtf8Buf { Wtf8Buf { bytes: Vec::with_capacity(n) } } - /// Create a WTF-8 string from an UTF-8 `String`. + /// Creates a WTF-8 string from an UTF-8 `String`. /// /// This takes ownership of the `String` and does not copy. /// @@ -173,7 +173,7 @@ impl Wtf8Buf { Wtf8Buf { bytes: string.into_bytes() } } - /// Create a WTF-8 string from an UTF-8 `&str` slice. + /// Creates a WTF-8 string from an UTF-8 `&str` slice. /// /// This copies the content of the slice. /// @@ -183,7 +183,7 @@ impl Wtf8Buf { Wtf8Buf { bytes: <[_]>::to_vec(str.as_bytes()) } } - /// Create a WTF-8 string from a potentially ill-formed UTF-16 slice of 16-bit code units. + /// Creates a WTF-8 string from a potentially ill-formed UTF-16 slice of 16-bit code units. /// /// This is lossless: calling `.encode_wide()` on the resulting string /// will always return the original code units. @@ -319,7 +319,7 @@ impl Wtf8Buf { self.bytes.truncate(new_len) } - /// Consume the WTF-8 string and try to convert it to UTF-8. + /// Consumes the WTF-8 string and tries to convert it to UTF-8. /// /// This does not copy the data. /// @@ -333,7 +333,7 @@ impl Wtf8Buf { } } - /// Consume the WTF-8 string and convert it lossily to UTF-8. + /// Consumes the WTF-8 string and converts it lossily to UTF-8. /// /// This does not copy the data (but may overwrite parts of it in place). /// @@ -454,7 +454,7 @@ impl fmt::Debug for Wtf8 { } impl Wtf8 { - /// Create a WTF-8 slice from a UTF-8 `&str` slice. + /// Creates a WTF-8 slice from a UTF-8 `&str` slice. /// /// Since WTF-8 is a superset of UTF-8, this always succeeds. #[inline] @@ -462,13 +462,13 @@ impl Wtf8 { unsafe { mem::transmute(value.as_bytes()) } } - /// Return the length, in WTF-8 bytes. + /// Returns the length, in WTF-8 bytes. #[inline] pub fn len(&self) -> usize { self.bytes.len() } - /// Return the code point at `position` if it is in the ASCII range, + /// Returns the code point at `position` if it is in the ASCII range, /// or `b'\xFF' otherwise. /// /// # Panics @@ -482,7 +482,7 @@ impl Wtf8 { } } - /// Return the code point at `position`. + /// Returns the code point at `position`. /// /// # Panics /// @@ -494,7 +494,7 @@ impl Wtf8 { code_point } - /// Return the code point at `position` + /// Returns the code point at `position` /// and the position of the next code point. /// /// # Panics @@ -507,15 +507,15 @@ impl Wtf8 { (CodePoint { value: c }, n) } - /// Return an iterator for the string’s code points. + /// Returns an iterator for the string’s code points. #[inline] pub fn code_points(&self) -> Wtf8CodePoints { Wtf8CodePoints { bytes: self.bytes.iter() } } - /// Try to convert the string to UTF-8 and return a `&str` slice. + /// Tries to convert the string to UTF-8 and return a `&str` slice. /// - /// Return `None` if the string contains surrogates. + /// Returns `None` if the string contains surrogates. /// /// This does not copy the data. #[inline] @@ -528,8 +528,8 @@ impl Wtf8 { } } - /// Lossily convert the string to UTF-8. - /// Return an UTF-8 `&str` slice if the contents are well-formed in UTF-8. + /// Lossily converts the string to UTF-8. + /// Returns an UTF-8 `&str` slice if the contents are well-formed in UTF-8. /// /// Surrogates are replaced with `"\u{FFFD}"` (the replacement character “�”). /// @@ -559,7 +559,7 @@ impl Wtf8 { } } - /// Convert the WTF-8 string to potentially ill-formed UTF-16 + /// Converts the WTF-8 string to potentially ill-formed UTF-16 /// and return an iterator of 16-bit code units. /// /// This is lossless: diff --git a/src/libstd/sys/unix/ext.rs b/src/libstd/sys/unix/ext.rs index fbfbb40701f..a95cb85e74a 100644 --- a/src/libstd/sys/unix/ext.rs +++ b/src/libstd/sys/unix/ext.rs @@ -53,7 +53,7 @@ pub mod io { /// and `AsRawSocket` set of traits. #[stable(feature = "rust1", since = "1.0.0")] pub trait AsRawFd { - /// Extract the raw file descriptor. + /// Extracts the raw file descriptor. /// /// This method does **not** pass ownership of the raw file descriptor /// to the caller. The descriptor is only guarantee to be valid while @@ -216,11 +216,11 @@ pub mod ffi { /// Unix-specific extensions to `OsString`. #[stable(feature = "rust1", since = "1.0.0")] pub trait OsStringExt { - /// Create an `OsString` from a byte vector. + /// Creates an `OsString` from a byte vector. #[stable(feature = "rust1", since = "1.0.0")] fn from_vec(vec: Vec<u8>) -> Self; - /// Yield the underlying byte vector of this `OsString`. + /// Yields the underlying byte vector of this `OsString`. #[stable(feature = "rust1", since = "1.0.0")] fn into_vec(self) -> Vec<u8>; } @@ -241,7 +241,7 @@ pub mod ffi { #[stable(feature = "rust1", since = "1.0.0")] fn from_bytes(slice: &[u8]) -> &Self; - /// Get the underlying byte view of the `OsStr` slice. + /// Gets the underlying byte view of the `OsStr` slice. #[stable(feature = "rust1", since = "1.0.0")] fn as_bytes(&self) -> &[u8]; } @@ -280,7 +280,7 @@ pub mod fs { /// Unix-specific extensions to `OpenOptions` pub trait OpenOptionsExt { - /// Set the mode bits that a new file will be created with. + /// Sets the mode bits that a new file will be created with. /// /// If a new file is created as part of a `File::open_opts` call then this /// specified `mode` will be used as the permission bits for the new file. diff --git a/src/libstd/sys/unix/fd.rs b/src/libstd/sys/unix/fd.rs index d86c77624e8..e5bdb554359 100644 --- a/src/libstd/sys/unix/fd.rs +++ b/src/libstd/sys/unix/fd.rs @@ -28,7 +28,7 @@ impl FileDesc { pub fn raw(&self) -> c_int { self.fd } - /// Extract the actual filedescriptor without closing it. + /// Extracts the actual filedescriptor without closing it. pub fn into_raw(self) -> c_int { let fd = self.fd; unsafe { mem::forget(self) }; diff --git a/src/libstd/sys/unix/fs.rs b/src/libstd/sys/unix/fs.rs index 6121105f10b..c74d6b7e077 100644 --- a/src/libstd/sys/unix/fs.rs +++ b/src/libstd/sys/unix/fs.rs @@ -130,7 +130,7 @@ impl FileDesc { } } - /// Extract the actual filedescriptor without closing it. + /// Extracts the actual filedescriptor without closing it. pub fn unwrap(self) -> fd_t { let fd = self.fd; unsafe { mem::forget(self) }; diff --git a/src/libstd/sys/unix/mod.rs b/src/libstd/sys/unix/mod.rs index e8409bb4fd4..71da2f9219c 100644 --- a/src/libstd/sys/unix/mod.rs +++ b/src/libstd/sys/unix/mod.rs @@ -85,7 +85,7 @@ pub fn last_gai_error(s: libc::c_int) -> IoError { err } -/// Convert an `errno` value into a high-level error variant and description. +/// Converts an `errno` value into a high-level error variant and description. #[allow(deprecated)] pub fn decode_error(errno: i32) -> IoError { // FIXME: this should probably be a bit more descriptive... diff --git a/src/libstd/sys/unix/os.rs b/src/libstd/sys/unix/os.rs index d2220bdec32..52ec6063d7a 100644 --- a/src/libstd/sys/unix/os.rs +++ b/src/libstd/sys/unix/os.rs @@ -86,7 +86,7 @@ pub fn errno() -> i32 { } } -/// Get a detailed string description for the given error number +/// Gets a detailed string description for the given error number. pub fn error_string(errno: i32) -> String { #[cfg(target_os = "linux")] extern { diff --git a/src/libstd/sys/windows/ext.rs b/src/libstd/sys/windows/ext.rs index 2dd61861bd6..022407ebc02 100644 --- a/src/libstd/sys/windows/ext.rs +++ b/src/libstd/sys/windows/ext.rs @@ -38,7 +38,7 @@ pub mod io { /// Extract raw handles. #[stable(feature = "rust1", since = "1.0.0")] pub trait AsRawHandle { - /// Extract the raw handle, without taking any ownership. + /// Extracts the raw handle, without taking any ownership. #[stable(feature = "rust1", since = "1.0.0")] fn as_raw_handle(&self) -> RawHandle; } @@ -47,7 +47,7 @@ pub mod io { #[unstable(feature = "from_raw_os", reason = "recent addition to the std::os::windows::io module")] pub trait FromRawHandle { - /// Construct a new I/O object from the specified raw handle. + /// Constructs a new I/O object from the specified raw handle. /// /// This function will **consume ownership** of the handle given, /// passing responsibility for closing the handle to the returned @@ -112,7 +112,7 @@ pub mod io { /// Extract raw sockets. #[stable(feature = "rust1", since = "1.0.0")] pub trait AsRawSocket { - /// Extract the underlying raw socket from this object. + /// Extracts the underlying raw socket from this object. #[stable(feature = "rust1", since = "1.0.0")] fn as_raw_socket(&self) -> RawSocket; } @@ -214,7 +214,7 @@ pub mod ffi { /// Windows-specific extensions to `OsString`. #[stable(feature = "rust1", since = "1.0.0")] pub trait OsStringExt { - /// Create an `OsString` from a potentially ill-formed UTF-16 slice of + /// Creates an `OsString` from a potentially ill-formed UTF-16 slice of /// 16-bit code units. /// /// This is lossless: calling `.encode_wide()` on the resulting string @@ -233,7 +233,7 @@ pub mod ffi { /// Windows-specific extensions to `OsStr`. #[stable(feature = "rust1", since = "1.0.0")] pub trait OsStrExt { - /// Re-encode an `OsStr` as a wide character sequence, + /// Re-encodes an `OsStr` as a wide character sequence, /// i.e. potentially ill-formed UTF-16. /// /// This is lossless. Note that the encoding does not include a final @@ -258,25 +258,25 @@ pub mod fs { /// Windows-specific extensions to `OpenOptions` pub trait OpenOptionsExt { - /// Override the `dwDesiredAccess` argument to the call to `CreateFile` + /// Overrides the `dwDesiredAccess` argument to the call to `CreateFile` /// with the specified value. fn desired_access(&mut self, access: i32) -> &mut Self; - /// Override the `dwCreationDisposition` argument to the call to + /// Overrides the `dwCreationDisposition` argument to the call to /// `CreateFile` with the specified value. /// /// This will override any values of the standard `create` flags, for /// example. fn creation_disposition(&mut self, val: i32) -> &mut Self; - /// Override the `dwFlagsAndAttributes` argument to the call to + /// Overrides the `dwFlagsAndAttributes` argument to the call to /// `CreateFile` with the specified value. /// /// This will override any values of the standard flags on the /// `OpenOptions` structure. fn flags_and_attributes(&mut self, val: i32) -> &mut Self; - /// Override the `dwShareMode` argument to the call to `CreateFile` with + /// Overrides the `dwShareMode` argument to the call to `CreateFile` with /// the specified value. /// /// This will override any values of the standard flags on the diff --git a/src/libstd/sys/windows/mod.rs b/src/libstd/sys/windows/mod.rs index e9d5fca531f..eb031e9b745 100644 --- a/src/libstd/sys/windows/mod.rs +++ b/src/libstd/sys/windows/mod.rs @@ -95,7 +95,7 @@ pub fn last_gai_error(_errno: i32) -> IoError { last_net_error() } -/// Convert an `errno` value into a high-level error variant and description. +/// Converts an `errno` value into a high-level error variant and description. #[allow(deprecated)] pub fn decode_error(errno: i32) -> IoError { let (kind, desc) = match errno { diff --git a/src/libstd/sys/windows/os.rs b/src/libstd/sys/windows/os.rs index d5843a2f998..232e5669c2b 100644 --- a/src/libstd/sys/windows/os.rs +++ b/src/libstd/sys/windows/os.rs @@ -42,7 +42,7 @@ pub fn errno() -> i32 { unsafe { libc::GetLastError() as i32 } } -/// Get a detailed string description for the given error number +/// Gets a detailed string description for the given error number. pub fn error_string(errnum: i32) -> String { use libc::types::os::arch::extra::DWORD; use libc::types::os::arch::extra::LPWSTR; |
