about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorStefan Lankes <slankes@eonerc.rwth-aachen.de>2019-10-25 09:09:55 +0200
committerStefan Lankes <slankes@eonerc.rwth-aachen.de>2019-10-25 09:09:55 +0200
commitd349e32fc70da197918256c29a0858fe7e1a6588 (patch)
tree17f268176d32a172c84e84c30303a4794f4513b0 /src/libstd
parentddcd157d03a067419d7f5b4375cfaff5a474856a (diff)
parentd54111afc061ef398cd8ce28984f9e8d70001b24 (diff)
downloadrust-d349e32fc70da197918256c29a0858fe7e1a6588.tar.gz
rust-d349e32fc70da197918256c29a0858fe7e1a6588.zip
Merge branch 'master' into rusty-hermit, resolve conflicts
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/Cargo.toml2
-rw-r--r--src/libstd/lib.rs2
-rw-r--r--src/libstd/panicking.rs2
-rw-r--r--src/libstd/sys/unix/rand.rs2
-rw-r--r--src/libstd/sys/wasi/thread.rs8
-rw-r--r--src/libstd/sys/windows/handle.rs2
-rw-r--r--src/libstd/sys/windows/mutex.rs2
-rw-r--r--src/libstd/sys/windows/process.rs5
-rw-r--r--src/libstd/sys/windows/rand.rs2
-rw-r--r--src/libstd/sys/windows/thread_local.rs2
-rw-r--r--src/libstd/sys/windows/time.rs4
-rw-r--r--src/libstd/thread/local.rs5
12 files changed, 19 insertions, 19 deletions
diff --git a/src/libstd/Cargo.toml b/src/libstd/Cargo.toml
index 9bf5caf0363..c55911a33f5 100644
--- a/src/libstd/Cargo.toml
+++ b/src/libstd/Cargo.toml
@@ -23,7 +23,7 @@ libc = { version = "0.2.51", default-features = false, features = ['rustc-dep-of
 compiler_builtins = { version = "0.1.16" }
 profiler_builtins = { path = "../libprofiler_builtins", optional = true }
 unwind = { path = "../libunwind" }
-hashbrown = { version = "0.6.1", default-features = false, features = ['rustc-dep-of-std'] }
+hashbrown = { version = "0.6.2", default-features = false, features = ['rustc-dep-of-std'] }
 
 [dependencies.backtrace_rs]
 package = "backtrace"
diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs
index 93d3e4ea3df..d0cb0104f6c 100644
--- a/src/libstd/lib.rs
+++ b/src/libstd/lib.rs
@@ -276,6 +276,7 @@
 #![feature(linkage)]
 #![feature(log_syntax)]
 #![feature(manually_drop_take)]
+#![feature(matches_macro)]
 #![feature(maybe_uninit_ref)]
 #![feature(maybe_uninit_slice)]
 #![feature(needs_panic_runtime)]
@@ -527,6 +528,7 @@ pub use core::{
     writeln,
     // Unstable
     todo,
+    matches,
 };
 
 // Re-export built-in macros defined through libcore.
diff --git a/src/libstd/panicking.rs b/src/libstd/panicking.rs
index 2dde81bb0ec..619b1820190 100644
--- a/src/libstd/panicking.rs
+++ b/src/libstd/panicking.rs
@@ -217,7 +217,7 @@ pub fn update_panic_count(amt: isize) -> usize {
     PANIC_COUNT.with(|c| {
         let next = (c.get() as isize + amt) as usize;
         c.set(next);
-        return next
+        next
     })
 }
 
diff --git a/src/libstd/sys/unix/rand.rs b/src/libstd/sys/unix/rand.rs
index c5be1763302..be112f6fc03 100644
--- a/src/libstd/sys/unix/rand.rs
+++ b/src/libstd/sys/unix/rand.rs
@@ -8,7 +8,7 @@ pub fn hashmap_random_keys() -> (u64, u64) {
                                              mem::size_of_val(&v));
         imp::fill_bytes(view);
     }
-    return v
+    v
 }
 
 #[cfg(all(unix,
diff --git a/src/libstd/sys/wasi/thread.rs b/src/libstd/sys/wasi/thread.rs
index 28a504f1979..6ce41420284 100644
--- a/src/libstd/sys/wasi/thread.rs
+++ b/src/libstd/sys/wasi/thread.rs
@@ -31,10 +31,10 @@ impl Thread {
         let nanos = dur.as_nanos();
         assert!(nanos <= u64::max_value() as u128);
 
-        const CLOCK_ID: wasi::Userdata = 0x0123_45678;
+        const USERDATA: wasi::Userdata = 0x0123_45678;
 
         let clock = wasi::raw::__wasi_subscription_u_clock_t {
-            identifier: CLOCK_ID,
+            identifier: 0,
             clock_id: wasi::CLOCK_MONOTONIC,
             timeout: nanos as u64,
             precision: 0,
@@ -42,7 +42,7 @@ impl Thread {
         };
 
         let in_ = [wasi::Subscription {
-            userdata: 0,
+            userdata: USERDATA,
             type_: wasi::EVENTTYPE_CLOCK,
             u: wasi::raw::__wasi_subscription_u { clock: clock },
         }];
@@ -53,7 +53,7 @@ impl Thread {
         };
         match (res, event) {
             (Ok(1), wasi::Event {
-                userdata: CLOCK_ID,
+                userdata: USERDATA,
                 error: 0,
                 type_: wasi::EVENTTYPE_CLOCK,
                 ..
diff --git a/src/libstd/sys/windows/handle.rs b/src/libstd/sys/windows/handle.rs
index 3e5aa693354..3986cda1a50 100644
--- a/src/libstd/sys/windows/handle.rs
+++ b/src/libstd/sys/windows/handle.rs
@@ -46,7 +46,7 @@ impl Handle {
     pub fn into_raw(self) -> c::HANDLE {
         let ret = self.raw();
         mem::forget(self);
-        return ret;
+        ret
     }
 }
 
diff --git a/src/libstd/sys/windows/mutex.rs b/src/libstd/sys/windows/mutex.rs
index 37cbdcefced..79dec1adf4b 100644
--- a/src/libstd/sys/windows/mutex.rs
+++ b/src/libstd/sys/windows/mutex.rs
@@ -144,7 +144,7 @@ fn kind() -> Kind {
         Some(..) => Kind::SRWLock,
     };
     KIND.store(ret as usize, Ordering::SeqCst);
-    return ret;
+    ret
 }
 
 pub struct ReentrantMutex { inner: UnsafeCell<MaybeUninit<c::CRITICAL_SECTION>> }
diff --git a/src/libstd/sys/windows/process.rs b/src/libstd/sys/windows/process.rs
index 8658deb8546..096b7bea8a5 100644
--- a/src/libstd/sys/windows/process.rs
+++ b/src/libstd/sys/windows/process.rs
@@ -257,7 +257,7 @@ impl Stdio {
                         let ret = io.duplicate(0, true,
                                                c::DUPLICATE_SAME_ACCESS);
                         io.into_raw();
-                        return ret
+                        ret
                     }
                     Err(..) => Ok(Handle::new(c::INVALID_HANDLE_VALUE)),
                 }
@@ -472,9 +472,8 @@ fn make_command_line(prog: &OsStr, args: &[OsString]) -> io::Result<Vec<u16>> {
             cmd.push('"' as u16);
         }
 
-        let mut iter = arg.encode_wide();
         let mut backslashes: usize = 0;
-        while let Some(x) = iter.next() {
+        for x in arg.encode_wide() {
             if x == '\\' as u16 {
                 backslashes += 1;
             } else {
diff --git a/src/libstd/sys/windows/rand.rs b/src/libstd/sys/windows/rand.rs
index c9bcb5d7415..993831bec18 100644
--- a/src/libstd/sys/windows/rand.rs
+++ b/src/libstd/sys/windows/rand.rs
@@ -13,7 +13,7 @@ pub fn hashmap_random_keys() -> (u64, u64) {
         panic!("couldn't generate random bytes: {}",
                io::Error::last_os_error());
     }
-    return v
+    v
 }
 
 #[cfg(target_vendor = "uwp")]
diff --git a/src/libstd/sys/windows/thread_local.rs b/src/libstd/sys/windows/thread_local.rs
index 4c9734fa0aa..728257cdd4b 100644
--- a/src/libstd/sys/windows/thread_local.rs
+++ b/src/libstd/sys/windows/thread_local.rs
@@ -52,7 +52,7 @@ pub unsafe fn create(dtor: Option<Dtor>) -> Key {
     if let Some(f) = dtor {
         register_dtor(key, f);
     }
-    return key;
+    key
 }
 
 #[inline]
diff --git a/src/libstd/sys/windows/time.rs b/src/libstd/sys/windows/time.rs
index e0f0e3a1a45..bd533c93d43 100644
--- a/src/libstd/sys/windows/time.rs
+++ b/src/libstd/sys/windows/time.rs
@@ -80,7 +80,7 @@ impl SystemTime {
         unsafe {
             let mut t: SystemTime = mem::zeroed();
             c::GetSystemTimeAsFileTime(&mut t.t);
-            return t
+            t
         }
     }
 
@@ -228,7 +228,7 @@ mod perf_counter {
                 FREQUENCY = frequency;
                 STATE.store(2, SeqCst);
             }
-            return frequency;
+            frequency
         }
     }
 
diff --git a/src/libstd/thread/local.rs b/src/libstd/thread/local.rs
index e92c0d1c58e..cfaab4e22e9 100644
--- a/src/libstd/thread/local.rs
+++ b/src/libstd/thread/local.rs
@@ -509,9 +509,8 @@ pub mod os {
         pub unsafe fn get(&'static self, init: fn() -> T) -> Option<&'static T> {
             let ptr = self.os.get() as *mut Value<T>;
             if ptr as usize > 1 {
-                match (*ptr).inner.get() {
-                    Some(ref value) => return Some(value),
-                    None => {},
+                if let Some(ref value) = (*ptr).inner.get() {
+                    return Some(value);
                 }
             }
             self.try_initialize(init)