about summary refs log tree commit diff
path: root/src/libstd/panic.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-06-26 11:20:18 +0000
committerbors <bors@rust-lang.org>2018-06-26 11:20:18 +0000
commit764232cb2a8407c72b9fea68835e686240e30ef3 (patch)
treed97ad05cf89b5e952cd58394ea8c5e8b4e82c803 /src/libstd/panic.rs
parent309fd8a6fb059d38ea56274968feff2ef738184b (diff)
parenta539885450313a6cfd50312ec12a4a84d546d87c (diff)
Auto merge of #51805 - pietroalbini:rollup, r=pietroalbini
Rollup of 11 pull requests

Successful merges:

 - #51104 (add `dyn ` to display of dynamic (trait) types)
 - #51153 (Link panic and compile_error docs)
 - #51642 (Fix unknown windows build)
 - #51730 (New safe associated functions for PinMut)
 - #51731 (Fix ICEs when using continue as an array length inside closures (inside loop conditions))
 - #51747 (Add error for using null characters in #[export_name])
 - #51769 (Update broken rustc-guide links)
 - #51786 (Remove unnecessary stat64 pointer casts)
 - #51788 (Fix typo)
 - #51789 (Don't ICE when performing `lower_pattern_unadjusted` on a `TyError`)
 - #51791 (Minify css)

Failed merges:

r? @ghost
Diffstat (limited to 'src/libstd/panic.rs')
-rw-r--r--src/libstd/panic.rs11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/libstd/panic.rs b/src/libstd/panic.rs
index 2c11c262488..451420ae88a 100644
--- a/src/libstd/panic.rs
+++ b/src/libstd/panic.rs
@@ -327,14 +327,9 @@ impl<T: fmt::Debug> fmt::Debug for AssertUnwindSafe<T> {
 impl<'a, F: Future> Future for AssertUnwindSafe<F> {
     type Output = F::Output;
 
-    fn poll(mut self: PinMut<Self>, cx: &mut task::Context) -> Poll<Self::Output> {
-        unsafe {
-            let pinned_field = PinMut::new_unchecked(
-                &mut PinMut::get_mut(self.reborrow()).0
-            );
-
-            pinned_field.poll(cx)
-        }
+    fn poll(self: PinMut<Self>, cx: &mut task::Context) -> Poll<Self::Output> {
+        let pinned_field = unsafe { PinMut::map_unchecked(self, |x| &mut x.0) };
+        pinned_field.poll(cx)
     }
 }