Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 15 pull requests #67670

Merged
merged 33 commits into from
Dec 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
3c56a65
reuse `capacity` variable in slice::repeat
king6cong Dec 24, 2019
ac31c71
Update libc to 0.2.66
oxalica Dec 24, 2019
43cb37e
Use issue = "none" instead of "0" in intrinsics
KamilaBorowska Dec 25, 2019
415ecc8
Add Scalar::to_(u|i)16 methods
pvdrz Dec 25, 2019
dfcc44d
rewrite scalar to integer methods
pvdrz Dec 25, 2019
b8ccc0f
Remove `compiler_builtins_lib` documentation
kraai Dec 25, 2019
5d19d4d
Use the correct type for static qualifs
matthewjasper Dec 25, 2019
21e636f
Remove redundant link texts
kraai Dec 26, 2019
2f43313
Convert collapsed to shortcut reference links
kraai Dec 26, 2019
be9a3c6
Update .mailmap
pvdrz Dec 26, 2019
9c0f3f7
Document safety of Path casting
Mark-Simulacrum Dec 26, 2019
2c796ee
Use NonNull in slice::Iter and slice::IterMut.
Kixunil Dec 24, 2019
749295c
Add regression test for old NLL ICE
rossmacarthur Dec 27, 2019
1c572a2
Stabilize the `matches!` macro
SimonSapin Dec 27, 2019
aa5983d
Fix my entry in the mailmap
Manishearth Dec 27, 2019
1ec81ab
Fix Nika's entry in the mailmap
Manishearth Dec 27, 2019
e518e38
Fix whitequark's entry in the mailmap
Manishearth Dec 27, 2019
f35517e
core: add IntoFuture trait and support for await
seanmonstar Dec 26, 2019
b1b005b
Rollup merge of #65244 - seanmonstar:into-future, r=seanmonstar
oli-obk Dec 27, 2019
a076464
Rollup merge of #67576 - king6cong:slice_repeat, r=Dylan-DPC
oli-obk Dec 27, 2019
4b91966
Rollup merge of #67588 - Kixunil:nonnull-slice-iter, r=rkruppe
oli-obk Dec 27, 2019
31fd966
Rollup merge of #67594 - oxalica:update-libc, r=Dylan-DPC
oli-obk Dec 27, 2019
4cf4fc6
Rollup merge of #67602 - xfix:use-issue-none-instead-of-0-in-intrinsi…
oli-obk Dec 27, 2019
e9af9db
Rollup merge of #67604 - christianpoveda:scalar_to_(u|i)64, r=RalfJung
oli-obk Dec 27, 2019
98de504
Rollup merge of #67617 - kraai:remove-compiler_builtins_lib-docs, r=D…
oli-obk Dec 27, 2019
b88ce0e
Rollup merge of #67621 - matthewjasper:correct-static-type, r=oli-obk
oli-obk Dec 27, 2019
b371e0f
Rollup merge of #67629 - kraai:remove-redundant-link-texts, r=stevekl…
oli-obk Dec 27, 2019
48efc1e
Rollup merge of #67632 - kraai:remove-collapsed-reference-links, r=st…
oli-obk Dec 27, 2019
47d5acf
Rollup merge of #67633 - christianpoveda:patch-1, r=Mark-Simulacrum
oli-obk Dec 27, 2019
9525e8e
Rollup merge of #67635 - Mark-Simulacrum:path-doc-unsafe, r=dtolnay
oli-obk Dec 27, 2019
9eb45e3
Rollup merge of #67654 - rossmacarthur:fix-51770-add-regression-test,…
oli-obk Dec 27, 2019
335c887
Rollup merge of #67659 - SimonSapin:matches, r=rkruppe
oli-obk Dec 27, 2019
65bbcf0
Rollup merge of #67664 - Manishearth:mailmapfixes, r=Mark-Simulacrum
oli-obk Dec 27, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@ Chris C Cerami <[email protected]> Chris C Cerami <chrisccer
Chris Pressey <[email protected]>
Chris Thorn <[email protected]> Chris Thorn <[email protected]>
Chris Vittal <[email protected]> Christopher Vittal <[email protected]>
Christian Poveda <[email protected]> <[email protected]>
Christian Poveda <[email protected]> <[email protected]>
Christian Poveda <[email protected]> <[email protected]>
Christian Poveda <[email protected]> <[email protected]>
Christian Poveda <[email protected]> <[email protected]>
Christian Poveda <[email protected]> <[email protected]>
Christian Poveda <[email protected]> <[email protected]>
Clark Gaebel <[email protected]> <[email protected]>
Clinton Ryan <[email protected]>
Corey Richardson <[email protected]> Elaine "See More" Nemo <[email protected]>
Expand Down Expand Up @@ -154,6 +155,7 @@ Lindsey Kuper <[email protected]> <[email protected]>
Luke Metz <[email protected]>
Luqman Aden <[email protected]> <[email protected]>
Luqman Aden <[email protected]> <[email protected]>
Manish Goregaokar <[email protected]>
Marcell Pardavi <[email protected]>
Margaret Meyerhofer <[email protected]> <mmeyerho@andrew>
Mark Rousskov <[email protected]>
Expand Down Expand Up @@ -185,6 +187,7 @@ Neil Pankey <[email protected]> <[email protected]>
Nick Platt <[email protected]>
Nicole Mazzuca <[email protected]>
Nif Ward <[email protected]>
Nika Layzell <[email protected]>
Oliver Middleton <[email protected]> <[email protected]>
Oliver Scherer <[email protected]> <[email protected]>
Oliver Scherer <[email protected]> <[email protected]>
Expand All @@ -204,7 +207,6 @@ Paul Faria <[email protected]> Paul Faria <[email protected]>
Peer Aramillo Irizar <[email protected]> parir <[email protected]>
Peter Elmers <[email protected]> <[email protected]>
Peter Liniker <[email protected]>
Peter Zotov <[email protected]>
Phil Dawes <[email protected]> Phil Dawes <[email protected]>
Philipp Brüschweiler <[email protected]> <[email protected]>
Philipp Brüschweiler <[email protected]> <[email protected]>
Expand Down Expand Up @@ -255,6 +257,7 @@ Ulrik Sverdrup <[email protected]> Ulrik Sverdrup <root@localhost>
Vadim Petrochenkov <[email protected]>
Vadim Petrochenkov <[email protected]> petrochenkov <[email protected]>
Vitali Haravy <[email protected]> Vitali Haravy <[email protected]>
whitequark <[email protected]>
William Ting <[email protected]> <[email protected]>
Xuefeng Wu <[email protected]> Xuefeng Wu <[email protected]>
Xuefeng Wu <[email protected]> XuefengWu <[email protected]>
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ labels to triage issues:
to fix the issue.

* The dark blue **final-comment-period** label marks bugs that are using the
RFC signoff functionality of [rfcbot][rfcbot] and are currently in the final
RFC signoff functionality of [rfcbot] and are currently in the final
comment period.

* Red, **I**-prefixed labels indicate the **importance** of the issue. The
Expand All @@ -385,7 +385,7 @@ labels to triage issues:
label.

* The gray **proposed-final-comment-period** label marks bugs that are using
the RFC signoff functionality of [rfcbot][rfcbot] and are currently awaiting
the RFC signoff functionality of [rfcbot] and are currently awaiting
signoff of all team members in order to enter the final comment period.

* Pink, **regression**-prefixed labels track regressions from stable to the
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1773,9 +1773,9 @@ checksum = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f"

[[package]]
name = "libc"
version = "0.2.64"
version = "0.2.66"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "74dfca3d9957906e8d1e6a0b641dc9a59848e793f1da2165889fd4f62d10d79c"
checksum = "d515b1f41455adea1313a4a2ac8a8a477634fbae63cc6100e3aebb207ce61558"
dependencies = [
"rustc-std-workspace-core",
]
Expand Down
28 changes: 14 additions & 14 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4951,10 +4951,10 @@ Stabilized APIs
---------------

* [`std::panic`]
* [`std::panic::catch_unwind`][] (renamed from `recover`)
* [`std::panic::resume_unwind`][] (renamed from `propagate`)
* [`std::panic::AssertUnwindSafe`][] (renamed from `AssertRecoverSafe`)
* [`std::panic::UnwindSafe`][] (renamed from `RecoverSafe`)
* [`std::panic::catch_unwind`] (renamed from `recover`)
* [`std::panic::resume_unwind`] (renamed from `propagate`)
* [`std::panic::AssertUnwindSafe`] (renamed from `AssertRecoverSafe`)
* [`std::panic::UnwindSafe`] (renamed from `RecoverSafe`)
* [`str::is_char_boundary`]
* [`<*const T>::as_ref`]
* [`<*mut T>::as_ref`]
Expand Down Expand Up @@ -5234,18 +5234,18 @@ Libraries
---------

* Stabilized APIs:
* [`str::encode_utf16`][] (renamed from `utf16_units`)
* [`str::EncodeUtf16`][] (renamed from `Utf16Units`)
* [`str::encode_utf16`] (renamed from `utf16_units`)
* [`str::EncodeUtf16`] (renamed from `Utf16Units`)
* [`Ref::map`]
* [`RefMut::map`]
* [`ptr::drop_in_place`]
* [`time::Instant`]
* [`time::SystemTime`]
* [`Instant::now`]
* [`Instant::duration_since`][] (renamed from `duration_from_earlier`)
* [`Instant::duration_since`] (renamed from `duration_from_earlier`)
* [`Instant::elapsed`]
* [`SystemTime::now`]
* [`SystemTime::duration_since`][] (renamed from `duration_from_earlier`)
* [`SystemTime::duration_since`] (renamed from `duration_from_earlier`)
* [`SystemTime::elapsed`]
* Various `Add`/`Sub` impls for `Time` and `SystemTime`
* [`SystemTimeError`]
Expand Down Expand Up @@ -5432,8 +5432,8 @@ Libraries

* Stabilized APIs
* `Path`
* [`Path::strip_prefix`][] (renamed from relative_from)
* [`path::StripPrefixError`][] (new error type returned from strip_prefix)
* [`Path::strip_prefix`] (renamed from relative_from)
* [`path::StripPrefixError`] (new error type returned from strip_prefix)
* `Ipv4Addr`
* [`Ipv4Addr::is_loopback`]
* [`Ipv4Addr::is_private`]
Expand Down Expand Up @@ -5646,7 +5646,7 @@ Libraries

* Stabilized APIs:
[`Read::read_exact`],
[`ErrorKind::UnexpectedEof`][] (renamed from `UnexpectedEOF`),
[`ErrorKind::UnexpectedEof`] (renamed from `UnexpectedEOF`),
[`fs::DirBuilder`], [`fs::DirBuilder::new`],
[`fs::DirBuilder::recursive`], [`fs::DirBuilder::create`],
[`os::unix::fs::DirBuilderExt`],
Expand All @@ -5659,11 +5659,11 @@ Libraries
[`collections::hash_set::HashSet::drain`],
[`collections::binary_heap::Drain`],
[`collections::binary_heap::BinaryHeap::drain`],
[`Vec::extend_from_slice`][] (renamed from `push_all`),
[`Vec::extend_from_slice`] (renamed from `push_all`),
[`Mutex::get_mut`], [`Mutex::into_inner`], [`RwLock::get_mut`],
[`RwLock::into_inner`],
[`Iterator::min_by_key`][] (renamed from `min_by`),
[`Iterator::max_by_key`][] (renamed from `max_by`).
[`Iterator::min_by_key`] (renamed from `min_by`),
[`Iterator::max_by_key`] (renamed from `max_by`).
* The [core library][1.6co] is stable, as are most of its APIs.
* [The `assert_eq!` macro supports arguments that don't implement
`Sized`][1.6ae], such as arrays. In this way it behaves more like
Expand Down
6 changes: 1 addition & 5 deletions src/doc/unstable-book/src/language-features/lang-items.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,7 @@ pub extern fn rust_begin_panic(info: &PanicInfo) -> ! {

In many cases, you may need to manually link to the `compiler_builtins` crate
when building a `no_std` binary. You may observe this via linker error messages
such as "```undefined reference to `__rust_probestack'```". Using this crate
also requires enabling the library feature `compiler_builtins_lib`. You can read
more about this [here][compiler-builtins-lib].

[compiler-builtins-lib]: ../library-features/compiler-builtins-lib.md
such as "```undefined reference to `__rust_probestack'```".

## More about the language items

Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion src/liballoc/collections/binary_heap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1094,7 +1094,7 @@ impl<T> FusedIterator for Iter<'_, T> {}

/// An owning iterator over the elements of a `BinaryHeap`.
///
/// This `struct` is created by the [`into_iter`] method on [`BinaryHeap`][`BinaryHeap`]
/// This `struct` is created by the [`into_iter`] method on [`BinaryHeap`]
/// (provided by the `IntoIterator` trait). See its documentation for more.
///
/// [`into_iter`]: struct.BinaryHeap.html#method.into_iter
Expand Down
2 changes: 1 addition & 1 deletion src/liballoc/collections/btree/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ pub struct IterMut<'a, K: 'a, V: 'a> {

/// An owning iterator over the entries of a `BTreeMap`.
///
/// This `struct` is created by the [`into_iter`] method on [`BTreeMap`][`BTreeMap`]
/// This `struct` is created by the [`into_iter`] method on [`BTreeMap`]
/// (provided by the `IntoIterator` trait). See its documentation for more.
///
/// [`into_iter`]: struct.BTreeMap.html#method.into_iter
Expand Down
2 changes: 1 addition & 1 deletion src/liballoc/collections/btree/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ impl<T: fmt::Debug> fmt::Debug for Iter<'_, T> {

/// An owning iterator over the items of a `BTreeSet`.
///
/// This `struct` is created by the [`into_iter`] method on [`BTreeSet`][`BTreeSet`]
/// This `struct` is created by the [`into_iter`] method on [`BTreeSet`]
/// (provided by the `IntoIterator` trait). See its documentation for more.
///
/// [`BTreeSet`]: struct.BTreeSet.html
Expand Down
2 changes: 1 addition & 1 deletion src/liballoc/collections/linked_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ impl<T: fmt::Debug> fmt::Debug for IterMut<'_, T> {

/// An owning iterator over the elements of a `LinkedList`.
///
/// This `struct` is created by the [`into_iter`] method on [`LinkedList`][`LinkedList`]
/// This `struct` is created by the [`into_iter`] method on [`LinkedList`]
/// (provided by the `IntoIterator` trait). See its documentation for more.
///
/// [`into_iter`]: struct.LinkedList.html#method.into_iter
Expand Down
2 changes: 1 addition & 1 deletion src/liballoc/collections/vec_deque.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2474,7 +2474,7 @@ impl<T> FusedIterator for IterMut<'_, T> {}

/// An owning iterator over the elements of a `VecDeque`.
///
/// This `struct` is created by the [`into_iter`] method on [`VecDeque`][`VecDeque`]
/// This `struct` is created by the [`into_iter`] method on [`VecDeque`]
/// (provided by the `IntoIterator` trait). See its documentation for more.
///
/// [`into_iter`]: struct.VecDeque.html#method.into_iter
Expand Down
2 changes: 1 addition & 1 deletion src/liballoc/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@
//!
//! Additionally, the return value of this function is [`fmt::Result`] which is a
//! type alias of [`Result`]`<(), `[`std::fmt::Error`]`>`. Formatting implementations
//! should ensure that they propagate errors from the [`Formatter`][`Formatter`] (e.g., when
//! should ensure that they propagate errors from the [`Formatter`] (e.g., when
//! calling [`write!`]). However, they should never return errors spuriously. That
//! is, a formatting implementation must and may only return an error if the
//! passed-in [`Formatter`] returns an error. This is because, contrary to what
Expand Down
8 changes: 4 additions & 4 deletions src/liballoc/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,8 @@ impl<T> [T] {
// and `rem` is the remaining part of `n`.

// Using `Vec` to access `set_len()`.
let mut buf = Vec::with_capacity(self.len().checked_mul(n).expect("capacity overflow"));
let capacity = self.len().checked_mul(n).expect("capacity overflow");
let mut buf = Vec::with_capacity(capacity);

// `2^expn` repetition is done by doubling `buf` `expn`-times.
buf.extend(self);
Expand All @@ -476,7 +477,7 @@ impl<T> [T] {

// `rem` (`= n - 2^expn`) repetition is done by copying
// first `rem` repetitions from `buf` itself.
let rem_len = self.len() * n - buf.len(); // `self.len() * rem`
let rem_len = capacity - buf.len(); // `self.len() * rem`
if rem_len > 0 {
// `buf.extend(buf[0 .. rem_len])`:
unsafe {
Expand All @@ -487,8 +488,7 @@ impl<T> [T] {
rem_len,
);
// `buf.len() + rem_len` equals to `buf.capacity()` (`= self.len() * n`).
let buf_cap = buf.capacity();
buf.set_len(buf_cap);
buf.set_len(capacity);
}
}
buf
Expand Down
4 changes: 2 additions & 2 deletions src/liballoc/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ use crate::raw_vec::RawVec;
/// ensures no unnecessary allocations or deallocations occur. Emptying a `Vec`
/// and then filling it back up to the same [`len`] should incur no calls to
/// the allocator. If you wish to free up unused memory, use
/// [`shrink_to_fit`][`shrink_to_fit`].
/// [`shrink_to_fit`].
///
/// [`push`] and [`insert`] will never (re)allocate if the reported capacity is
/// sufficient. [`push`] and [`insert`] *will* (re)allocate if
Expand Down Expand Up @@ -2461,7 +2461,7 @@ where

/// An iterator that moves out of a vector.
///
/// This `struct` is created by the `into_iter` method on [`Vec`][`Vec`] (provided
/// This `struct` is created by the `into_iter` method on [`Vec`] (provided
/// by the [`IntoIterator`] trait).
///
/// [`Vec`]: struct.Vec.html
Expand Down
25 changes: 25 additions & 0 deletions src/libcore/future/future.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,21 @@ pub trait Future {
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>;
}

/// Conversion into a `Future`.
#[unstable(feature = "into_future", issue = "67644")]
pub trait IntoFuture {
/// The output that the future will produce on completion.
#[unstable(feature = "into_future", issue = "67644")]
type Output;
/// Which kind of future are we turning this into?
#[unstable(feature = "into_future", issue = "67644")]
type Future: Future<Output = Self::Output>;

/// Creates a future from a value.
#[unstable(feature = "into_future", issue = "67644")]
fn into_future(self) -> Self::Future;
}

#[stable(feature = "futures_api", since = "1.36.0")]
impl<F: ?Sized + Future + Unpin> Future for &mut F {
type Output = F::Output;
Expand All @@ -119,3 +134,13 @@ where
Pin::get_mut(self).as_mut().poll(cx)
}
}

#[unstable(feature = "into_future", issue = "67644")]
impl<F: Future> IntoFuture for F {
type Output = F::Output;
type Future = F;

fn into_future(self) -> Self::Future {
self
}
}
3 changes: 3 additions & 0 deletions src/libcore/future/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
mod future;
#[stable(feature = "futures_api", since = "1.36.0")]
pub use self::future::Future;

#[unstable(feature = "into_future", issue = "67644")]
pub use self::future::IntoFuture;
12 changes: 6 additions & 6 deletions src/libcore/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ extern "rust-intrinsic" {

#[rustc_const_stable(feature = "const_min_align_of", since = "1.40.0")]
pub fn min_align_of<T>() -> usize;
#[rustc_const_unstable(feature = "const_pref_align_of", issue = "0")]
#[rustc_const_unstable(feature = "const_pref_align_of", issue = "none")]
pub fn pref_align_of<T>() -> usize;

/// The size of the referenced value in bytes.
Expand All @@ -708,13 +708,13 @@ extern "rust-intrinsic" {
pub fn min_align_of_val<T: ?Sized>(_: &T) -> usize;

/// Gets a static string slice containing the name of a type.
#[rustc_const_unstable(feature = "const_type_name", issue = "0")]
#[rustc_const_unstable(feature = "const_type_name", issue = "none")]
pub fn type_name<T: ?Sized>() -> &'static str;

/// Gets an identifier which is globally unique to the specified type. This
/// function will return the same value for a type regardless of whichever
/// crate it is invoked in.
#[rustc_const_unstable(feature = "const_type_id", issue = "0")]
#[rustc_const_unstable(feature = "const_type_id", issue = "none")]
pub fn type_id<T: ?Sized + 'static>() -> u64;

/// A guard for unsafe functions that cannot ever be executed if `T` is uninhabited:
Expand Down Expand Up @@ -1222,7 +1222,7 @@ extern "rust-intrinsic" {
/// let num_leading = unsafe { ctlz_nonzero(x) };
/// assert_eq!(num_leading, 3);
/// ```
#[rustc_const_unstable(feature = "constctlz", issue = "0")]
#[rustc_const_unstable(feature = "constctlz", issue = "none")]
pub fn ctlz_nonzero<T>(x: T) -> T;

/// Returns the number of trailing unset bits (zeroes) in an integer type `T`.
Expand Down Expand Up @@ -1267,7 +1267,7 @@ extern "rust-intrinsic" {
/// let num_trailing = unsafe { cttz_nonzero(x) };
/// assert_eq!(num_trailing, 3);
/// ```
#[rustc_const_unstable(feature = "const_cttz", issue = "0")]
#[rustc_const_unstable(feature = "const_cttz", issue = "none")]
pub fn cttz_nonzero<T>(x: T) -> T;

/// Reverses the bytes in an integer type `T`.
Expand Down Expand Up @@ -1396,7 +1396,7 @@ extern "rust-intrinsic" {
pub fn nontemporal_store<T>(ptr: *mut T, val: T);

/// See documentation of `<*const T>::offset_from` for details.
#[rustc_const_unstable(feature = "const_ptr_offset_from", issue = "0")]
#[rustc_const_unstable(feature = "const_ptr_offset_from", issue = "none")]
pub fn ptr_offset_from<T>(ptr: *const T, base: *const T) -> isize;

/// Internal hook used by Miri to implement unwinding.
Expand Down
Loading