From 0a07e55f221ce8bb7eb6bdac7e1df263aec9d84c Mon Sep 17 00:00:00 2001 From: Tyler Mandry Date: Thu, 28 Apr 2022 18:56:22 -0700 Subject: [PATCH 1/4] Add release notes for 1.61.0 --- RELEASES.md | 120 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) diff --git a/RELEASES.md b/RELEASES.md index 0965e37574d07..8c6528fa8b45c 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,3 +1,123 @@ +Version 1.61.0 (2022-05-19) +========================== + +Language +-------- + +- [`const fn` signatures can now include generic trait bounds][93827] +- [`const fn` signatures can now use `impl Trait` in argument and return position][93827] +- [Function pointers can now be created, cast, and passed around in a `const fn`][93827] +- [Recursive calls can now set the value of a function's opaque `impl Trait` return type][94081] + +Compiler +-------- + +- [Linking modifier syntax in `#[link]` attributes and on the command line, as well as the `whole-archive` modifier specifically, are now supported][93901] +- [Update to LLVM 14.0.0][95247] +- [The `char` type is now described as UTF-8 (`DW_ATE_UTF`) in DWARF debuginfo][89887] +- The [`#[target_feature]`][target_feature] attribute [can now be used with aarch64 features][90621] +- [`#[target_feature = "adx"]` is now stable][93745] +- [Catching a second unwind from FFI code while cleaning up from a Rust panic now causes the process to abort][92911] + +Libraries +--------- + +- [`ManuallyDrop` is now documented to have the same layout as `T`][88375] +- [Windows paths longer than 260 chars are now supported in `process::Command` without needing explicit canonoicalization][92519] +- [`#[ignore = "…"]` messages are printed when running tests][92714] +- [Consistently present absent stdio handles on Windows as NULL handles][93263] +- [Make `std::io::stdio::lock()` return `'static` handles][93965] +- [`Vec::from_raw_parts` is now less restrictive about its inputs][95016] +- [Use cgroup quotas for calculating `available_parallelism` on Linux][92697] + +Stabilized APIs +--------------- + +- [`From<&[T; N]>` for `Vec`][95098] +- [`From<&mut [T; N]>` for `Vec`][95098] +- [`Pin::static_mut`][93580] +- [`Pin::static_ref`][93580] +- [`Vec::retain_mut`][95491] +- [`VecDeque::retain_mut`][95491] +- [`Write` for `Cursor<[u8; N]>`][92663] +- [`std::os::unix::net::SocketAddr::from_pathname`][94356] +- [`std::process::ExitCode`][93840] +- [`std::process::Termination`][93840] +- [`std::thread::JoinHandle::is_finished`][95130] + +These APIs are now usable in const contexts: + +- [`*const T::offset` and `*mut T::offset`][93957] +- [`*const T::wrapping_offset` and `*mut T::wrapping_offset`][93957] +- [`*const T::add` and `*mut T::add`][93957] +- [`*const T::sub` and `*mut T::sub`][93957] +- [`*const T::wrapping_add` and `*mut T::wrapping_add`][93957] +- [`*const T::wrapping_sub` and `*mut T::wrapping_sub`][93957] +- [`[T]::as_mut_ptr`][93957] +- [`[T]::as_ptr_range`][93957] +- [`[T]::as_mut_ptr_range`][93957] + +Cargo +----- + +No feature changes, but see compatibility notes. + +Compatibility Notes +------------------- + +- [Disable `#[thread_local]` support on i686-pc-windows-msvc][95430] +- [Proc macros no longer see `ident` matchers wrapped in groups][92472] +- [The number of `#` in `r#` raw string literals is now required to be less than 256][95251] +- [When checking that a dyn type satisfies a trait bound, supertrait bounds are now enforced][92285] +- [`cargo vendor` now only accepts one value for each `--sync` flag][cargo/10448] +- [`cfg` predicates in `all()` and `any()` are always evaluated to detect errors, instead of short-circuiting][94295] +- [bootstrap: static-libstdcpp is now enabled by default, and can now be disabled when llvm-tools is enabled][94832] + +Internal Changes +---------------- + +These changes provide no direct user facing benefits, but represent significant +improvements to the internals and overall performance of rustc +and related tools. + +- [debuginfo: Refactor debuginfo generation for types][94261] +- [Remove the everybody loops pass][93913] + +[88375]: https://github.com/rust-lang/rust/pull/88375/ +[89887]: https://github.com/rust-lang/rust/pull/89887/ +[90621]: https://github.com/rust-lang/rust/pull/90621/ +[92285]: https://github.com/rust-lang/rust/pull/92285/ +[92472]: https://github.com/rust-lang/rust/pull/92472/ +[92519]: https://github.com/rust-lang/rust/pull/92519/ +[92663]: https://github.com/rust-lang/rust/pull/92663/ +[92697]: https://github.com/rust-lang/rust/pull/92697/ +[92714]: https://github.com/rust-lang/rust/pull/92714/ +[92911]: https://github.com/rust-lang/rust/pull/92911/ +[93263]: https://github.com/rust-lang/rust/pull/93263/ +[93580]: https://github.com/rust-lang/rust/pull/93580/ +[93745]: https://github.com/rust-lang/rust/pull/93745/ +[93827]: https://github.com/rust-lang/rust/pull/93827/ +[93840]: https://github.com/rust-lang/rust/pull/93840/ +[93901]: https://github.com/rust-lang/rust/pull/93901/ +[93913]: https://github.com/rust-lang/rust/pull/93913/ +[93957]: https://github.com/rust-lang/rust/pull/93957/ +[93965]: https://github.com/rust-lang/rust/pull/93965/ +[94081]: https://github.com/rust-lang/rust/pull/94081/ +[94261]: https://github.com/rust-lang/rust/pull/94261/ +[94295]: https://github.com/rust-lang/rust/pull/94295/ +[94356]: https://github.com/rust-lang/rust/pull/94356/ +[94832]: https://github.com/rust-lang/rust/pull/94832/ +[95016]: https://github.com/rust-lang/rust/pull/95016/ +[95098]: https://github.com/rust-lang/rust/pull/95098/ +[95130]: https://github.com/rust-lang/rust/pull/95130/ +[95247]: https://github.com/rust-lang/rust/pull/95247/ +[95251]: https://github.com/rust-lang/rust/pull/95251/ +[95430]: https://github.com/rust-lang/rust/pull/95430/ +[95491]: https://github.com/rust-lang/rust/pull/95491/ +[cargo/10448]: https://github.com/rust-lang/cargo/pull/10448/ +[target_feature]: https://doc.rust-lang.org/reference/attributes/codegen.html#the-target_feature-attribute + + Version 1.60.0 (2022-04-07) ========================== From 80e2957c60b4d148575b0d2ab94cbfe3f7ebbef6 Mon Sep 17 00:00:00 2001 From: Tyler Mandry Date: Fri, 13 May 2022 16:12:33 -0700 Subject: [PATCH 2/4] Apply suggestions from code review Co-authored-by: Wesley Wiser Co-authored-by: Josh Stone Co-authored-by: Josh Triplett --- RELEASES.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/RELEASES.md b/RELEASES.md index 8c6528fa8b45c..61264b1e1d1b7 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -14,21 +14,21 @@ Compiler - [Linking modifier syntax in `#[link]` attributes and on the command line, as well as the `whole-archive` modifier specifically, are now supported][93901] - [Update to LLVM 14.0.0][95247] -- [The `char` type is now described as UTF-8 (`DW_ATE_UTF`) in DWARF debuginfo][89887] +- [The `char` type is now described as UTF-32 in debuginfo][89887] - The [`#[target_feature]`][target_feature] attribute [can now be used with aarch64 features][90621] -- [`#[target_feature = "adx"]` is now stable][93745] +- X86 [`#[target_feature = "adx"]` is now stable][93745] - [Catching a second unwind from FFI code while cleaning up from a Rust panic now causes the process to abort][92911] Libraries --------- - [`ManuallyDrop` is now documented to have the same layout as `T`][88375] -- [Windows paths longer than 260 chars are now supported in `process::Command` without needing explicit canonoicalization][92519] +- [Windows paths longer than 260 chars are now supported in `process::Command` without needing explicit canonicalization][92519] - [`#[ignore = "…"]` messages are printed when running tests][92714] - [Consistently present absent stdio handles on Windows as NULL handles][93263] -- [Make `std::io::stdio::lock()` return `'static` handles][93965] +- [Make `std::io::stdio::lock()` return `'static` handles.][93965] Previously, the creation of locked handles to stdin/stdout/stderr would borrow the handles being locked, which prevented writing `let out = std::io::stdout().lock();` because `out` would outlive the return value of `stdout()`. Such code now works, eliminating a common pitfall that affected many Rust users. - [`Vec::from_raw_parts` is now less restrictive about its inputs][95016] -- [Use cgroup quotas for calculating `available_parallelism` on Linux][92697] +- [`std::thread::available_parallelism` now takes cgroup quotas into account.][92697] Since `available_parallelism` is often used to create a thread pool for parallel computation, which may be CPU-bound for performance, `available_parallelism` will return a value consistent with the ability to use that many threads continuously, if possible. For instance, in a container with 8 virtual CPUs but quotas only allowing for 50% usage, `available_parallelism` will return 4. Stabilized APIs --------------- @@ -41,8 +41,7 @@ Stabilized APIs - [`VecDeque::retain_mut`][95491] - [`Write` for `Cursor<[u8; N]>`][92663] - [`std::os::unix::net::SocketAddr::from_pathname`][94356] -- [`std::process::ExitCode`][93840] -- [`std::process::Termination`][93840] +- [`std::process::ExitCode`][93840] and [`std::process::Termination`][93840]. The stabilization of these two APIs now makes it possible for programs to return errors from `main` with custom exit codes. - [`std::thread::JoinHandle::is_finished`][95130] These APIs are now usable in const contexts: @@ -70,7 +69,7 @@ Compatibility Notes - [The number of `#` in `r#` raw string literals is now required to be less than 256][95251] - [When checking that a dyn type satisfies a trait bound, supertrait bounds are now enforced][92285] - [`cargo vendor` now only accepts one value for each `--sync` flag][cargo/10448] -- [`cfg` predicates in `all()` and `any()` are always evaluated to detect errors, instead of short-circuiting][94295] +- [`cfg` predicates in `all()` and `any()` are always evaluated to detect errors, instead of short-circuiting.][94295] The compatibility considerations here arise in nightly-only code that used the short-circuiting behavior of `all` to write something like `cfg(all(feature = "nightly", syntax-requiring-nightly))`, which will now fail to compile. Instead, use either `cfg_attr(feature = "nightly", ...)` or nested uses of `cfg`. - [bootstrap: static-libstdcpp is now enabled by default, and can now be disabled when llvm-tools is enabled][94832] Internal Changes From 4d523a8149ff697ffe1770358291e2b8d8b58fd7 Mon Sep 17 00:00:00 2001 From: Tyler Mandry Date: Fri, 13 May 2022 16:58:28 -0700 Subject: [PATCH 3/4] Apply review feedback --- RELEASES.md | 75 +++++++++++++++++++++++++++++------------------------ 1 file changed, 41 insertions(+), 34 deletions(-) diff --git a/RELEASES.md b/RELEASES.md index 61264b1e1d1b7..af9a071aeccfe 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -13,17 +13,14 @@ Compiler -------- - [Linking modifier syntax in `#[link]` attributes and on the command line, as well as the `whole-archive` modifier specifically, are now supported][93901] -- [Update to LLVM 14.0.0][95247] - [The `char` type is now described as UTF-32 in debuginfo][89887] - The [`#[target_feature]`][target_feature] attribute [can now be used with aarch64 features][90621] - X86 [`#[target_feature = "adx"]` is now stable][93745] -- [Catching a second unwind from FFI code while cleaning up from a Rust panic now causes the process to abort][92911] Libraries --------- - [`ManuallyDrop` is now documented to have the same layout as `T`][88375] -- [Windows paths longer than 260 chars are now supported in `process::Command` without needing explicit canonicalization][92519] - [`#[ignore = "…"]` messages are printed when running tests][92714] - [Consistently present absent stdio handles on Windows as NULL handles][93263] - [Make `std::io::stdio::lock()` return `'static` handles.][93965] Previously, the creation of locked handles to stdin/stdout/stderr would borrow the handles being locked, which prevented writing `let out = std::io::stdout().lock();` because `out` would outlive the return value of `stdout()`. Such code now works, eliminating a common pitfall that affected many Rust users. @@ -33,28 +30,26 @@ Libraries Stabilized APIs --------------- -- [`From<&[T; N]>` for `Vec`][95098] -- [`From<&mut [T; N]>` for `Vec`][95098] -- [`Pin::static_mut`][93580] -- [`Pin::static_ref`][93580] -- [`Vec::retain_mut`][95491] -- [`VecDeque::retain_mut`][95491] -- [`Write` for `Cursor<[u8; N]>`][92663] -- [`std::os::unix::net::SocketAddr::from_pathname`][94356] -- [`std::process::ExitCode`][93840] and [`std::process::Termination`][93840]. The stabilization of these two APIs now makes it possible for programs to return errors from `main` with custom exit codes. -- [`std::thread::JoinHandle::is_finished`][95130] +- [`Pin::static_mut`] +- [`Pin::static_ref`] +- [`Vec::retain_mut`] +- [`VecDeque::retain_mut`] +- [`Write` for `Cursor<[u8; N]>`][cursor-write-array] +- [`std::os::unix::net::SocketAddr::from_pathname`] +- [`std::process::ExitCode`] and [`std::process::Termination`]. The stabilization of these two APIs now makes it possible for programs to return errors from `main` with custom exit codes. +- [`std::thread::JoinHandle::is_finished`] These APIs are now usable in const contexts: -- [`*const T::offset` and `*mut T::offset`][93957] -- [`*const T::wrapping_offset` and `*mut T::wrapping_offset`][93957] -- [`*const T::add` and `*mut T::add`][93957] -- [`*const T::sub` and `*mut T::sub`][93957] -- [`*const T::wrapping_add` and `*mut T::wrapping_add`][93957] -- [`*const T::wrapping_sub` and `*mut T::wrapping_sub`][93957] -- [`[T]::as_mut_ptr`][93957] -- [`[T]::as_ptr_range`][93957] -- [`[T]::as_mut_ptr_range`][93957] +- [`<*const T>::offset` and `<*mut T>::offset`][ptr-offset] +- [`<*const T>::wrapping_offset` and `<*mut T>::wrapping_offset`][ptr-wrapping_offset] +- [`<*const T>::add` and `<*mut T>::add`][ptr-add] +- [`<*const T>::sub` and `<*mut T>::sub`][ptr-sub] +- [`<*const T>::wrapping_add` and `<*mut T>::wrapping_add`][ptr-wrapping_add] +- [`<*const T>::wrapping_sub` and `<*mut T>::wrapping_sub`][ptr-wrapping_sub] +- [`<[T]>::as_mut_ptr`][slice-as_mut_ptr] +- [`<[T]>::as_ptr_range`][slice-as_ptr_range] +- [`<[T]>::as_mut_ptr_range`][slice-as_mut_ptr_range] Cargo ----- @@ -64,7 +59,10 @@ No feature changes, but see compatibility notes. Compatibility Notes ------------------- -- [Disable `#[thread_local]` support on i686-pc-windows-msvc][95430] +- Previously native static libraries were linked as `whole-archive` in some cases, but now rustc tries not to use `whole-archive` unless explicitly requested. This [change][93901] may result in linking errors in some cases. To fix such errors, native libraries linked from the command line, build scripts, or [`#[link]` attributes][link-attr] need to + - (more common) either be reordered to respect dependencies between them (if `a` depends on `b` then `a` should go first and `b` second) + - (less common) or be updated to use the [`+whole-archive`] modifier. +- [Catching a second unwind from FFI code while cleaning up from a Rust panic now causes the process to abort][92911] - [Proc macros no longer see `ident` matchers wrapped in groups][92472] - [The number of `#` in `r#` raw string literals is now required to be less than 256][95251] - [When checking that a dyn type satisfies a trait bound, supertrait bounds are now enforced][92285] @@ -87,33 +85,42 @@ and related tools. [90621]: https://github.com/rust-lang/rust/pull/90621/ [92285]: https://github.com/rust-lang/rust/pull/92285/ [92472]: https://github.com/rust-lang/rust/pull/92472/ -[92519]: https://github.com/rust-lang/rust/pull/92519/ -[92663]: https://github.com/rust-lang/rust/pull/92663/ [92697]: https://github.com/rust-lang/rust/pull/92697/ [92714]: https://github.com/rust-lang/rust/pull/92714/ [92911]: https://github.com/rust-lang/rust/pull/92911/ [93263]: https://github.com/rust-lang/rust/pull/93263/ -[93580]: https://github.com/rust-lang/rust/pull/93580/ [93745]: https://github.com/rust-lang/rust/pull/93745/ [93827]: https://github.com/rust-lang/rust/pull/93827/ -[93840]: https://github.com/rust-lang/rust/pull/93840/ [93901]: https://github.com/rust-lang/rust/pull/93901/ [93913]: https://github.com/rust-lang/rust/pull/93913/ -[93957]: https://github.com/rust-lang/rust/pull/93957/ [93965]: https://github.com/rust-lang/rust/pull/93965/ [94081]: https://github.com/rust-lang/rust/pull/94081/ [94261]: https://github.com/rust-lang/rust/pull/94261/ [94295]: https://github.com/rust-lang/rust/pull/94295/ -[94356]: https://github.com/rust-lang/rust/pull/94356/ [94832]: https://github.com/rust-lang/rust/pull/94832/ [95016]: https://github.com/rust-lang/rust/pull/95016/ -[95098]: https://github.com/rust-lang/rust/pull/95098/ -[95130]: https://github.com/rust-lang/rust/pull/95130/ -[95247]: https://github.com/rust-lang/rust/pull/95247/ [95251]: https://github.com/rust-lang/rust/pull/95251/ -[95430]: https://github.com/rust-lang/rust/pull/95430/ -[95491]: https://github.com/rust-lang/rust/pull/95491/ +[`+whole-archive`]: https://doc.rust-lang.org/stable/rustc/command-line-arguments.html#linking-modifiers-whole-archive +[`Pin::static_mut`]: https://doc.rust-lang.org/stable/std/pin/struct.Pin.html#method.static_mut +[`Pin::static_ref`]: https://doc.rust-lang.org/stable/std/pin/struct.Pin.html#method.static_ref +[`Vec::retain_mut`]: https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.retain_mut +[`VecDeque::retain_mut`]: https://doc.rust-lang.org/stable/std/collections/struct.VecDeque.html#method.retain_mut +[`std::os::unix::net::SocketAddr::from_pathname`]: https://doc.rust-lang.org/stable/std/os/unix/net/struct.SocketAddr.html#method.from_pathname +[`std::process::ExitCode`]: https://doc.rust-lang.org/stable/std/process/struct.ExitCode.html +[`std::process::Termination`]: https://doc.rust-lang.org/stable/std/process/trait.Termination.html +[`std::thread::JoinHandle::is_finished`]: https://doc.rust-lang.org/stable/std/thread/struct.JoinHandle.html#method.is_finished [cargo/10448]: https://github.com/rust-lang/cargo/pull/10448/ +[cursor-write-array]: https://doc.rust-lang.org/stable/std/io/struct.Cursor.html#impl-Write-4 +[link-attr]: https://doc.rust-lang.org/stable/reference/items/external-blocks.html#the-link-attribute +[ptr-add]: https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.add +[ptr-offset]: https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.offset +[ptr-sub]: https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.sub +[ptr-wrapping_add]: https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.wrapping_add +[ptr-wrapping_offset]: https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.wrapping_offset +[ptr-wrapping_sub]: https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.wrapping_sub +[slice-as_mut_ptr]: https://doc.rust-lang.org/stable/std/primitive.slice.html#method.as_mut_ptr +[slice-as_mut_ptr_range]: https://doc.rust-lang.org/stable/std/primitive.slice.html#method.as_mut_ptr_range +[slice-as_ptr_range]: https://doc.rust-lang.org/stable/std/primitive.slice.html#method.as_ptr_range [target_feature]: https://doc.rust-lang.org/reference/attributes/codegen.html#the-target_feature-attribute From 23a4614238b48984dbc8fbcdbb9062b11f24eedb Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Tue, 17 May 2022 15:33:15 -0400 Subject: [PATCH 4/4] Adjust language Co-authored-by: Who? Me?! --- RELEASES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASES.md b/RELEASES.md index af9a071aeccfe..0e118fb939ff0 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -22,7 +22,7 @@ Libraries - [`ManuallyDrop` is now documented to have the same layout as `T`][88375] - [`#[ignore = "…"]` messages are printed when running tests][92714] -- [Consistently present absent stdio handles on Windows as NULL handles][93263] +- [Consistently show absent stdio handles on Windows as NULL handles][93263] - [Make `std::io::stdio::lock()` return `'static` handles.][93965] Previously, the creation of locked handles to stdin/stdout/stderr would borrow the handles being locked, which prevented writing `let out = std::io::stdout().lock();` because `out` would outlive the return value of `stdout()`. Such code now works, eliminating a common pitfall that affected many Rust users. - [`Vec::from_raw_parts` is now less restrictive about its inputs][95016] - [`std::thread::available_parallelism` now takes cgroup quotas into account.][92697] Since `available_parallelism` is often used to create a thread pool for parallel computation, which may be CPU-bound for performance, `available_parallelism` will return a value consistent with the ability to use that many threads continuously, if possible. For instance, in a container with 8 virtual CPUs but quotas only allowing for 50% usage, `available_parallelism` will return 4.