Skip to content

Commit 91fb72a

Browse files
committed
Auto merge of rust-lang#72768 - JohnTitor:rollup-6kwokh6, r=JohnTitor
Rollup of 10 pull requests Successful merges: - rust-lang#72033 (Update RELEASES.md for 1.44.0) - rust-lang#72162 (Add Extend::{extend_one,extend_reserve}) - rust-lang#72419 (Miri read_discriminant: return a scalar instead of raw underlying bytes) - rust-lang#72621 (Don't bail out of trait selection when predicate references an error) - rust-lang#72677 (Fix diagnostics for `@ ..` binding pattern in tuples and tuple structs) - rust-lang#72710 (Add test to make sure -Wunused-crate-dependencies works with tests) - rust-lang#72724 (Revert recursive `TokenKind::Interpolated` expansion for now) - rust-lang#72741 (Remove unused mut from long-linker-command-lines test) - rust-lang#72750 (Remove remaining calls to `as_local_node_id`) - rust-lang#72752 (remove mk_bool) Failed merges: r? @ghost
2 parents 0e9e408 + 025058f commit 91fb72a

File tree

55 files changed

+922
-406
lines changed

Some content is hidden

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

55 files changed

+922
-406
lines changed

Cargo.lock

-1
Original file line numberDiff line numberDiff line change
@@ -4144,7 +4144,6 @@ dependencies = [
41444144
"rustc_lexer",
41454145
"rustc_session",
41464146
"rustc_span",
4147-
"smallvec 1.4.0",
41484147
"unicode-normalization",
41494148
]
41504149

RELEASES.md

+160
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,163 @@
1+
Version 1.44.0 (2020-06-04)
2+
==========================
3+
4+
Language
5+
--------
6+
- [You can now use `async/.await` with `#[no_std]` enabled.][69033]
7+
- [Added the `unused_braces` lint.][70081]
8+
9+
**Syntax-only changes**
10+
11+
- [Expansion-driven outline module parsing][69838]
12+
```rust
13+
#[cfg(FALSE)]
14+
mod foo {
15+
mod bar {
16+
mod baz; // `foo/bar/baz.rs` doesn't exist, but no error!
17+
}
18+
}
19+
```
20+
21+
These are still rejected semantically, so you will likely receive an error but
22+
these changes can be seen and parsed by macros and conditional compilation.
23+
24+
Compiler
25+
--------
26+
- [Rustc now respects the `-C codegen-units` flag in incremental mode.][70156]
27+
Additionally when in incremental mode rustc defaults to 256 codegen units.
28+
- [Refactored `catch_unwind`, to have zero-cost unless unwinding is enabled and
29+
a panic is thrown.][67502]
30+
- [Added tier 3\* support for the `aarch64-unknown-none` and
31+
`aarch64-unknown-none-softfloat` targets.][68334]
32+
- [Added tier 3 support for `arm64-apple-tvos` and
33+
`x86_64-apple-tvos` targets.][68191]
34+
35+
36+
Libraries
37+
---------
38+
- [Special cased `vec![]` to map directly to `Vec::new()`.][70632] This allows
39+
`vec![]` to be able to be used in `const` contexts.
40+
- [`convert::Infallible` now implements `Hash`.][70281]
41+
- [`OsString` now implements `DerefMut` and `IndexMut` returning
42+
a `&mut OsStr`.][70048]
43+
- [Unicode 13 is now supported.][69929]
44+
- [`String` now implements `From<&mut str>`.][69661]
45+
- [`IoSlice` now implements `Copy`.][69403]
46+
- [`Vec<T>` now implements `From<[T; N]>`.][68692] Where `N` is less than 32.
47+
- [`proc_macro::LexError` now implements `fmt::Display` and `Error`.][68899]
48+
- [`from_le_bytes`, `to_le_bytes`, `from_be_bytes`, `to_be_bytes`,
49+
`from_ne_bytes`, and `to_ne_bytes` methods are now `const` for all
50+
integer types.][69373]
51+
52+
Stabilized APIs
53+
---------------
54+
- [`PathBuf::with_capacity`]
55+
- [`PathBuf::capacity`]
56+
- [`PathBuf::clear`]
57+
- [`PathBuf::reserve`]
58+
- [`PathBuf::reserve_exact`]
59+
- [`PathBuf::shrink_to_fit`]
60+
- [`f32::to_int_unchecked`]
61+
- [`f64::to_int_unchecked`]
62+
- [`Layout::align_to`]
63+
- [`Layout::pad_to_align`]
64+
- [`Layout::array`]
65+
- [`Layout::extend`]
66+
67+
Cargo
68+
-----
69+
- [Added the `cargo tree` command which will print a tree graph of
70+
your dependencies.][cargo/8062] E.g.
71+
```
72+
mdbook v0.3.2 (/Users/src/rust/mdbook)
73+
├── ammonia v3.0.0
74+
│ ├── html5ever v0.24.0
75+
│ │ ├── log v0.4.8
76+
│ │ │ └── cfg-if v0.1.9
77+
│ │ ├── mac v0.1.1
78+
│ │ └── markup5ever v0.9.0
79+
│ │ ├── log v0.4.8 (*)
80+
│ │ ├── phf v0.7.24
81+
│ │ │ └── phf_shared v0.7.24
82+
│ │ │ ├── siphasher v0.2.3
83+
│ │ │ └── unicase v1.4.2
84+
│ │ │ [build-dependencies]
85+
│ │ │ └── version_check v0.1.5
86+
...
87+
```
88+
89+
Misc
90+
----
91+
- [Rustdoc now allows you to specify `--crate-version` to have rustdoc include
92+
the version in the sidebar.][69494]
93+
94+
Compatibility Notes
95+
-------------------
96+
- [Rustc now correctly generates static libraries on Windows GNU targets with
97+
the `.a` extension, rather than the previous `.lib`.][70937]
98+
- [Removed the `-C no_integrated_as` flag from rustc.][70345]
99+
- [The `file_name` property in JSON output of macro errors now points the actual
100+
source file rather than the previous format of `<NAME macros>`.][70969]
101+
**Note:** this may not point a file that actually exists on the user's system.
102+
- [The minimum required external LLVM version has been bumped to LLVM 8.][71147]
103+
- [`mem::{zeroed, uninitialised, MaybeUninit}` will now panic when used with types
104+
that do not allow zero initialization such as `NonZeroU8`.][66059] This was
105+
previously a warning.
106+
- [In 1.45.0 (the next release) converting a `f64` to `u32` using the `as`
107+
operator has been defined as a saturating operation.][71269] This was previously
108+
undefined behaviour, you can use the `{f64, f32}::to_int_unchecked` methods to
109+
continue using the current behaviour which may desirable in rare performance
110+
sensitive situations.
111+
112+
Internal Only
113+
-------------
114+
These changes provide no direct user facing benefits, but represent significant
115+
improvements to the internals and overall performance of rustc and
116+
related tools.
117+
118+
- [dep_graph Avoid allocating a set on when the number reads are small.][69778]
119+
- [Replace big JS dict with JSON parsing.][71250]
120+
121+
[69373]: https://github.com/rust-lang/rust/pull/69373/
122+
[66059]: https://github.com/rust-lang/rust/pull/66059/
123+
[68191]: https://github.com/rust-lang/rust/pull/68191/
124+
[68899]: https://github.com/rust-lang/rust/pull/68899/
125+
[71147]: https://github.com/rust-lang/rust/pull/71147/
126+
[71250]: https://github.com/rust-lang/rust/pull/71250/
127+
[70937]: https://github.com/rust-lang/rust/pull/70937/
128+
[70969]: https://github.com/rust-lang/rust/pull/70969/
129+
[70632]: https://github.com/rust-lang/rust/pull/70632/
130+
[70281]: https://github.com/rust-lang/rust/pull/70281/
131+
[70345]: https://github.com/rust-lang/rust/pull/70345/
132+
[70048]: https://github.com/rust-lang/rust/pull/70048/
133+
[70081]: https://github.com/rust-lang/rust/pull/70081/
134+
[70156]: https://github.com/rust-lang/rust/pull/70156/
135+
[71269]: https://github.com/rust-lang/rust/pull/71269/
136+
[69838]: https://github.com/rust-lang/rust/pull/69838/
137+
[69929]: https://github.com/rust-lang/rust/pull/69929/
138+
[69661]: https://github.com/rust-lang/rust/pull/69661/
139+
[69778]: https://github.com/rust-lang/rust/pull/69778/
140+
[69494]: https://github.com/rust-lang/rust/pull/69494/
141+
[69403]: https://github.com/rust-lang/rust/pull/69403/
142+
[69033]: https://github.com/rust-lang/rust/pull/69033/
143+
[68692]: https://github.com/rust-lang/rust/pull/68692/
144+
[68334]: https://github.com/rust-lang/rust/pull/68334/
145+
[67502]: https://github.com/rust-lang/rust/pull/67502/
146+
[cargo/8062]: https://github.com/rust-lang/cargo/pull/8062/
147+
[`PathBuf::with_capacity`]: https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.with_capacity
148+
[`PathBuf::capacity`]: https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.capacity
149+
[`PathBuf::clear`]: https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.clear
150+
[`PathBuf::reserve`]: https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.reserve
151+
[`PathBuf::reserve_exact`]: https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.reserve_exact
152+
[`PathBuf::shrink_to_fit`]: https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.shrink_to_fit
153+
[`f32::to_int_unchecked`]: https://doc.rust-lang.org/std/primitive.f32.html#method.to_int_unchecked
154+
[`f64::to_int_unchecked`]: https://doc.rust-lang.org/std/primitive.f64.html#method.to_int_unchecked
155+
[`Layout::align_to`]: https://doc.rust-lang.org/std/alloc/struct.Layout.html#method.align_to
156+
[`Layout::pad_to_align`]: https://doc.rust-lang.org/std/alloc/struct.Layout.html#method.pad_to_align
157+
[`Layout::array`]: https://doc.rust-lang.org/std/alloc/struct.Layout.html#method.array
158+
[`Layout::extend`]: https://doc.rust-lang.org/std/alloc/struct.Layout.html#method.extend
159+
160+
1161
Version 1.43.1 (2020-05-07)
2162
===========================
3163

src/liballoc/collections/binary_heap.rs

+20
Original file line numberDiff line numberDiff line change
@@ -1376,6 +1376,16 @@ impl<T: Ord> Extend<T> for BinaryHeap<T> {
13761376
fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I) {
13771377
<Self as SpecExtend<I>>::spec_extend(self, iter);
13781378
}
1379+
1380+
#[inline]
1381+
fn extend_one(&mut self, item: T) {
1382+
self.push(item);
1383+
}
1384+
1385+
#[inline]
1386+
fn extend_reserve(&mut self, additional: usize) {
1387+
self.reserve(additional);
1388+
}
13791389
}
13801390

13811391
impl<T: Ord, I: IntoIterator<Item = T>> SpecExtend<I> for BinaryHeap<T> {
@@ -1406,4 +1416,14 @@ impl<'a, T: 'a + Ord + Copy> Extend<&'a T> for BinaryHeap<T> {
14061416
fn extend<I: IntoIterator<Item = &'a T>>(&mut self, iter: I) {
14071417
self.extend(iter.into_iter().cloned());
14081418
}
1419+
1420+
#[inline]
1421+
fn extend_one(&mut self, &item: &'a T) {
1422+
self.push(item);
1423+
}
1424+
1425+
#[inline]
1426+
fn extend_reserve(&mut self, additional: usize) {
1427+
self.reserve(additional);
1428+
}
14091429
}

src/liballoc/collections/btree/map.rs

+10
Original file line numberDiff line numberDiff line change
@@ -1901,13 +1901,23 @@ impl<K: Ord, V> Extend<(K, V)> for BTreeMap<K, V> {
19011901
self.insert(k, v);
19021902
});
19031903
}
1904+
1905+
#[inline]
1906+
fn extend_one(&mut self, (k, v): (K, V)) {
1907+
self.insert(k, v);
1908+
}
19041909
}
19051910

19061911
#[stable(feature = "extend_ref", since = "1.2.0")]
19071912
impl<'a, K: Ord + Copy, V: Copy> Extend<(&'a K, &'a V)> for BTreeMap<K, V> {
19081913
fn extend<I: IntoIterator<Item = (&'a K, &'a V)>>(&mut self, iter: I) {
19091914
self.extend(iter.into_iter().map(|(&key, &value)| (key, value)));
19101915
}
1916+
1917+
#[inline]
1918+
fn extend_one(&mut self, (&k, &v): (&'a K, &'a V)) {
1919+
self.insert(k, v);
1920+
}
19111921
}
19121922

19131923
#[stable(feature = "rust1", since = "1.0.0")]

src/liballoc/collections/btree/set.rs

+10
Original file line numberDiff line numberDiff line change
@@ -1152,13 +1152,23 @@ impl<T: Ord> Extend<T> for BTreeSet<T> {
11521152
self.insert(elem);
11531153
});
11541154
}
1155+
1156+
#[inline]
1157+
fn extend_one(&mut self, elem: T) {
1158+
self.insert(elem);
1159+
}
11551160
}
11561161

11571162
#[stable(feature = "extend_ref", since = "1.2.0")]
11581163
impl<'a, T: 'a + Ord + Copy> Extend<&'a T> for BTreeSet<T> {
11591164
fn extend<I: IntoIterator<Item = &'a T>>(&mut self, iter: I) {
11601165
self.extend(iter.into_iter().cloned());
11611166
}
1167+
1168+
#[inline]
1169+
fn extend_one(&mut self, &elem: &'a T) {
1170+
self.insert(elem);
1171+
}
11621172
}
11631173

11641174
#[stable(feature = "rust1", since = "1.0.0")]

src/liballoc/collections/linked_list.rs

+10
Original file line numberDiff line numberDiff line change
@@ -1748,6 +1748,11 @@ impl<T> Extend<T> for LinkedList<T> {
17481748
fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I) {
17491749
<Self as SpecExtend<I>>::spec_extend(self, iter);
17501750
}
1751+
1752+
#[inline]
1753+
fn extend_one(&mut self, elem: T) {
1754+
self.push_back(elem);
1755+
}
17511756
}
17521757

17531758
impl<I: IntoIterator> SpecExtend<I> for LinkedList<I::Item> {
@@ -1767,6 +1772,11 @@ impl<'a, T: 'a + Copy> Extend<&'a T> for LinkedList<T> {
17671772
fn extend<I: IntoIterator<Item = &'a T>>(&mut self, iter: I) {
17681773
self.extend(iter.into_iter().cloned());
17691774
}
1775+
1776+
#[inline]
1777+
fn extend_one(&mut self, &elem: &'a T) {
1778+
self.push_back(elem);
1779+
}
17701780
}
17711781

17721782
#[stable(feature = "rust1", since = "1.0.0")]

src/liballoc/collections/vec_deque.rs

+20
Original file line numberDiff line numberDiff line change
@@ -2881,13 +2881,33 @@ impl<A> Extend<A> for VecDeque<A> {
28812881
}
28822882
}
28832883
}
2884+
2885+
#[inline]
2886+
fn extend_one(&mut self, elem: A) {
2887+
self.push_back(elem);
2888+
}
2889+
2890+
#[inline]
2891+
fn extend_reserve(&mut self, additional: usize) {
2892+
self.reserve(additional);
2893+
}
28842894
}
28852895

28862896
#[stable(feature = "extend_ref", since = "1.2.0")]
28872897
impl<'a, T: 'a + Copy> Extend<&'a T> for VecDeque<T> {
28882898
fn extend<I: IntoIterator<Item = &'a T>>(&mut self, iter: I) {
28892899
self.extend(iter.into_iter().cloned());
28902900
}
2901+
2902+
#[inline]
2903+
fn extend_one(&mut self, &elem: &T) {
2904+
self.push_back(elem);
2905+
}
2906+
2907+
#[inline]
2908+
fn extend_reserve(&mut self, additional: usize) {
2909+
self.reserve(additional);
2910+
}
28912911
}
28922912

28932913
#[stable(feature = "rust1", since = "1.0.0")]

src/liballoc/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
#![feature(container_error_extra)]
9494
#![feature(dropck_eyepatch)]
9595
#![feature(exact_size_is_empty)]
96+
#![feature(extend_one)]
9697
#![feature(fmt_internals)]
9798
#![feature(fn_traits)]
9899
#![feature(fundamental)]

src/liballoc/string.rs

+35
Original file line numberDiff line numberDiff line change
@@ -1799,34 +1799,69 @@ impl Extend<char> for String {
17991799
self.reserve(lower_bound);
18001800
iterator.for_each(move |c| self.push(c));
18011801
}
1802+
1803+
#[inline]
1804+
fn extend_one(&mut self, c: char) {
1805+
self.push(c);
1806+
}
1807+
1808+
#[inline]
1809+
fn extend_reserve(&mut self, additional: usize) {
1810+
self.reserve(additional);
1811+
}
18021812
}
18031813

18041814
#[stable(feature = "extend_ref", since = "1.2.0")]
18051815
impl<'a> Extend<&'a char> for String {
18061816
fn extend<I: IntoIterator<Item = &'a char>>(&mut self, iter: I) {
18071817
self.extend(iter.into_iter().cloned());
18081818
}
1819+
1820+
#[inline]
1821+
fn extend_one(&mut self, &c: &'a char) {
1822+
self.push(c);
1823+
}
1824+
1825+
#[inline]
1826+
fn extend_reserve(&mut self, additional: usize) {
1827+
self.reserve(additional);
1828+
}
18091829
}
18101830

18111831
#[stable(feature = "rust1", since = "1.0.0")]
18121832
impl<'a> Extend<&'a str> for String {
18131833
fn extend<I: IntoIterator<Item = &'a str>>(&mut self, iter: I) {
18141834
iter.into_iter().for_each(move |s| self.push_str(s));
18151835
}
1836+
1837+
#[inline]
1838+
fn extend_one(&mut self, s: &'a str) {
1839+
self.push_str(s);
1840+
}
18161841
}
18171842

18181843
#[stable(feature = "extend_string", since = "1.4.0")]
18191844
impl Extend<String> for String {
18201845
fn extend<I: IntoIterator<Item = String>>(&mut self, iter: I) {
18211846
iter.into_iter().for_each(move |s| self.push_str(&s));
18221847
}
1848+
1849+
#[inline]
1850+
fn extend_one(&mut self, s: String) {
1851+
self.push_str(&s);
1852+
}
18231853
}
18241854

18251855
#[stable(feature = "herd_cows", since = "1.19.0")]
18261856
impl<'a> Extend<Cow<'a, str>> for String {
18271857
fn extend<I: IntoIterator<Item = Cow<'a, str>>>(&mut self, iter: I) {
18281858
iter.into_iter().for_each(move |s| self.push_str(&s));
18291859
}
1860+
1861+
#[inline]
1862+
fn extend_one(&mut self, s: Cow<'a, str>) {
1863+
self.push_str(&s);
1864+
}
18301865
}
18311866

18321867
/// A convenience impl that delegates to the impl for `&str`.

0 commit comments

Comments
 (0)