From d74c17ba0c0a60f484dd35c6edb5093bfeeda508 Mon Sep 17 00:00:00 2001 From: Erin Power Date: Tue, 24 Mar 2020 13:24:20 +0100 Subject: [PATCH 01/12] Update RELEASES.md for 1.43.0 --- RELEASES.md | 119 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) diff --git a/RELEASES.md b/RELEASES.md index 9ff0d14b353cd..44f3390f4df33 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,3 +1,122 @@ +Version 1.43.0 (2020-04-23) +========================== + +Language +-------- +- [Fixed using binary operations with `&{number}` (e.g. `&1.0`) not having + the correctly inferred type.][68129] + +**Syntax only changes** +- [Allow `type Foo: Ord` syntactically.][69361] +- [Unify item parsing & filter illegal item kinds.][69366] +- [Fuse associated and extern items up to defaultness.][69194] +- [Permit attributes on `if` expressions.][69201] +- [Syntactically allow `self` in all `fn` contexts.][68764] +- [Merge `fn` syntax + cleanup item parsing.][68728] + +These are still rejected *semantically*, so you will likely receive an error but +these changes can be seen and parsed by procedural macros and +conditional compilation. + + +Compiler +-------- +- [You can now pass multiple lint flags to rustc to override the previous + flags.][67885] For example; `rustc -D unused -A unused-variables` denies + everything in the `unused` lint group unused except `unused-variables` which + is explicitly allowed. Passing `rustc -A unused-variables -D unused` denies + everything in the `unused` lint group **including** `unused-variables` since + the allow flag is specified before the deny flag (and therefore overridden). +- [rustc will now prefer your system MinGW libraries over its bundled libraries + if they are available on `windows-gnu`.][67429] +- [rustc now buffers errors/warnings printed in JSON.][69227] + +Libraries +--------- +- [`Arc<[T; N]>`, `Box<[T; N]>`, and `Rc<[T; N]>`, now implement + `TryFrom>`,`TryFrom>`, and `TryFrom>` + respectively.][69538] Where `N` is `0..=32`. +- [All `to_be_bytes`, `to_le_bytes`, `to_ne_bytes`, `from_be_bytes`, + `from_le_bytes`, and `from_ne_bytes` methods for integers are + now `const`.][69373] +- [You can now use associated constants on floats and integers directly, rather + than having to import the module.][68952] e.g. You can now write `u32::MAX` or + `f32::NAN` no imports. +- [`u8::is_ascii` is now `const`.][68984] +- [`String` now implements `AsMut`.][68742] +- [Added the `primitive` module to `std` and `core`.][67637] This module + reexports Rust's primitive types. This is mainly useful for use in macros + where you want avoid these types being shadowed. +- [The some of the trait bounds on `HashMap` and `HashSet`.][67642] +- [`string::FromUtf8Error` now implements `Clone + Eq`.][68738] + +Stabilized APIs +--------------- +- [`Once::is_completed`] +- [`f32::LOG10_2`] +- [`f32::LOG2_10`] +- [`f64::LOG10_2`] +- [`f64::LOG2_10`] +- [`iter::once_with`] + +Misc +---- +- [Certain checks in the `const_err` lint were deemed unrelated to const + evaluation][69185], and have been moved to the `unconditional_panic` and + `arithmetic_overflow` lints. + +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. + +- [All components are now built with `opt-level=3` instead of `2`.][67878] +- [Improved how rustc generates drop code.][67332] +- [Improved performance from `#[inline]`-ing certain hot functions.][69256] +- [traits: preallocate 2 Vecs of known initial size][69022] +- [Avoid exponential behaviour when relating types][68772] +- [Skip `Drop` terminators for enum variants without drop glue][68943] +- [Improve performance of coherence checks][68966] +- [Deduplicate types in the generator witness][68672] +- [Invert control in struct_lint_level.][68725] + +[67332]: https://github.com/rust-lang/rust/pull/67332/ +[67429]: https://github.com/rust-lang/rust/pull/67429/ +[67637]: https://github.com/rust-lang/rust/pull/67637/ +[67642]: https://github.com/rust-lang/rust/pull/67642/ +[67878]: https://github.com/rust-lang/rust/pull/67878/ +[67885]: https://github.com/rust-lang/rust/pull/67885/ +[68129]: https://github.com/rust-lang/rust/pull/68129/ +[68672]: https://github.com/rust-lang/rust/pull/68672/ +[68725]: https://github.com/rust-lang/rust/pull/68725/ +[68728]: https://github.com/rust-lang/rust/pull/68728/ +[68738]: https://github.com/rust-lang/rust/pull/68738/ +[68742]: https://github.com/rust-lang/rust/pull/68742/ +[68764]: https://github.com/rust-lang/rust/pull/68764/ +[68772]: https://github.com/rust-lang/rust/pull/68772/ +[68943]: https://github.com/rust-lang/rust/pull/68943/ +[68952]: https://github.com/rust-lang/rust/pull/68952/ +[68966]: https://github.com/rust-lang/rust/pull/68966/ +[68984]: https://github.com/rust-lang/rust/pull/68984/ +[69022]: https://github.com/rust-lang/rust/pull/69022/ +[69185]: https://github.com/rust-lang/rust/pull/69185/ +[69194]: https://github.com/rust-lang/rust/pull/69194/ +[69201]: https://github.com/rust-lang/rust/pull/69201/ +[69227]: https://github.com/rust-lang/rust/pull/69227/ +[69256]: https://github.com/rust-lang/rust/pull/69256/ +[69361]: https://github.com/rust-lang/rust/pull/69361/ +[69366]: https://github.com/rust-lang/rust/pull/69366/ +[69373]: https://github.com/rust-lang/rust/pull/69373/ +[69538]: https://github.com/rust-lang/rust/pull/69538/ +[`Once::is_completed`]: https://doc.rust-lang.org/std/sync/struct.Once.html#method.is_completed +[`f32::LOG10_2`]: https://doc.rust-lang.org/std/f32/consts/constant.LOG10_2.html +[`f32::LOG2_10`]: https://doc.rust-lang.org/std/f32/consts/constant.LOG2_10.html +[`f64::LOG10_2`]: https://doc.rust-lang.org/std/f64/consts/constant.LOG10_2.html +[`f64::LOG2_10`]: https://doc.rust-lang.org/std/f64/consts/constant.LOG2_10.html +[`iter::once_with`]: https://doc.rust-lang.org/std/iter/fn.once_with.html + + Version 1.42.0 (2020-03-12) ========================== From f1f91c92a4101f35b8640082970fdbf24a95ccff Mon Sep 17 00:00:00 2001 From: XAMPPRocky <4464295+XAMPPRocky@users.noreply.github.com> Date: Tue, 24 Mar 2020 16:07:25 +0100 Subject: [PATCH 02/12] Apply suggestions from code review Co-Authored-By: LeSeulArtichaut --- RELEASES.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/RELEASES.md b/RELEASES.md index 44f3390f4df33..e8205b15a45d3 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -24,7 +24,7 @@ Compiler - [You can now pass multiple lint flags to rustc to override the previous flags.][67885] For example; `rustc -D unused -A unused-variables` denies everything in the `unused` lint group unused except `unused-variables` which - is explicitly allowed. Passing `rustc -A unused-variables -D unused` denies + is explicitly allowed. However, passing `rustc -A unused-variables -D unused` denies everything in the `unused` lint group **including** `unused-variables` since the allow flag is specified before the deny flag (and therefore overridden). - [rustc will now prefer your system MinGW libraries over its bundled libraries @@ -35,13 +35,13 @@ Libraries --------- - [`Arc<[T; N]>`, `Box<[T; N]>`, and `Rc<[T; N]>`, now implement `TryFrom>`,`TryFrom>`, and `TryFrom>` - respectively.][69538] Where `N` is `0..=32`. + respectively.][69538] These conversions succeed when `N` is `0..=32`. - [All `to_be_bytes`, `to_le_bytes`, `to_ne_bytes`, `from_be_bytes`, `from_le_bytes`, and `from_ne_bytes` methods for integers are now `const`.][69373] - [You can now use associated constants on floats and integers directly, rather than having to import the module.][68952] e.g. You can now write `u32::MAX` or - `f32::NAN` no imports. + `f32::NAN` with no imports. - [`u8::is_ascii` is now `const`.][68984] - [`String` now implements `AsMut`.][68742] - [Added the `primitive` module to `std` and `core`.][67637] This module From 1d2fbbed339bb89175b27d32710d58bdf15f1041 Mon Sep 17 00:00:00 2001 From: XAMPPRocky <4464295+XAMPPRocky@users.noreply.github.com> Date: Tue, 24 Mar 2020 16:08:08 +0100 Subject: [PATCH 03/12] Update RELEASES.md --- RELEASES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASES.md b/RELEASES.md index e8205b15a45d3..4a11fd7760a21 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -47,7 +47,7 @@ Libraries - [Added the `primitive` module to `std` and `core`.][67637] This module reexports Rust's primitive types. This is mainly useful for use in macros where you want avoid these types being shadowed. -- [The some of the trait bounds on `HashMap` and `HashSet`.][67642] +- [Relaxed some of the trait bounds on `HashMap` and `HashSet`.][67642] - [`string::FromUtf8Error` now implements `Clone + Eq`.][68738] Stabilized APIs From 53790bbd555847c91169fc6da4f65de59d750e6a Mon Sep 17 00:00:00 2001 From: XAMPPRocky <4464295+XAMPPRocky@users.noreply.github.com> Date: Tue, 24 Mar 2020 16:14:57 +0100 Subject: [PATCH 04/12] Update RELEASES.md Co-Authored-By: LeSeulArtichaut --- RELEASES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASES.md b/RELEASES.md index 4a11fd7760a21..228eb54b9f0cd 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -4,7 +4,7 @@ Version 1.43.0 (2020-04-23) Language -------- - [Fixed using binary operations with `&{number}` (e.g. `&1.0`) not having - the correctly inferred type.][68129] + the type inferred correctly.][68129] **Syntax only changes** - [Allow `type Foo: Ord` syntactically.][69361] From cf06475e3404c6c372600ea6ab51612cf1ebe1e5 Mon Sep 17 00:00:00 2001 From: XAMPPRocky <4464295+XAMPPRocky@users.noreply.github.com> Date: Tue, 24 Mar 2020 16:33:54 +0100 Subject: [PATCH 05/12] Update RELEASES.md --- RELEASES.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RELEASES.md b/RELEASES.md index 228eb54b9f0cd..ad70c370d5647 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -35,7 +35,8 @@ Libraries --------- - [`Arc<[T; N]>`, `Box<[T; N]>`, and `Rc<[T; N]>`, now implement `TryFrom>`,`TryFrom>`, and `TryFrom>` - respectively.][69538] These conversions succeed when `N` is `0..=32`. + respectively.][69538] **Note** These conversions are only available when `N` + is `0..=32`. - [All `to_be_bytes`, `to_le_bytes`, `to_ne_bytes`, `from_be_bytes`, `from_le_bytes`, and `from_ne_bytes` methods for integers are now `const`.][69373] From 5baef9695d94f5fa74317f004fc3543bcc148a68 Mon Sep 17 00:00:00 2001 From: XAMPPRocky <4464295+XAMPPRocky@users.noreply.github.com> Date: Tue, 24 Mar 2020 18:23:46 +0100 Subject: [PATCH 06/12] Update RELEASES.md Co-Authored-By: Mark Rousskov --- RELEASES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASES.md b/RELEASES.md index ad70c370d5647..711e3217fb4b9 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -23,7 +23,7 @@ Compiler -------- - [You can now pass multiple lint flags to rustc to override the previous flags.][67885] For example; `rustc -D unused -A unused-variables` denies - everything in the `unused` lint group unused except `unused-variables` which + everything in the `unused` lint group except `unused-variables` which is explicitly allowed. However, passing `rustc -A unused-variables -D unused` denies everything in the `unused` lint group **including** `unused-variables` since the allow flag is specified before the deny flag (and therefore overridden). From f24cc7b633a8207180d87c4a291fcb4d213d1688 Mon Sep 17 00:00:00 2001 From: XAMPPRocky <4464295+XAMPPRocky@users.noreply.github.com> Date: Tue, 24 Mar 2020 18:23:53 +0100 Subject: [PATCH 07/12] Update RELEASES.md Co-Authored-By: Mark Rousskov --- RELEASES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASES.md b/RELEASES.md index 711e3217fb4b9..f2f9faf8da0b4 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -46,7 +46,7 @@ Libraries - [`u8::is_ascii` is now `const`.][68984] - [`String` now implements `AsMut`.][68742] - [Added the `primitive` module to `std` and `core`.][67637] This module - reexports Rust's primitive types. This is mainly useful for use in macros + reexports Rust's primitive types. This is mainly useful in macros where you want avoid these types being shadowed. - [Relaxed some of the trait bounds on `HashMap` and `HashSet`.][67642] - [`string::FromUtf8Error` now implements `Clone + Eq`.][68738] From f4e17cc7c2a1b11ca740db76d8f66bc3ea7904a3 Mon Sep 17 00:00:00 2001 From: XAMPPRocky <4464295+XAMPPRocky@users.noreply.github.com> Date: Tue, 24 Mar 2020 18:35:06 +0100 Subject: [PATCH 08/12] Update RELEASES.md --- RELEASES.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/RELEASES.md b/RELEASES.md index f2f9faf8da0b4..4ea24372645a4 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -60,6 +60,15 @@ Stabilized APIs - [`f64::LOG2_10`] - [`iter::once_with`] +Cargo +----- +- [You can now set config `[profile]`s in your `.cargo/config`, or through + your environment.][cargo/7823] +- [Cargo will now set `CARGO_BIN_EXE_` pointing to a binary's + executable path when running integration tests or benchmarks.][cargo/7697] + `` is the name of your binary as-is e.g. If you wanted the executable + path for a binary named `my-program`you would use `env!("CARGO_BIN_EXE_my-program")`. + Misc ---- - [Certain checks in the `const_err` lint were deemed unrelated to const @@ -110,6 +119,8 @@ related tools. [69366]: https://github.com/rust-lang/rust/pull/69366/ [69373]: https://github.com/rust-lang/rust/pull/69373/ [69538]: https://github.com/rust-lang/rust/pull/69538/ +[cargo/7823]: https://github.com/rust-lang/cargo/pull/7823 +[cargo/7697]: https://github.com/rust-lang/cargo/pull/7697 [`Once::is_completed`]: https://doc.rust-lang.org/std/sync/struct.Once.html#method.is_completed [`f32::LOG10_2`]: https://doc.rust-lang.org/std/f32/consts/constant.LOG10_2.html [`f32::LOG2_10`]: https://doc.rust-lang.org/std/f32/consts/constant.LOG2_10.html From ce3193ff442cab8365960940063a08f546b8fd34 Mon Sep 17 00:00:00 2001 From: XAMPPRocky <4464295+XAMPPRocky@users.noreply.github.com> Date: Wed, 25 Mar 2020 09:23:11 +0100 Subject: [PATCH 09/12] Update RELEASES.md Co-Authored-By: Mazdak Farrokhzad --- RELEASES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASES.md b/RELEASES.md index 4ea24372645a4..f0211f6a0e920 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -15,7 +15,7 @@ Language - [Merge `fn` syntax + cleanup item parsing.][68728] These are still rejected *semantically*, so you will likely receive an error but -these changes can be seen and parsed by procedural macros and +these changes can be seen and parsed by macros and conditional compilation. From 6364b4dbb4d2393a6bb51562b3f8d2fe2748f657 Mon Sep 17 00:00:00 2001 From: XAMPPRocky <4464295+XAMPPRocky@users.noreply.github.com> Date: Thu, 2 Apr 2020 21:11:29 +0200 Subject: [PATCH 10/12] Update RELEASES.md --- RELEASES.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/RELEASES.md b/RELEASES.md index f0211f6a0e920..d181b0ece2519 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -37,9 +37,6 @@ Libraries `TryFrom>`,`TryFrom>`, and `TryFrom>` respectively.][69538] **Note** These conversions are only available when `N` is `0..=32`. -- [All `to_be_bytes`, `to_le_bytes`, `to_ne_bytes`, `from_be_bytes`, - `from_le_bytes`, and `from_ne_bytes` methods for integers are - now `const`.][69373] - [You can now use associated constants on floats and integers directly, rather than having to import the module.][68952] e.g. You can now write `u32::MAX` or `f32::NAN` with no imports. @@ -74,6 +71,17 @@ Misc - [Certain checks in the `const_err` lint were deemed unrelated to const evaluation][69185], and have been moved to the `unconditional_panic` and `arithmetic_overflow` lints. + +Compatibility Notes +------------------- + +- [Having trailing syntax in the `assert!` macro is now a hard error.][69548] This + has been a warning since 1.36.0. +- [Fixed `Self` not having the correctly inferred type.][69340] This incorrectly + led to some instances being accepted, and now correctly emits a hard error. +- [][] + +[69340]: https://github.com/rust-lang/rust/pull/69340 Internal Only ------------- @@ -114,10 +122,10 @@ related tools. [69194]: https://github.com/rust-lang/rust/pull/69194/ [69201]: https://github.com/rust-lang/rust/pull/69201/ [69227]: https://github.com/rust-lang/rust/pull/69227/ +[69548]: https://github.com/rust-lang/rust/pull/69548/ [69256]: https://github.com/rust-lang/rust/pull/69256/ [69361]: https://github.com/rust-lang/rust/pull/69361/ [69366]: https://github.com/rust-lang/rust/pull/69366/ -[69373]: https://github.com/rust-lang/rust/pull/69373/ [69538]: https://github.com/rust-lang/rust/pull/69538/ [cargo/7823]: https://github.com/rust-lang/cargo/pull/7823 [cargo/7697]: https://github.com/rust-lang/cargo/pull/7697 From 32047903c78410d47ead0693ec15fc7c6f350229 Mon Sep 17 00:00:00 2001 From: XAMPPRocky <4464295+XAMPPRocky@users.noreply.github.com> Date: Sat, 11 Apr 2020 16:35:19 +0200 Subject: [PATCH 11/12] Update RELEASES.md --- RELEASES.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/RELEASES.md b/RELEASES.md index d181b0ece2519..c1e4fcc4394d3 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -8,11 +8,22 @@ Language **Syntax only changes** - [Allow `type Foo: Ord` syntactically.][69361] -- [Unify item parsing & filter illegal item kinds.][69366] - [Fuse associated and extern items up to defaultness.][69194] - [Permit attributes on `if` expressions.][69201] - [Syntactically allow `self` in all `fn` contexts.][68764] - [Merge `fn` syntax + cleanup item parsing.][68728] +- [`item` macro fragments can be interpolated into `trait`s, `impl`s, and `extern` blocks.][69366] + For example, you may now write: + ```rust + macro_rules! mac_trait { + ($i:item) => { + trait T { $i } + } + } + mac_trait! { + fn foo() {} + } + ``` These are still rejected *semantically*, so you will likely receive an error but these changes can be seen and parsed by macros and @@ -79,7 +90,6 @@ Compatibility Notes has been a warning since 1.36.0. - [Fixed `Self` not having the correctly inferred type.][69340] This incorrectly led to some instances being accepted, and now correctly emits a hard error. -- [][] [69340]: https://github.com/rust-lang/rust/pull/69340 From dda3445fd51ead62353243928c4376f404b3c182 Mon Sep 17 00:00:00 2001 From: XAMPPRocky <4464295+XAMPPRocky@users.noreply.github.com> Date: Sat, 11 Apr 2020 16:36:29 +0200 Subject: [PATCH 12/12] Update RELEASES.md --- RELEASES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASES.md b/RELEASES.md index c1e4fcc4394d3..36597b1864f25 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -5,11 +5,11 @@ Language -------- - [Fixed using binary operations with `&{number}` (e.g. `&1.0`) not having the type inferred correctly.][68129] +- [Attributes such as `#[cfg()]` can now be used on `if` expressions.][69201] **Syntax only changes** - [Allow `type Foo: Ord` syntactically.][69361] - [Fuse associated and extern items up to defaultness.][69194] -- [Permit attributes on `if` expressions.][69201] - [Syntactically allow `self` in all `fn` contexts.][68764] - [Merge `fn` syntax + cleanup item parsing.][68728] - [`item` macro fragments can be interpolated into `trait`s, `impl`s, and `extern` blocks.][69366]