Skip to content

Rollup of 10 pull requests #72768

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

Merged
merged 38 commits into from
May 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
bb43391
Update RELEASES.md for 1.44.0
XAMPPRocky May 9, 2020
bd5ed9e
Update RELEASES.md
XAMPPRocky May 9, 2020
0f18203
Miri: refactor read_discriminant and make it return Scalar
RalfJung Apr 14, 2020
5a3971c
comments and refactor variable names
RalfJung May 23, 2020
f8f8033
assert that types without discriminant use variant idx of 0
RalfJung May 23, 2020
d94923e
Format and more tracing
RalfJung May 23, 2020
64fbe2f
Add helper method for determining the type of a discriminant
RalfJung May 23, 2020
ad7179d
fix discriminant_ty for non-enums
RalfJung May 23, 2020
1c30c9e
Don't bail out of trait selection when predicate references an error
Aaron1011 May 26, 2020
ce81d15
Add test to make sure -Wunused-crate-dependencies works with tests
jsgf May 28, 2020
02cc593
Remove unused mut from long-linker-command-lines test
tmiasko May 29, 2020
ed503ac
Revert "Fix rebase fallout"
Aaron1011 May 29, 2020
4d4facb
Revert "Add test for macro_rules! invoking a proc-macro with capture …
Aaron1011 May 29, 2020
1ae7de9
Revert "Recursively expand nonterminals"
Aaron1011 May 29, 2020
1c2b65b
Revert "Move functions to librustc_parse"
Aaron1011 May 29, 2020
b802eeb
Fix missing import lost in revert
Aaron1011 May 29, 2020
283358b
Update RELEASES.md
XAMPPRocky May 29, 2020
5b37ee1
Update RELEASES.md
XAMPPRocky May 29, 2020
859863d
Update RELEASES.md
XAMPPRocky May 29, 2020
692f4ec
Update RELEASES.md
XAMPPRocky May 29, 2020
25bafc2
remove mk_bool
lcnr May 29, 2020
2f3dd7b
Remove remaining calls to `as_local_node_id`
marmeladema May 24, 2020
27ed143
fix diagnostics for `@ ..` binding pattern in tuples and tuple structs
chrissimpkins May 29, 2020
c4b6224
more type sanity checks in Miri
RalfJung May 29, 2020
6700e18
Add Extend::{extend_one,extend_reserve}
cuviper May 13, 2020
e434554
Use a canonical name for extend_reserve(additional)
cuviper May 26, 2020
10efaa3
Remove an old comment from HashMap::extend_reserve
cuviper May 26, 2020
a51b22a
Add extend_one tracking issue 72631
cuviper May 26, 2020
a578ac5
Rollup merge of #72033 - XAMPPRocky:relnotes-1.44.0, r=Mark-Simulacrum
JohnTitor May 30, 2020
3459eae
Rollup merge of #72162 - cuviper:extend_one, r=Mark-Simulacrum
JohnTitor May 30, 2020
a5fb7fc
Rollup merge of #72419 - RalfJung:read-discriminant, r=oli-obk,eddyb
JohnTitor May 30, 2020
7624ac7
Rollup merge of #72621 - Aaron1011:fix/trait-select-error, r=nikomats…
JohnTitor May 30, 2020
ca8640e
Rollup merge of #72677 - chrissimpkins:fix-72574, r=estebank
JohnTitor May 30, 2020
875c6b2
Rollup merge of #72710 - jsgf:unused-deps-test, r=jsgf
JohnTitor May 30, 2020
047b3bd
Rollup merge of #72724 - Aaron1011:revert-tokenstream-expand, r=petro…
JohnTitor May 30, 2020
990195f
Rollup merge of #72741 - tmiasko:unused-mut, r=Mark-Simulacrum
JohnTitor May 30, 2020
c20a97d
Rollup merge of #72750 - marmeladema:remove-as-local-node-id, r=petro…
JohnTitor May 30, 2020
025058f
Rollup merge of #72752 - lcnr:remove-mk_bool, r=estebank
JohnTitor May 30, 2020
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
1 change: 0 additions & 1 deletion Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4144,7 +4144,6 @@ dependencies = [
"rustc_lexer",
"rustc_session",
"rustc_span",
"smallvec 1.4.0",
"unicode-normalization",
]

Expand Down
160 changes: 160 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,163 @@
Version 1.44.0 (2020-06-04)
==========================

Language
--------
- [You can now use `async/.await` with `#[no_std]` enabled.][69033]
- [Added the `unused_braces` lint.][70081]

**Syntax-only changes**

- [Expansion-driven outline module parsing][69838]
```rust
#[cfg(FALSE)]
mod foo {
mod bar {
mod baz; // `foo/bar/baz.rs` doesn't exist, but no error!
}
}
```

These are still rejected semantically, so you will likely receive an error but
these changes can be seen and parsed by macros and conditional compilation.

Compiler
--------
- [Rustc now respects the `-C codegen-units` flag in incremental mode.][70156]
Additionally when in incremental mode rustc defaults to 256 codegen units.
- [Refactored `catch_unwind`, to have zero-cost unless unwinding is enabled and
a panic is thrown.][67502]
- [Added tier 3\* support for the `aarch64-unknown-none` and
`aarch64-unknown-none-softfloat` targets.][68334]
- [Added tier 3 support for `arm64-apple-tvos` and
`x86_64-apple-tvos` targets.][68191]


Libraries
---------
- [Special cased `vec![]` to map directly to `Vec::new()`.][70632] This allows
`vec![]` to be able to be used in `const` contexts.
- [`convert::Infallible` now implements `Hash`.][70281]
- [`OsString` now implements `DerefMut` and `IndexMut` returning
a `&mut OsStr`.][70048]
- [Unicode 13 is now supported.][69929]
- [`String` now implements `From<&mut str>`.][69661]
- [`IoSlice` now implements `Copy`.][69403]
- [`Vec<T>` now implements `From<[T; N]>`.][68692] Where `N` is less than 32.
- [`proc_macro::LexError` now implements `fmt::Display` and `Error`.][68899]
- [`from_le_bytes`, `to_le_bytes`, `from_be_bytes`, `to_be_bytes`,
`from_ne_bytes`, and `to_ne_bytes` methods are now `const` for all
integer types.][69373]

Stabilized APIs
---------------
- [`PathBuf::with_capacity`]
- [`PathBuf::capacity`]
- [`PathBuf::clear`]
- [`PathBuf::reserve`]
- [`PathBuf::reserve_exact`]
- [`PathBuf::shrink_to_fit`]
- [`f32::to_int_unchecked`]
- [`f64::to_int_unchecked`]
- [`Layout::align_to`]
- [`Layout::pad_to_align`]
- [`Layout::array`]
- [`Layout::extend`]

Cargo
-----
- [Added the `cargo tree` command which will print a tree graph of
your dependencies.][cargo/8062] E.g.
```
mdbook v0.3.2 (/Users/src/rust/mdbook)
├── ammonia v3.0.0
│ ├── html5ever v0.24.0
│ │ ├── log v0.4.8
│ │ │ └── cfg-if v0.1.9
│ │ ├── mac v0.1.1
│ │ └── markup5ever v0.9.0
│ │ ├── log v0.4.8 (*)
│ │ ├── phf v0.7.24
│ │ │ └── phf_shared v0.7.24
│ │ │ ├── siphasher v0.2.3
│ │ │ └── unicase v1.4.2
│ │ │ [build-dependencies]
│ │ │ └── version_check v0.1.5
...
```

Misc
----
- [Rustdoc now allows you to specify `--crate-version` to have rustdoc include
the version in the sidebar.][69494]

Compatibility Notes
-------------------
- [Rustc now correctly generates static libraries on Windows GNU targets with
the `.a` extension, rather than the previous `.lib`.][70937]
- [Removed the `-C no_integrated_as` flag from rustc.][70345]
- [The `file_name` property in JSON output of macro errors now points the actual
source file rather than the previous format of `<NAME macros>`.][70969]
**Note:** this may not point a file that actually exists on the user's system.
- [The minimum required external LLVM version has been bumped to LLVM 8.][71147]
- [`mem::{zeroed, uninitialised, MaybeUninit}` will now panic when used with types
that do not allow zero initialization such as `NonZeroU8`.][66059] This was
previously a warning.
- [In 1.45.0 (the next release) converting a `f64` to `u32` using the `as`
operator has been defined as a saturating operation.][71269] This was previously
undefined behaviour, you can use the `{f64, f32}::to_int_unchecked` methods to
continue using the current behaviour which may desirable in rare performance
sensitive situations.

Internal Only
-------------
These changes provide no direct user facing benefits, but represent significant
improvements to the internals and overall performance of rustc and
related tools.

- [dep_graph Avoid allocating a set on when the number reads are small.][69778]
- [Replace big JS dict with JSON parsing.][71250]

[69373]: https://github.com/rust-lang/rust/pull/69373/
[66059]: https://github.com/rust-lang/rust/pull/66059/
[68191]: https://github.com/rust-lang/rust/pull/68191/
[68899]: https://github.com/rust-lang/rust/pull/68899/
[71147]: https://github.com/rust-lang/rust/pull/71147/
[71250]: https://github.com/rust-lang/rust/pull/71250/
[70937]: https://github.com/rust-lang/rust/pull/70937/
[70969]: https://github.com/rust-lang/rust/pull/70969/
[70632]: https://github.com/rust-lang/rust/pull/70632/
[70281]: https://github.com/rust-lang/rust/pull/70281/
[70345]: https://github.com/rust-lang/rust/pull/70345/
[70048]: https://github.com/rust-lang/rust/pull/70048/
[70081]: https://github.com/rust-lang/rust/pull/70081/
[70156]: https://github.com/rust-lang/rust/pull/70156/
[71269]: https://github.com/rust-lang/rust/pull/71269/
[69838]: https://github.com/rust-lang/rust/pull/69838/
[69929]: https://github.com/rust-lang/rust/pull/69929/
[69661]: https://github.com/rust-lang/rust/pull/69661/
[69778]: https://github.com/rust-lang/rust/pull/69778/
[69494]: https://github.com/rust-lang/rust/pull/69494/
[69403]: https://github.com/rust-lang/rust/pull/69403/
[69033]: https://github.com/rust-lang/rust/pull/69033/
[68692]: https://github.com/rust-lang/rust/pull/68692/
[68334]: https://github.com/rust-lang/rust/pull/68334/
[67502]: https://github.com/rust-lang/rust/pull/67502/
[cargo/8062]: https://github.com/rust-lang/cargo/pull/8062/
[`PathBuf::with_capacity`]: https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.with_capacity
[`PathBuf::capacity`]: https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.capacity
[`PathBuf::clear`]: https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.clear
[`PathBuf::reserve`]: https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.reserve
[`PathBuf::reserve_exact`]: https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.reserve_exact
[`PathBuf::shrink_to_fit`]: https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.shrink_to_fit
[`f32::to_int_unchecked`]: https://doc.rust-lang.org/std/primitive.f32.html#method.to_int_unchecked
[`f64::to_int_unchecked`]: https://doc.rust-lang.org/std/primitive.f64.html#method.to_int_unchecked
[`Layout::align_to`]: https://doc.rust-lang.org/std/alloc/struct.Layout.html#method.align_to
[`Layout::pad_to_align`]: https://doc.rust-lang.org/std/alloc/struct.Layout.html#method.pad_to_align
[`Layout::array`]: https://doc.rust-lang.org/std/alloc/struct.Layout.html#method.array
[`Layout::extend`]: https://doc.rust-lang.org/std/alloc/struct.Layout.html#method.extend


Version 1.43.1 (2020-05-07)
===========================

Expand Down
20 changes: 20 additions & 0 deletions src/liballoc/collections/binary_heap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1376,6 +1376,16 @@ impl<T: Ord> Extend<T> for BinaryHeap<T> {
fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I) {
<Self as SpecExtend<I>>::spec_extend(self, iter);
}

#[inline]
fn extend_one(&mut self, item: T) {
self.push(item);
}

#[inline]
fn extend_reserve(&mut self, additional: usize) {
self.reserve(additional);
}
}

impl<T: Ord, I: IntoIterator<Item = T>> SpecExtend<I> for BinaryHeap<T> {
Expand Down Expand Up @@ -1406,4 +1416,14 @@ impl<'a, T: 'a + Ord + Copy> Extend<&'a T> for BinaryHeap<T> {
fn extend<I: IntoIterator<Item = &'a T>>(&mut self, iter: I) {
self.extend(iter.into_iter().cloned());
}

#[inline]
fn extend_one(&mut self, &item: &'a T) {
self.push(item);
}

#[inline]
fn extend_reserve(&mut self, additional: usize) {
self.reserve(additional);
}
}
10 changes: 10 additions & 0 deletions src/liballoc/collections/btree/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1901,13 +1901,23 @@ impl<K: Ord, V> Extend<(K, V)> for BTreeMap<K, V> {
self.insert(k, v);
});
}

#[inline]
fn extend_one(&mut self, (k, v): (K, V)) {
self.insert(k, v);
}
}

#[stable(feature = "extend_ref", since = "1.2.0")]
impl<'a, K: Ord + Copy, V: Copy> Extend<(&'a K, &'a V)> for BTreeMap<K, V> {
fn extend<I: IntoIterator<Item = (&'a K, &'a V)>>(&mut self, iter: I) {
self.extend(iter.into_iter().map(|(&key, &value)| (key, value)));
}

#[inline]
fn extend_one(&mut self, (&k, &v): (&'a K, &'a V)) {
self.insert(k, v);
}
}

#[stable(feature = "rust1", since = "1.0.0")]
Expand Down
10 changes: 10 additions & 0 deletions src/liballoc/collections/btree/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1152,13 +1152,23 @@ impl<T: Ord> Extend<T> for BTreeSet<T> {
self.insert(elem);
});
}

#[inline]
fn extend_one(&mut self, elem: T) {
self.insert(elem);
}
}

#[stable(feature = "extend_ref", since = "1.2.0")]
impl<'a, T: 'a + Ord + Copy> Extend<&'a T> for BTreeSet<T> {
fn extend<I: IntoIterator<Item = &'a T>>(&mut self, iter: I) {
self.extend(iter.into_iter().cloned());
}

#[inline]
fn extend_one(&mut self, &elem: &'a T) {
self.insert(elem);
}
}

#[stable(feature = "rust1", since = "1.0.0")]
Expand Down
10 changes: 10 additions & 0 deletions src/liballoc/collections/linked_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1748,6 +1748,11 @@ impl<T> Extend<T> for LinkedList<T> {
fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I) {
<Self as SpecExtend<I>>::spec_extend(self, iter);
}

#[inline]
fn extend_one(&mut self, elem: T) {
self.push_back(elem);
}
}

impl<I: IntoIterator> SpecExtend<I> for LinkedList<I::Item> {
Expand All @@ -1767,6 +1772,11 @@ impl<'a, T: 'a + Copy> Extend<&'a T> for LinkedList<T> {
fn extend<I: IntoIterator<Item = &'a T>>(&mut self, iter: I) {
self.extend(iter.into_iter().cloned());
}

#[inline]
fn extend_one(&mut self, &elem: &'a T) {
self.push_back(elem);
}
}

#[stable(feature = "rust1", since = "1.0.0")]
Expand Down
20 changes: 20 additions & 0 deletions src/liballoc/collections/vec_deque.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2881,13 +2881,33 @@ impl<A> Extend<A> for VecDeque<A> {
}
}
}

#[inline]
fn extend_one(&mut self, elem: A) {
self.push_back(elem);
}

#[inline]
fn extend_reserve(&mut self, additional: usize) {
self.reserve(additional);
}
}

#[stable(feature = "extend_ref", since = "1.2.0")]
impl<'a, T: 'a + Copy> Extend<&'a T> for VecDeque<T> {
fn extend<I: IntoIterator<Item = &'a T>>(&mut self, iter: I) {
self.extend(iter.into_iter().cloned());
}

#[inline]
fn extend_one(&mut self, &elem: &T) {
self.push_back(elem);
}

#[inline]
fn extend_reserve(&mut self, additional: usize) {
self.reserve(additional);
}
}

#[stable(feature = "rust1", since = "1.0.0")]
Expand Down
1 change: 1 addition & 0 deletions src/liballoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
#![feature(container_error_extra)]
#![feature(dropck_eyepatch)]
#![feature(exact_size_is_empty)]
#![feature(extend_one)]
#![feature(fmt_internals)]
#![feature(fn_traits)]
#![feature(fundamental)]
Expand Down
35 changes: 35 additions & 0 deletions src/liballoc/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1799,34 +1799,69 @@ impl Extend<char> for String {
self.reserve(lower_bound);
iterator.for_each(move |c| self.push(c));
}

#[inline]
fn extend_one(&mut self, c: char) {
self.push(c);
}

#[inline]
fn extend_reserve(&mut self, additional: usize) {
self.reserve(additional);
}
}

#[stable(feature = "extend_ref", since = "1.2.0")]
impl<'a> Extend<&'a char> for String {
fn extend<I: IntoIterator<Item = &'a char>>(&mut self, iter: I) {
self.extend(iter.into_iter().cloned());
}

#[inline]
fn extend_one(&mut self, &c: &'a char) {
self.push(c);
}

#[inline]
fn extend_reserve(&mut self, additional: usize) {
self.reserve(additional);
}
}

#[stable(feature = "rust1", since = "1.0.0")]
impl<'a> Extend<&'a str> for String {
fn extend<I: IntoIterator<Item = &'a str>>(&mut self, iter: I) {
iter.into_iter().for_each(move |s| self.push_str(s));
}

#[inline]
fn extend_one(&mut self, s: &'a str) {
self.push_str(s);
}
}

#[stable(feature = "extend_string", since = "1.4.0")]
impl Extend<String> for String {
fn extend<I: IntoIterator<Item = String>>(&mut self, iter: I) {
iter.into_iter().for_each(move |s| self.push_str(&s));
}

#[inline]
fn extend_one(&mut self, s: String) {
self.push_str(&s);
}
}

#[stable(feature = "herd_cows", since = "1.19.0")]
impl<'a> Extend<Cow<'a, str>> for String {
fn extend<I: IntoIterator<Item = Cow<'a, str>>>(&mut self, iter: I) {
iter.into_iter().for_each(move |s| self.push_str(&s));
}

#[inline]
fn extend_one(&mut self, s: Cow<'a, str>) {
self.push_str(&s);
}
}

/// A convenience impl that delegates to the impl for `&str`.
Expand Down
Loading