diff options
| author | bors <bors@rust-lang.org> | 2017-09-18 17:30:29 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-09-18 17:30:29 +0000 |
| commit | 0701b37d97d08da7074ece7a7dcb4449498f4bfa (patch) | |
| tree | 796f1ce756d1bce72a8462d6d74c28f11263895c /src/libstd/thread | |
| parent | 3a7b960731fd1cf86f1879b1a0d44196a0917c53 (diff) | |
| parent | 929215db7c598722410709022e69f71702f02e0b (diff) | |
| download | rust-0701b37d97d08da7074ece7a7dcb4449498f4bfa.tar.gz rust-0701b37d97d08da7074ece7a7dcb4449498f4bfa.zip | |
Auto merge of #44678 - alexcrichton:rollup, r=alexcrichton
Rollup of 11 pull requests - Successful merges: #44364, #44466, #44537, #44548, #44640, #44651, #44657, #44661, #44668, #44671, #44675 - Failed merges:
Diffstat (limited to 'src/libstd/thread')
| -rw-r--r-- | src/libstd/thread/mod.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs index ca01eaefcae..30887b16c60 100644 --- a/src/libstd/thread/mod.rs +++ b/src/libstd/thread/mod.rs @@ -287,6 +287,8 @@ impl Builder { /// Names the thread-to-be. Currently the name is used for identification /// only in panic messages. /// + /// The name must not contain null bytes (`\0`). + /// /// For more information about named threads, see /// [this module-level documentation][naming-threads]. /// @@ -355,6 +357,10 @@ impl Builder { /// [`io::Result`]: ../../std/io/type.Result.html /// [`JoinHandle`]: ../../std/thread/struct.JoinHandle.html /// + /// # Panics + /// + /// Panics if a thread name was set and it contained null bytes. + /// /// # Examples /// /// ``` @@ -941,6 +947,7 @@ pub struct Thread { impl Thread { // Used only internally to construct a thread object without spawning + // Panics if the name contains nuls. pub(crate) fn new(name: Option<String>) -> Thread { let cname = name.map(|n| { CString::new(n).expect("thread name may not contain interior null bytes") |
