Skip to content

book: Change "Failures" to "Errors" in doc special sections chapter #31345

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/doc/book/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ least. If your function has a non-trivial contract like this, that is
detected/enforced by panics, documenting it is very important.

```rust
/// # Failures
/// # Errors
# fn foo() {}
```

Expand Down
2 changes: 1 addition & 1 deletion src/libcollections/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1644,7 +1644,7 @@ impl str {
///
/// [`FromStr`]: str/trait.FromStr.html
///
/// # Failure
/// # Errors
///
/// Will return `Err` if it's not possible to parse this string slice into
/// the desired type.
Expand Down
2 changes: 1 addition & 1 deletion src/libcollections/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ impl String {
///
/// [`str::from_utf8()`]: ../str/fn.from_utf8.html
///
/// # Failure
/// # Errors
///
/// Returns `Err` if the slice is not UTF-8 with a description as to why the
/// provided bytes are not UTF-8. The vector you moved in is also included.
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/str/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ impl Utf8Error {
/// it, this function is one way to have a stack-allocated string. There is
/// an example of this in the examples section below.
///
/// # Failure
/// # Errors
///
/// Returns `Err` if the slice is not UTF-8 with a description as to why the
/// provided slice is not UTF-8.
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_unicode/char.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ impl char {
/// * `a-z`
/// * `A-Z`
///
/// # Failure
/// # Errors
///
/// Returns `None` if the `char` does not refer to a digit in the given radix.
///
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ pub struct Metadata(fs_imp::FileAttr);
/// information like the entry's path and possibly other metadata can be
/// learned.
///
/// # Failure
/// # Errors
///
/// This `io::Result` will be an `Err` if there's some sort of intermittent
/// IO error during iteration.
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/sync/condvar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ impl Condvar {
/// the predicate must always be checked each time this function returns to
/// protect against spurious wakeups.
///
/// # Failure
/// # Errors
///
/// This function will return an error if the mutex being waited on is
/// poisoned when this thread re-acquires the lock. For more information,
Expand Down
8 changes: 4 additions & 4 deletions src/libstd/sync/mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ impl<T: ?Sized> Mutex<T> {
/// held. An RAII guard is returned to allow scoped unlock of the lock. When
/// the guard goes out of scope, the mutex will be unlocked.
///
/// # Failure
/// # Errors
///
/// If another user of this mutex panicked while holding the mutex, then
/// this call will return an error once the mutex is acquired.
Expand All @@ -223,7 +223,7 @@ impl<T: ?Sized> Mutex<T> {
///
/// This function does not block.
///
/// # Failure
/// # Errors
///
/// If another user of this mutex panicked while holding the mutex, then
/// this call will return failure if the mutex would otherwise be
Expand All @@ -250,7 +250,7 @@ impl<T: ?Sized> Mutex<T> {

/// Consumes this mutex, returning the underlying data.
///
/// # Failure
/// # Errors
///
/// If another user of this mutex panicked while holding the mutex, then
/// this call will return an error instead.
Expand Down Expand Up @@ -280,7 +280,7 @@ impl<T: ?Sized> Mutex<T> {
/// Since this call borrows the `Mutex` mutably, no actual locking needs to
/// take place---the mutable borrow statically guarantees no locks exist.
///
/// # Failure
/// # Errors
///
/// If another user of this mutex panicked while holding the mutex, then
/// this call will return an error instead.
Expand Down
12 changes: 6 additions & 6 deletions src/libstd/sync/rwlock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ impl<T: ?Sized> RwLock<T> {
/// Returns an RAII guard which will release this thread's shared access
/// once it is dropped.
///
/// # Failure
/// # Errors
///
/// This function will return an error if the RwLock is poisoned. An RwLock
/// is poisoned whenever a writer panics while holding an exclusive lock.
Expand All @@ -192,7 +192,7 @@ impl<T: ?Sized> RwLock<T> {
/// This function does not provide any guarantees with respect to the ordering
/// of whether contentious readers or writers will acquire the lock first.
///
/// # Failure
/// # Errors
///
/// This function will return an error if the RwLock is poisoned. An RwLock
/// is poisoned whenever a writer panics while holding an exclusive lock. An
Expand All @@ -217,7 +217,7 @@ impl<T: ?Sized> RwLock<T> {
/// Returns an RAII guard which will drop the write access of this rwlock
/// when dropped.
///
/// # Failure
/// # Errors
///
/// This function will return an error if the RwLock is poisoned. An RwLock
/// is poisoned whenever a writer panics while holding an exclusive lock.
Expand All @@ -240,7 +240,7 @@ impl<T: ?Sized> RwLock<T> {
/// This function does not provide any guarantees with respect to the ordering
/// of whether contentious readers or writers will acquire the lock first.
///
/// # Failure
/// # Errors
///
/// This function will return an error if the RwLock is poisoned. An RwLock
/// is poisoned whenever a writer panics while holding an exclusive lock. An
Expand Down Expand Up @@ -269,7 +269,7 @@ impl<T: ?Sized> RwLock<T> {

/// Consumes this `RwLock`, returning the underlying data.
///
/// # Failure
/// # Errors
///
/// This function will return an error if the RwLock is poisoned. An RwLock
/// is poisoned whenever a writer panics while holding an exclusive lock. An
Expand Down Expand Up @@ -301,7 +301,7 @@ impl<T: ?Sized> RwLock<T> {
/// Since this call borrows the `RwLock` mutably, no actual locking needs to
/// take place---the mutable borrow statically guarantees no locks exist.
///
/// # Failure
/// # Errors
///
/// This function will return an error if the RwLock is poisoned. An RwLock
/// is poisoned whenever a writer panics while holding an exclusive lock. An
Expand Down
4 changes: 2 additions & 2 deletions src/libstd/sys/common/remutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ impl<T> ReentrantMutex<T> {
/// calling this method already holds the lock, the call shall succeed without
/// blocking.
///
/// # Failure
/// # Errors
///
/// If another user of this mutex panicked while holding the mutex, then
/// this call will return failure if the mutex would otherwise be
Expand All @@ -95,7 +95,7 @@ impl<T> ReentrantMutex<T> {
///
/// This function does not block.
///
/// # Failure
/// # Errors
///
/// If another user of this mutex panicked while holding the mutex, then
/// this call will return failure if the mutex would otherwise be
Expand Down