about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-04-30 17:30:55 +0000
committerbors <bors@rust-lang.org>2018-04-30 17:30:55 +0000
commit17841cc97ac950312355403b6cfe11b916e242a6 (patch)
tree5bd04ce4f05ca35b78d7612b13bf3a15f4e49655 /src/libcore
parent4745092d608e65ec869c0ebdb27c535f27606ea4 (diff)
parent6166f20571aeadc3e0790ab79b642b0a1d41169d (diff)
downloadrust-17841cc97ac950312355403b6cfe11b916e242a6.tar.gz
rust-17841cc97ac950312355403b6cfe11b916e242a6.zip
Auto merge of #50345 - kennytm:rollup, r=kennytm
Rollup of 7 pull requests

Successful merges:

 - #50233 (Make `Vec::new` a `const fn`)
 - #50312 (Add more links in panic docs)
 - #50316 (Fix some broken links in docs.)
 - #50325 (Add a few more tests for proc macro feature gating)
 - #50327 (Display correct unused field suggestion for nested struct patterns)
 - #50330 (check that #[used] is used only on statics)
 - #50344 (Update Cargo to 2018-04-28 122fd5be5201913d42e219e132d6569493583bca)

Failed merges:
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/iter/iterator.rs2
-rw-r--r--src/libcore/marker.rs2
-rw-r--r--src/libcore/ptr.rs5
3 files changed, 6 insertions, 3 deletions
diff --git a/src/libcore/iter/iterator.rs b/src/libcore/iter/iterator.rs
index 6a77de2c986..b27bd3142e1 100644
--- a/src/libcore/iter/iterator.rs
+++ b/src/libcore/iter/iterator.rs
@@ -1094,6 +1094,8 @@ pub trait Iterator {
     /// `flatten()` a three-dimensional array the result will be
     /// two-dimensional and not one-dimensional. To get a one-dimensional
     /// structure, you have to `flatten()` again.
+    ///
+    /// [`flat_map()`]: #method.flat_map
     #[inline]
     #[unstable(feature = "iterator_flatten", issue = "48213")]
     fn flatten(self) -> Flatten<Self>
diff --git a/src/libcore/marker.rs b/src/libcore/marker.rs
index feb689dbc1f..c074adfd570 100644
--- a/src/libcore/marker.rs
+++ b/src/libcore/marker.rs
@@ -602,6 +602,8 @@ unsafe impl<'a, T: ?Sized> Freeze for &'a mut T {}
 /// `Pin` pointer.
 ///
 /// This trait is automatically implemented for almost every type.
+///
+/// [`Pin`]: ../mem/struct.Pin.html
 #[unstable(feature = "pin", issue = "49150")]
 pub unsafe auto trait Unpin {}
 
diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs
index c61bdfc9c4f..5d0b675e8e4 100644
--- a/src/libcore/ptr.rs
+++ b/src/libcore/ptr.rs
@@ -2552,10 +2552,9 @@ impl<T: Sized> Unique<T> {
     /// This is useful for initializing types which lazily allocate, like
     /// `Vec::new` does.
     // FIXME: rename to dangling() to match NonNull?
-    pub fn empty() -> Self {
+    pub const fn empty() -> Self {
         unsafe {
-            let ptr = mem::align_of::<T>() as *mut T;
-            Unique::new_unchecked(ptr)
+            Unique::new_unchecked(mem::align_of::<T>() as *mut T)
         }
     }
 }