about summary refs log tree commit diff
path: root/src/libstd/rt
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-10-29 20:16:57 +0000
committerbors <bors@rust-lang.org>2014-10-29 20:16:57 +0000
commit77f44d4a7bf14805fda5fc41310a6aeffda30fd4 (patch)
treeaea7012d4afbf278ae64ce92cff06c3d2a7e00cc /src/libstd/rt
parent4769bca1483839ff9c0ad8353c206d6ee06c50e1 (diff)
parent6ac7fc73f5acfe30c698ea4f8bfc37b30473977e (diff)
downloadrust-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/libstd/rt')
-rw-r--r--src/libstd/rt/backtrace.rs6
-rw-r--r--src/libstd/rt/mod.rs2
-rw-r--r--src/libstd/rt/util.rs2
3 files changed, 5 insertions, 5 deletions
diff --git a/src/libstd/rt/backtrace.rs b/src/libstd/rt/backtrace.rs
index e05e533be56..5bd39277275 100644
--- a/src/libstd/rt/backtrace.rs
+++ b/src/libstd/rt/backtrace.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-//! Simple backtrace functionality (to print on failure)
+//! Simple backtrace functionality (to print on panic)
 
 #![allow(non_camel_case_types)]
 
@@ -265,7 +265,7 @@ mod imp {
 
         // while it doesn't requires lock for work as everything is
         // local, it still displays much nicer backtraces when a
-        // couple of tasks fail simultaneously
+        // couple of tasks panic simultaneously
         static LOCK: StaticNativeMutex = NATIVE_MUTEX_INIT;
         let _g = unsafe { LOCK.lock() };
 
@@ -327,7 +327,7 @@ mod imp {
             // FindEnclosingFunction on non-osx platforms. In doing so, we get a
             // slightly more accurate stack trace in the process.
             //
-            // This is often because failure involves the last instruction of a
+            // This is often because panic involves the last instruction of a
             // function being "call std::rt::begin_unwind", with no ret
             // instructions after it. This means that the return instruction
             // pointer points *outside* of the calling function, and by
diff --git a/src/libstd/rt/mod.rs b/src/libstd/rt/mod.rs
index a91c6c572e6..e36d4ce8d4b 100644
--- a/src/libstd/rt/mod.rs
+++ b/src/libstd/rt/mod.rs
@@ -67,7 +67,7 @@ pub use rustrt::{task, local, mutex, exclusive, stack, args, rtio, thread};
 pub use rustrt::{Stdio, Stdout, Stderr, begin_unwind, begin_unwind_fmt};
 pub use rustrt::{bookkeeping, at_exit, unwind, DEFAULT_ERROR_CODE, Runtime};
 
-// Simple backtrace functionality (to print on failure)
+// Simple backtrace functionality (to print on panic)
 pub mod backtrace;
 
 // Just stuff
diff --git a/src/libstd/rt/util.rs b/src/libstd/rt/util.rs
index ec301369804..56f2dbf667a 100644
--- a/src/libstd/rt/util.rs
+++ b/src/libstd/rt/util.rs
@@ -62,7 +62,7 @@ pub fn default_sched_threads() -> uint {
             let opt_n: Option<uint> = FromStr::from_str(nstr.as_slice());
             match opt_n {
                 Some(n) if n > 0 => n,
-                _ => fail!("`RUST_THREADS` is `{}`, should be a positive integer", nstr)
+                _ => panic!("`RUST_THREADS` is `{}`, should be a positive integer", nstr)
             }
         }
         None => {