diff options
| author | bors <bors@rust-lang.org> | 2014-10-29 20:16:57 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-10-29 20:16:57 +0000 |
| commit | 77f44d4a7bf14805fda5fc41310a6aeffda30fd4 (patch) | |
| tree | aea7012d4afbf278ae64ce92cff06c3d2a7e00cc /src/liballoc | |
| parent | 4769bca1483839ff9c0ad8353c206d6ee06c50e1 (diff) | |
| parent | 6ac7fc73f5acfe30c698ea4f8bfc37b30473977e (diff) | |
| download | rust-77f44d4a7bf14805fda5fc41310a6aeffda30fd4.tar.gz rust-77f44d4a7bf14805fda5fc41310a6aeffda30fd4.zip | |
auto merge of #17894 : steveklabnik/rust/fail_to_panic, r=aturon
This in-progress PR implements https://github.com/rust-lang/rust/issues/17489. I made the code changes in this commit, next is to go through alllllllll the documentation and fix various things. - Rename column headings as appropriate, `# Panics` for panic conditions and `# Errors` for `Result`s. - clean up usage of words like 'fail' in error messages Anything else to add to the list, @aturon ? I think I should leave the actual functions with names like `slice_or_fail` alone, since you'll get to those in your conventions work? I'm submitting just the code bits now so that we can see it separately, and I also don't want to have to keep re-building rust over and over again if I don't have to :wink: Listing all the bits so I can remember as I go: - [x] compiler-rt - [x] compiletest - [x] doc - [x] driver - [x] etc - [x] grammar - [x] jemalloc - [x] liballoc - [x] libarena - [x] libbacktrace - [x] libcollections - [x] libcore - [x] libcoretest - [x] libdebug - [x] libflate - [x] libfmt_macros - [x] libfourcc - [x] libgetopts - [x] libglob - [x] libgraphviz - [x] libgreen - [x] libhexfloat - [x] liblibc - [x] liblog - [x] libnative - [x] libnum - [x] librand - [x] librbml - [x] libregex - [x] libregex_macros - [x] librlibc - [x] librustc - [x] librustc_back - [x] librustc_llvm - [x] librustdoc - [x] librustrt - [x] libsemver - [x] libserialize - [x] libstd - [x] libsync - [x] libsyntax - [x] libterm - [x] libtest - [x] libtime - [x] libunicode - [x] liburl - [x] libuuid - [x] llvm - [x] rt - [x] test
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/arc.rs | 6 | ||||
| -rw-r--r-- | src/liballoc/boxed.rs | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index cc6f2d76eaf..f543826fe01 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -227,9 +227,9 @@ impl<T: Sync + Send> Drop for Arc<T> { impl<T: Sync + Send> Weak<T> { /// Attempts to upgrade this weak reference to a strong reference. /// - /// This method will fail to upgrade this reference if the strong reference - /// count has already reached 0, but if there are still other active strong - /// references this function will return a new strong reference to the data. + /// This method will not upgrade this reference if the strong reference count has already + /// reached 0, but if there are still other active strong references this function will return + /// a new strong reference to the data. pub fn upgrade(&self) -> Option<Arc<T>> { // We use a CAS loop to increment the strong count instead of a // fetch_add because once the count hits 0 is must never be above 0. diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index 168d0daeb38..09404af7027 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -148,11 +148,11 @@ mod test { match a.downcast::<uint>() { Ok(a) => { assert!(a == box 8u); } - Err(..) => fail!() + Err(..) => panic!() } match b.downcast::<Test>() { Ok(a) => { assert!(a == box Test); } - Err(..) => fail!() + Err(..) => panic!() } let a = box 8u as Box<Any>; |
