From 15d70865527aaed9f26add9936acb5a9043ea89f Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Thu, 30 Jul 2020 10:14:42 -0400 Subject: [PATCH 1/6] 1.45.1 post --- posts/2020-07-30-Rust-1.45.1.md | 52 +++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 posts/2020-07-30-Rust-1.45.1.md diff --git a/posts/2020-07-30-Rust-1.45.1.md b/posts/2020-07-30-Rust-1.45.1.md new file mode 100644 index 000000000..012e90bdd --- /dev/null +++ b/posts/2020-07-30-Rust-1.45.1.md @@ -0,0 +1,52 @@ +--- +layout: post +title: "Announcing Rust 1.45.1" +author: The Rust Release Team +release: true +--- + +The Rust team is happy to announce a new version of Rust, 1.45.1. Rust is a +programming language that is empowering everyone to build reliable and +efficient software. + +If you have a previous version of Rust installed via rustup, getting Rust +1.45.1 is as easy as: + +```console +rustup update stable +``` + +If you don't have it already, you can [get `rustup`][install] from the +appropriate page on our website, and check out the [detailed release notes for +1.45.1][notes] on GitHub. + +[install]: https://www.rust-lang.org/install.html +[notes]: https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1451-2020-07-30 + +## What's in 1.45.1 stable + +1.45.1 contains a collection of fixes, including one soundness fix. All patches +in 1.45.1 affect only the 1.45.0 release; prior releases are not affected by the +bugs this fixes. + +### Fix const propagation with references + +In Rust 1.45.0, `rustc`'s const propagation pass did not look properly handle +encountering references, which could lead to incorrect behavior. + +The conditions necessary to cause this bug are highly unlikely to occur in +practice: the code must have inputs consisting of entirely constant values and +no control flow or function calls in between. + +```rust +let mut foo = Foo { x: 42 }; +let x = &mut foo.x; +*x = 13; +let y = foo; +println!("{}", y.x); // -> 42; expected result: 13 +``` + +## Contributors to 1.45.1 + +Many people came together to create Rust 1.45.1. We couldn't have done it +without all of you. [Thanks!](https://thanks.rust-lang.org/rust/1.45.1/) From f63bca13f2bfad871ab65e929f4be380c08e8afb Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Thu, 30 Jul 2020 11:17:13 -0400 Subject: [PATCH 2/6] Fix stray thought --- posts/2020-07-30-Rust-1.45.1.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/posts/2020-07-30-Rust-1.45.1.md b/posts/2020-07-30-Rust-1.45.1.md index 012e90bdd..552a38035 100644 --- a/posts/2020-07-30-Rust-1.45.1.md +++ b/posts/2020-07-30-Rust-1.45.1.md @@ -31,8 +31,9 @@ bugs this fixes. ### Fix const propagation with references -In Rust 1.45.0, `rustc`'s const propagation pass did not look properly handle -encountering references, which could lead to incorrect behavior. +In Rust 1.45.0, `rustc`'s const propagation pass did not properly handle +encountering references when determining whether to propagate a given constant, +which could lead to incorrect behavior. The conditions necessary to cause this bug are highly unlikely to occur in practice: the code must have inputs consisting of entirely constant values and From ad04ffad93ca21bbcd000590ded08a7a1df4efa7 Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Thu, 30 Jul 2020 12:36:23 -0400 Subject: [PATCH 3/6] Update posts/2020-07-30-Rust-1.45.1.md Co-authored-by: Kyle J Strand --- posts/2020-07-30-Rust-1.45.1.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/posts/2020-07-30-Rust-1.45.1.md b/posts/2020-07-30-Rust-1.45.1.md index 552a38035..8141a2784 100644 --- a/posts/2020-07-30-Rust-1.45.1.md +++ b/posts/2020-07-30-Rust-1.45.1.md @@ -26,8 +26,8 @@ appropriate page on our website, and check out the [detailed release notes for ## What's in 1.45.1 stable 1.45.1 contains a collection of fixes, including one soundness fix. All patches -in 1.45.1 affect only the 1.45.0 release; prior releases are not affected by the -bugs this fixes. +in 1.45.1 address bugs that affect only the 1.45.0 release; prior releases are +not affected by the bugs fixed int his release. ### Fix const propagation with references From 5c1daf9a815ae932c7b75bdd5f160ff28c68c3c2 Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Thu, 30 Jul 2020 12:36:51 -0400 Subject: [PATCH 4/6] Fix typo --- posts/2020-07-30-Rust-1.45.1.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posts/2020-07-30-Rust-1.45.1.md b/posts/2020-07-30-Rust-1.45.1.md index 8141a2784..8ad22e931 100644 --- a/posts/2020-07-30-Rust-1.45.1.md +++ b/posts/2020-07-30-Rust-1.45.1.md @@ -27,7 +27,7 @@ appropriate page on our website, and check out the [detailed release notes for 1.45.1 contains a collection of fixes, including one soundness fix. All patches in 1.45.1 address bugs that affect only the 1.45.0 release; prior releases are -not affected by the bugs fixed int his release. +not affected by the bugs fixed in this release. ### Fix const propagation with references From 789cc47b4d0a7c990301535627f79336e60bda25 Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Thu, 30 Jul 2020 12:40:26 -0400 Subject: [PATCH 5/6] Make example compilable --- posts/2020-07-30-Rust-1.45.1.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/posts/2020-07-30-Rust-1.45.1.md b/posts/2020-07-30-Rust-1.45.1.md index 8ad22e931..689caeaef 100644 --- a/posts/2020-07-30-Rust-1.45.1.md +++ b/posts/2020-07-30-Rust-1.45.1.md @@ -40,11 +40,17 @@ practice: the code must have inputs consisting of entirely constant values and no control flow or function calls in between. ```rust -let mut foo = Foo { x: 42 }; -let x = &mut foo.x; -*x = 13; -let y = foo; -println!("{}", y.x); // -> 42; expected result: 13 +struct Foo { + x: u32, +} + +fn main() { + let mut foo = Foo { x: 42 }; + let x = &mut foo.x; + *x = 13; + let y = foo; + println!("{}", y.x); // -> 42; expected result: 13 +} ``` ## Contributors to 1.45.1 From 26b5bef40de4064d23bb637363538c6f6c4e1273 Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Thu, 30 Jul 2020 13:27:00 -0400 Subject: [PATCH 6/6] Note not catching this in crater --- posts/2020-07-30-Rust-1.45.1.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/posts/2020-07-30-Rust-1.45.1.md b/posts/2020-07-30-Rust-1.45.1.md index 689caeaef..cd5255fc8 100644 --- a/posts/2020-07-30-Rust-1.45.1.md +++ b/posts/2020-07-30-Rust-1.45.1.md @@ -33,7 +33,9 @@ not affected by the bugs fixed in this release. In Rust 1.45.0, `rustc`'s const propagation pass did not properly handle encountering references when determining whether to propagate a given constant, -which could lead to incorrect behavior. +which could lead to incorrect behavior. Our releases are run through [crater], +and we did not detect it, which helps us be fairly confident that this affects a +very small set of code in the wild (if any). The conditions necessary to cause this bug are highly unlikely to occur in practice: the code must have inputs consisting of entirely constant values and @@ -57,3 +59,5 @@ fn main() { Many people came together to create Rust 1.45.1. We couldn't have done it without all of you. [Thanks!](https://thanks.rust-lang.org/rust/1.45.1/) + +[crater]: https://github.com/rust-lang/crater