about summary refs log tree commit diff
path: root/library/std/src/thread/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'library/std/src/thread/mod.rs')
-rw-r--r--library/std/src/thread/mod.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/library/std/src/thread/mod.rs b/library/std/src/thread/mod.rs
index 87d5c2f742c..13b02cd8d3a 100644
--- a/library/std/src/thread/mod.rs
+++ b/library/std/src/thread/mod.rs
@@ -1337,21 +1337,19 @@ pub struct Thread {
 impl Thread {
     /// Used only internally to construct a thread object without spawning.
     pub(crate) fn new(name: ThreadNameString) -> Thread {
-        unsafe { Self::new_inner(ThreadName::Other(name)) }
+        Self::new_inner(ThreadName::Other(name))
     }
 
     pub(crate) fn new_unnamed() -> Thread {
-        unsafe { Self::new_inner(ThreadName::Unnamed) }
+        Self::new_inner(ThreadName::Unnamed)
     }
 
     // Used in runtime to construct main thread
     pub(crate) fn new_main() -> Thread {
-        unsafe { Self::new_inner(ThreadName::Main) }
+        Self::new_inner(ThreadName::Main)
     }
 
-    /// # Safety
-    /// If `name` is `ThreadName::Other(_)`, the contained string must be valid UTF-8.
-    unsafe fn new_inner(name: ThreadName) -> Thread {
+    fn new_inner(name: ThreadName) -> Thread {
         // We have to use `unsafe` here to construct the `Parker` in-place,
         // which is required for the UNIX implementation.
         //