diff options
| author | bors <bors@rust-lang.org> | 2016-08-09 02:11:50 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-08-09 02:11:50 -0700 |
| commit | c2b03f8ba9c3f2622ea9fa6e2453c57aa1f8e6ab (patch) | |
| tree | 74ef19711b25c7d96fa3ceac0b0454e52b8dcc65 /src/libstd/error.rs | |
| parent | 58c5716e2d2b89c18cf2ac996376c9720b65b51d (diff) | |
| parent | a20a1db54ad869fc3ed810badd6b2f5634e20276 (diff) | |
| download | rust-c2b03f8ba9c3f2622ea9fa6e2453c57aa1f8e6ab.tar.gz rust-c2b03f8ba9c3f2622ea9fa6e2453c57aa1f8e6ab.zip | |
Auto merge of #35425 - apasel422:refcell, r=alexcrichton
Implement `RefCell::{try_borrow, try_borrow_mut}`
CC #35070
r? @alexcrichton
Diffstat (limited to 'src/libstd/error.rs')
| -rw-r--r-- | src/libstd/error.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libstd/error.rs b/src/libstd/error.rs index 1459420cdc0..914599271ac 100644 --- a/src/libstd/error.rs +++ b/src/libstd/error.rs @@ -49,6 +49,7 @@ use any::TypeId; use boxed::Box; +use cell; use char; use fmt::{self, Debug, Display}; use marker::{Send, Sync, Reflect}; @@ -289,6 +290,20 @@ impl Error for fmt::Error { } } +#[unstable(feature = "try_borrow", issue = "35070")] +impl<'a, T: ?Sized + Reflect> Error for cell::BorrowError<'a, T> { + fn description(&self) -> &str { + "already mutably borrowed" + } +} + +#[unstable(feature = "try_borrow", issue = "35070")] +impl<'a, T: ?Sized + Reflect> Error for cell::BorrowMutError<'a, T> { + fn description(&self) -> &str { + "already borrowed" + } +} + // copied from any.rs impl Error + 'static { /// Returns true if the boxed type is the same as `T` |
