Skip to content

Commit 433a467

Browse files
committed
Auto merge of #62192 - Centril:rollup-kssnlta, r=Centril
Rollup of 16 pull requests Successful merges: - #61878 (improve pinning projection docs) - #62043 (Remove `FnBox`) - #62067 (Add suggestion for missing `.await` keyword) - #62076 (Updated RELEASES.md for 1.36.0) - #62102 (call out explicitly that general read needs to be called with an initialized buffer) - #62106 (Add more tests for async/await) - #62124 (refactor lexer to use idiomatic borrowing) - #62131 (libsyntax: Fix some Clippy warnings) - #62152 (Don't ICE on item in `.await` expression) - #62154 (Remove old fixme) - #62155 (Add regression test for MIR drop generation in async loops) - #62156 (Update books) - #62160 (Remove outdated question_mark_macro_sep lint) - #62164 (save-analysis: use buffered writes) - #62171 (rustc: Retry SIGILL linker invocations) - #62176 (Update RLS) Failed merges: r? @ghost
2 parents 3849a5f + 65f1ff4 commit 433a467

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1113
-419
lines changed

RELEASES.md

+102-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,104 @@
1+
Version 1.36.0 (2019-07-04)
2+
==========================
3+
4+
Language
5+
--------
6+
- [Non-Lexical Lifetimes are now enabled on the 2015 edition.][59114]
7+
- [The order of traits in trait objects no longer affects the semantics of that
8+
object.][59445] e.g. `dyn Send + fmt::Debug` is now equivalent to
9+
`dyn fmt::Debug + Send`, where this was previously not the case.
10+
11+
Libraries
12+
---------
13+
- [`HashMap`'s implementation has been replaced with `hashbrown::HashMap` implementation.][58623]
14+
- [`TryFromSliceError` now implements `From<Infallible>`.][60318]
15+
- [`mem::needs_drop` is now available as a const fn.][60364]
16+
- [`alloc::Layout::from_size_align_unchecked` is now available as a const fn.][60370]
17+
- [`String` now implements `BorrowMut<str>`.][60404]
18+
- [`io::Cursor` now implements `Default`.][60234]
19+
- [Both `NonNull::{dangling, cast}` are now const fns.][60244]
20+
- [The `alloc` crate is now stable.][59675] `alloc` allows you to use a subset
21+
of `std` (e.g. `Vec`, `Box`, `Arc`) in `#![no_std]` environments if the
22+
environment has access to heap memory allocation.
23+
- [`String` now implements `From<&String>`.][59825]
24+
- [You can now pass multiple arguments to the `dbg!` macro.][59826] `dbg!` will
25+
return a tuple of each argument when there is multiple arguments.
26+
- [`Result::{is_err, is_ok}` are now `#[must_use]` and will produce a warning if
27+
not used.][59648]
28+
29+
Stabilized APIs
30+
---------------
31+
- [`VecDeque::rotate_left`]
32+
- [`VecDeque::rotate_right`]
33+
- [`Iterator::copied`]
34+
- [`io::IoSlice`]
35+
- [`io::IoSliceMut`]
36+
- [`Read::read_vectored`]
37+
- [`Write::write_vectored`]
38+
- [`str::as_mut_ptr`]
39+
- [`mem::MaybeUninit`]
40+
- [`pointer::align_offset`]
41+
- [`future::Future`]
42+
- [`task::Context`]
43+
- [`task::RawWaker`]
44+
- [`task::RawWakerVTable`]
45+
- [`task::Waker`]
46+
- [`task::Poll`]
47+
48+
Cargo
49+
-----
50+
- [Cargo will now produce an error if you attempt to use the name of a required dependency as a feature.][cargo/6860]
51+
- [You can now pass the `--offline` flag to run cargo without accessing the network.][cargo/6934]
52+
53+
You can find further change's in [Cargo's 1.36.0 release notes][cargo-1-36-0].
54+
55+
Clippy
56+
------
57+
There have been numerous additions and fixes to clippy, see [Clippy's 1.36.0 release notes][clippy-1-36-0] for more details.
58+
59+
Misc
60+
----
61+
62+
Compatibility Notes
63+
-------------------
64+
- With the stabilisation of `mem::MaybeUninit`, `mem::uninitialized` use is no
65+
longer recommended, and will be deprecated in 1.38.0.
66+
67+
[60318]: https://github.com/rust-lang/rust/pull/60318/
68+
[60364]: https://github.com/rust-lang/rust/pull/60364/
69+
[60370]: https://github.com/rust-lang/rust/pull/60370/
70+
[60404]: https://github.com/rust-lang/rust/pull/60404/
71+
[60234]: https://github.com/rust-lang/rust/pull/60234/
72+
[60244]: https://github.com/rust-lang/rust/pull/60244/
73+
[58623]: https://github.com/rust-lang/rust/pull/58623/
74+
[59648]: https://github.com/rust-lang/rust/pull/59648/
75+
[59675]: https://github.com/rust-lang/rust/pull/59675/
76+
[59825]: https://github.com/rust-lang/rust/pull/59825/
77+
[59826]: https://github.com/rust-lang/rust/pull/59826/
78+
[59445]: https://github.com/rust-lang/rust/pull/59445/
79+
[59114]: https://github.com/rust-lang/rust/pull/59114/
80+
[cargo/6860]: https://github.com/rust-lang/cargo/pull/6860/
81+
[cargo/6934]: https://github.com/rust-lang/cargo/pull/6934/
82+
[`VecDeque::rotate_left`]: https://doc.rust-lang.org/std/collections/struct.VecDeque.html#method.rotate_left
83+
[`VecDeque::rotate_right`]: https://doc.rust-lang.org/std/collections/struct.VecDeque.html#method.rotate_right
84+
[`Iterator::copied`]: https://doc.rust-lang.org/std/iter/trait.Iterator.html#tymethod.copied
85+
[`io::IoSlice`]: https://doc.rust-lang.org/std/io/struct.IoSlice.html
86+
[`io::IoSliceMut`]: https://doc.rust-lang.org/std/io/struct.IoSliceMut.html
87+
[`Read::read_vectored`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_vectored
88+
[`Write::write_vectored`]: https://doc.rust-lang.org/std/io/trait.Write.html#method.write_vectored
89+
[`str::as_mut_ptr`]: https://doc.rust-lang.org/std/primitive.str.html#method.as_mut_ptr
90+
[`mem::MaybeUninit`]: https://doc.rust-lang.org/std/mem/union.MaybeUninit.html
91+
[`pointer::align_offset`]: https://doc.rust-lang.org/std/primitive.pointer.html#method.align_offset
92+
[`future::Future`]: https://doc.rust-lang.org/std/future/trait.Future.html
93+
[`task::Context`]: https://doc.rust-lang.org/beta/std/task/struct.Context.html
94+
[`task::RawWaker`]: https://doc.rust-lang.org/beta/std/task/struct.RawWaker.html
95+
[`task::RawWakerVTable`]: https://doc.rust-lang.org/beta/std/task/struct.RawWakerVTable.html
96+
[`task::Waker`]: https://doc.rust-lang.org/beta/std/task/struct.Waker.html
97+
[`task::Poll`]: https://doc.rust-lang.org/beta/std/task/enum.Poll.html
98+
[clippy-1-36-0]: https://github.com/rust-lang/rust-clippy/blob/master/CHANGELOG.md#rust-136
99+
[cargo-1-36-0]: https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md#cargo-136-2019-07-04
100+
101+
1102
Version 1.35.0 (2019-05-23)
2103
==========================
3104

@@ -62,7 +163,7 @@ Cargo
62163
- [You can now set `cargo:rustc-cdylib-link-arg` at build time to pass custom
63164
linker arguments when building a `cdylib`.][cargo/6298] Its usage is highly
64165
platform specific.
65-
166+
66167
Misc
67168
----
68169
- [The Rust toolchain is now available natively for musl based distros.][58575]

src/doc/nomicon

src/doc/reference

src/doc/rustc-guide

src/doc/unstable-book/src/language-features/unsized-locals.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,7 @@ fn main () {
117117
}
118118
```
119119

120-
One of the objectives of this feature is to allow `Box<dyn FnOnce>`, instead of `Box<dyn FnBox>` in the future. See [#28796] for details.
121-
122-
[#28796]: https://github.com/rust-lang/rust/issues/28796
120+
One of the objectives of this feature is to allow `Box<dyn FnOnce>`.
123121

124122
## Variable length arrays
125123

src/doc/unstable-book/src/library-features/fnbox.md

-32
This file was deleted.

src/liballoc/boxed.rs

-79
Original file line numberDiff line numberDiff line change
@@ -761,85 +761,6 @@ impl<A, F: Fn<A> + ?Sized> Fn<A> for Box<F> {
761761
}
762762
}
763763

764-
/// `FnBox` is deprecated and will be removed.
765-
/// `Box<dyn FnOnce()>` can be called directly, since Rust 1.35.0.
766-
///
767-
/// `FnBox` is a version of the `FnOnce` intended for use with boxed
768-
/// closure objects. The idea was that where one would normally store a
769-
/// `Box<dyn FnOnce()>` in a data structure, you whould use
770-
/// `Box<dyn FnBox()>`. The two traits behave essentially the same, except
771-
/// that a `FnBox` closure can only be called if it is boxed.
772-
///
773-
/// # Examples
774-
///
775-
/// Here is a snippet of code which creates a hashmap full of boxed
776-
/// once closures and then removes them one by one, calling each
777-
/// closure as it is removed. Note that the type of the closures
778-
/// stored in the map is `Box<dyn FnBox() -> i32>` and not `Box<dyn FnOnce()
779-
/// -> i32>`.
780-
///
781-
/// ```
782-
/// #![feature(fnbox)]
783-
/// #![allow(deprecated)]
784-
///
785-
/// use std::boxed::FnBox;
786-
/// use std::collections::HashMap;
787-
///
788-
/// fn make_map() -> HashMap<i32, Box<dyn FnBox() -> i32>> {
789-
/// let mut map: HashMap<i32, Box<dyn FnBox() -> i32>> = HashMap::new();
790-
/// map.insert(1, Box::new(|| 22));
791-
/// map.insert(2, Box::new(|| 44));
792-
/// map
793-
/// }
794-
///
795-
/// fn main() {
796-
/// let mut map = make_map();
797-
/// for i in &[1, 2] {
798-
/// let f = map.remove(&i).unwrap();
799-
/// assert_eq!(f(), i * 22);
800-
/// }
801-
/// }
802-
/// ```
803-
///
804-
/// In Rust 1.35.0 or later, use `FnOnce`, `FnMut`, or `Fn` instead:
805-
///
806-
/// ```
807-
/// use std::collections::HashMap;
808-
///
809-
/// fn make_map() -> HashMap<i32, Box<dyn FnOnce() -> i32>> {
810-
/// let mut map: HashMap<i32, Box<dyn FnOnce() -> i32>> = HashMap::new();
811-
/// map.insert(1, Box::new(|| 22));
812-
/// map.insert(2, Box::new(|| 44));
813-
/// map
814-
/// }
815-
///
816-
/// fn main() {
817-
/// let mut map = make_map();
818-
/// for i in &[1, 2] {
819-
/// let f = map.remove(&i).unwrap();
820-
/// assert_eq!(f(), i * 22);
821-
/// }
822-
/// }
823-
/// ```
824-
#[rustc_paren_sugar]
825-
#[unstable(feature = "fnbox", issue = "28796")]
826-
#[rustc_deprecated(reason = "use `FnOnce`, `FnMut`, or `Fn` instead", since = "1.37.0")]
827-
pub trait FnBox<A>: FnOnce<A> {
828-
/// Performs the call operation.
829-
fn call_box(self: Box<Self>, args: A) -> Self::Output;
830-
}
831-
832-
#[unstable(feature = "fnbox", issue = "28796")]
833-
#[rustc_deprecated(reason = "use `FnOnce`, `FnMut`, or `Fn` instead", since = "1.37.0")]
834-
#[allow(deprecated, deprecated_in_future)]
835-
impl<A, F> FnBox<A> for F
836-
where F: FnOnce<A>
837-
{
838-
fn call_box(self: Box<F>, args: A) -> F::Output {
839-
self.call_once(args)
840-
}
841-
}
842-
843764
#[unstable(feature = "coerce_unsized", issue = "27732")]
844765
impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Box<U>> for Box<T> {}
845766

src/libcore/future/future.rs

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ use crate::task::{Context, Poll};
2525
#[doc(spotlight)]
2626
#[must_use = "futures do nothing unless you `.await` or poll them"]
2727
#[stable(feature = "futures_api", since = "1.36.0")]
28+
#[cfg_attr(not(bootstrap), lang = "future_trait")]
2829
pub trait Future {
2930
/// The type of value produced on completion.
3031
#[stable(feature = "futures_api", since = "1.36.0")]

0 commit comments

Comments
 (0)