From 90336497d7ad690044dd788544641f95030a0fe9 Mon Sep 17 00:00:00 2001
From: Josh Stone <cuviper@gmail.com>
Date: Thu, 25 May 2023 16:56:33 -0700
Subject: [PATCH 01/10] Announcing Rust 1.70.0

---
 posts/2023-06-01-Rust-1.70.0.md | 74 +++++++++++++++++++++++++++++++++
 1 file changed, 74 insertions(+)
 create mode 100644 posts/2023-06-01-Rust-1.70.0.md

diff --git a/posts/2023-06-01-Rust-1.70.0.md b/posts/2023-06-01-Rust-1.70.0.md
new file mode 100644
index 000000000..dfa4d5a88
--- /dev/null
+++ b/posts/2023-06-01-Rust-1.70.0.md
@@ -0,0 +1,74 @@
+---
+layout: post
+title: "Announcing Rust 1.70.0"
+author: The Rust Release Team
+release: true
+---
+
+The Rust team is happy to announce a new version of Rust, 1.70.0. Rust is a programming language empowering everyone to build reliable and efficient software.
+
+If you have a previous version of Rust installed via rustup, you can get 1.70.0 with:
+
+```console
+rustup update stable
+```
+
+If you don't have it already, you can [get `rustup`](https://www.rust-lang.org/install.html) from the appropriate page on our website, and check out the [detailed release notes for 1.70.0](https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1700-2023-06-01) on GitHub.
+
+If you'd like to help us out by testing future releases, you might consider updating locally to use the beta channel (`rustup default beta`) or the nightly channel (`rustup default nightly`). Please [report](https://github.com/rust-lang/rust/issues/new/choose) any bugs you might come across!
+
+## What's in 1.70.0 stable
+
+### Sparse by default for crates.io
+
+Cargo's "sparse" protocol is now enabled by default for reading the index from crates.io. This feature was previously stabilized with [Rust 1.68.0](https://blog.rust-lang.org/2023/03/09/Rust-1.68.0.html#cargos-sparse-protocol), but still required configuration to use that with crates.io. The announced plan was to make that the default in 1.70.0, and here it is! (TODO: maybe a statement about effects from user and infra sides?)
+
+### `OnceCell` and `OnceLock`
+
+Two new types have been stabilized for one-time initialization of shared data, `OnceCell` and its thread-safe counterpart `OnceLock`. These can be used anywhere that immediate construction is not wanted, and perhaps not even possible like non-`const` data in global variables.
+
+```rust
+use std::sync::OnceLock;
+
+fn main() {
+    let winner_lock = OnceLock::new();
+
+    let winner = std::thread::scope(|s| {
+        s.spawn(|| winner_lock.set("thread"));
+
+        std::thread::yield_now(); // give them a chance...
+
+        winner_lock.get_or_init(|| "main")
+    });
+
+    println!("{winner} wins!");
+}
+```
+
+Crates such as `lazy_static` and `once_cell` have filled this need in the past, but now these building blocks are part of the standard library, ported from `once_cell`'s `unsync` and `sync` modules. There are still more methods that may be stabilized in the future, as well as companion `LazyCell` and `LazyLock` types that store their initializing function, but this first step in stabilization should already cover many use cases.
+
+### Named levels of debug information
+
+The `-Cdebuginfo` compiler option has previously only supported numbers 0..=2 for increasing amounts of debugging information, where Cargo defaults to 2 in dev and test profiles and 0 in release and bench profiles. These debug levels can now be set by name: "none" (0), "limited" (1), and "full" (2), as well as two new levels, "line-directives-only" and "line-tables-only".
+
+The Cargo and rustc documentation both called level 1 "line tables only" before, but it was more than that with information about all functions, just not types and variables. That level is now called "limited", and the new "line-tables-only" level is further reduced to the minimum needed for backtraces with filenames and line numbers. This may eventually become the level used for `-Cdebuginfo=1`. The other `line-directives-only` level is intended for NVPTX profiling, and is otherwise not recommended.
+
+### Enforced stability in the `test` CLI
+
+When `#[test]` functions are compiled, the executable gets a command-line interface from the `test` crate. This CLI has a number of options, including some that are not yet stabilized and require specifying `-Zunstable-options` as well, like many other commands in the Rust toolchain. However, while that's only intended to be allowed in nightly builds, that restriction wasn't active in `test` -- until now. Starting with 1.70.0, stable and beta builds of Rust will no longer allow unstable `test` options, making them truly nightly-only as documented.
+
+### Stabilized APIs
+
+- [`thing`](link)
+
+These APIs are now stable in const contexts:
+
+- [`const_thing`](link)
+
+### Other changes
+
+Check out everything that changed in [Rust](https://github.com/rust-lang/rust/blob/stable/RELEASES.md#version-1700-2023-06-01), [Cargo](https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md#cargo-1700-2023-06-01, and [Clippy](https://github.com/rust-lang/rust-clippy/blob/master/CHANGELOG.md#rust-170).
+
+## Contributors to 1.70.0
+
+Many people came together to create Rust 1.70.0. We couldn't have done it without all of you. [Thanks!](https://thanks.rust-lang.org/rust/1.70.0/)

From 4d927b40ad72ba2c8c892148d53369d6d5baaf91 Mon Sep 17 00:00:00 2001
From: Josh Stone <cuviper@gmail.com>
Date: Wed, 31 May 2023 11:47:19 -0700
Subject: [PATCH 02/10] Apply suggestions regarding Cargo

Co-authored-by: Eric Huss <eric@huss.org>
---
 posts/2023-06-01-Rust-1.70.0.md | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/posts/2023-06-01-Rust-1.70.0.md b/posts/2023-06-01-Rust-1.70.0.md
index dfa4d5a88..09a1eb3b8 100644
--- a/posts/2023-06-01-Rust-1.70.0.md
+++ b/posts/2023-06-01-Rust-1.70.0.md
@@ -21,7 +21,9 @@ If you'd like to help us out by testing future releases, you might consider upda
 
 ### Sparse by default for crates.io
 
-Cargo's "sparse" protocol is now enabled by default for reading the index from crates.io. This feature was previously stabilized with [Rust 1.68.0](https://blog.rust-lang.org/2023/03/09/Rust-1.68.0.html#cargos-sparse-protocol), but still required configuration to use that with crates.io. The announced plan was to make that the default in 1.70.0, and here it is! (TODO: maybe a statement about effects from user and infra sides?)
+Cargo's "sparse" protocol is now enabled by default for reading the index from crates.io. This feature was previously stabilized with [Rust 1.68.0](https://blog.rust-lang.org/2023/03/09/Rust-1.68.0.html#cargos-sparse-protocol), but still required configuration to use that with crates.io. The announced plan was to make that the default in 1.70.0, and here it is!
+
+You should see substantially improved performance when fetching information from the crates.io index. Users behind a restrictive firewall will need to ensure that access to `https://index.crates.io` is available. If for some reason you need to stay with the previous default of using the git index hosted by GitHub, the [`registries.crates-io.protocol`](https://doc.rust-lang.org/cargo/reference/config.html#registriescrates-ioprotocol) config setting can be used to change the default.
 
 ### `OnceCell` and `OnceLock`
 
@@ -53,6 +55,8 @@ The `-Cdebuginfo` compiler option has previously only supported numbers 0..=2 fo
 
 The Cargo and rustc documentation both called level 1 "line tables only" before, but it was more than that with information about all functions, just not types and variables. That level is now called "limited", and the new "line-tables-only" level is further reduced to the minimum needed for backtraces with filenames and line numbers. This may eventually become the level used for `-Cdebuginfo=1`. The other `line-directives-only` level is intended for NVPTX profiling, and is otherwise not recommended.
 
+Note that these named options are not yet available to be used via `Cargo.toml`. Support for that will be available in the next release 1.71.
+
 ### Enforced stability in the `test` CLI
 
 When `#[test]` functions are compiled, the executable gets a command-line interface from the `test` crate. This CLI has a number of options, including some that are not yet stabilized and require specifying `-Zunstable-options` as well, like many other commands in the Rust toolchain. However, while that's only intended to be allowed in nightly builds, that restriction wasn't active in `test` -- until now. Starting with 1.70.0, stable and beta builds of Rust will no longer allow unstable `test` options, making them truly nightly-only as documented.

From 0da8f341edd05c917a06bf4bed442ea25a39239d Mon Sep 17 00:00:00 2001
From: Josh Stone <cuviper@gmail.com>
Date: Wed, 31 May 2023 11:51:38 -0700
Subject: [PATCH 03/10] Use `static` in the `OnceLock` example

---
 posts/2023-06-01-Rust-1.70.0.md | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/posts/2023-06-01-Rust-1.70.0.md b/posts/2023-06-01-Rust-1.70.0.md
index 09a1eb3b8..a69f549cf 100644
--- a/posts/2023-06-01-Rust-1.70.0.md
+++ b/posts/2023-06-01-Rust-1.70.0.md
@@ -32,15 +32,15 @@ Two new types have been stabilized for one-time initialization of shared data, `
 ```rust
 use std::sync::OnceLock;
 
-fn main() {
-    let winner_lock = OnceLock::new();
+static WINNER: OnceLock<&str> = OnceLock::new();
 
+fn main() {
     let winner = std::thread::scope(|s| {
-        s.spawn(|| winner_lock.set("thread"));
+        s.spawn(|| WINNER.set("thread"));
 
         std::thread::yield_now(); // give them a chance...
 
-        winner_lock.get_or_init(|| "main")
+        WINNER.get_or_init(|| "main")
     });
 
     println!("{winner} wins!");

From 6d0e00bf3e2eb98d911e6e1376ff62d9b1e3b8a6 Mon Sep 17 00:00:00 2001
From: Josh Stone <cuviper@gmail.com>
Date: Wed, 31 May 2023 11:57:37 -0700
Subject: [PATCH 04/10] Copy Stabilized APIs from 1.70 relnotes

---
 posts/2023-06-01-Rust-1.70.0.md | 41 +++++++++++++++++++++++++++++----
 1 file changed, 36 insertions(+), 5 deletions(-)

diff --git a/posts/2023-06-01-Rust-1.70.0.md b/posts/2023-06-01-Rust-1.70.0.md
index a69f549cf..b9e252f7f 100644
--- a/posts/2023-06-01-Rust-1.70.0.md
+++ b/posts/2023-06-01-Rust-1.70.0.md
@@ -63,11 +63,42 @@ When `#[test]` functions are compiled, the executable gets a command-line interf
 
 ### Stabilized APIs
 
-- [`thing`](link)
-
-These APIs are now stable in const contexts:
-
-- [`const_thing`](link)
+- [`NonZero*::MIN/MAX`](https://doc.rust-lang.org/stable/std/num/struct.NonZeroI8.html#associatedconstant.MIN)
+- [`BinaryHeap::retain`](https://doc.rust-lang.org/stable/std/collections/struct.BinaryHeap.html#method.retain)
+- [`Default for std::collections::binary_heap::IntoIter`](https://doc.rust-lang.org/stable/std/collections/binary_heap/struct.IntoIter.html)
+- [`Default for std::collections::btree_map::{IntoIter, Iter, IterMut}`](https://doc.rust-lang.org/stable/std/collections/btree_map/struct.IntoIter.html)
+- [`Default for std::collections::btree_map::{IntoKeys, Keys}`](https://doc.rust-lang.org/stable/std/collections/btree_map/struct.IntoKeys.html)
+- [`Default for std::collections::btree_map::{IntoValues, Values}`](https://doc.rust-lang.org/stable/std/collections/btree_map/struct.IntoKeys.html)
+- [`Default for std::collections::btree_map::Range`](https://doc.rust-lang.org/stable/std/collections/btree_map/struct.Range.html)
+- [`Default for std::collections::btree_set::{IntoIter, Iter}`](https://doc.rust-lang.org/stable/std/collections/btree_set/struct.IntoIter.html)
+- [`Default for std::collections::btree_set::Range`](https://doc.rust-lang.org/stable/std/collections/btree_set/struct.Range.html)
+- [`Default for std::collections::linked_list::{IntoIter, Iter, IterMut}`](https://doc.rust-lang.org/stable/alloc/collections/linked_list/struct.IntoIter.html)
+- [`Default for std::vec::IntoIter`](https://doc.rust-lang.org/stable/alloc/vec/struct.IntoIter.html#impl-Default-for-IntoIter%3CT,+A%3E)
+- [`Default for std::iter::Chain`](https://doc.rust-lang.org/stable/std/iter/struct.Chain.html)
+- [`Default for std::iter::Cloned`](https://doc.rust-lang.org/stable/std/iter/struct.Cloned.html)
+- [`Default for std::iter::Copied`](https://doc.rust-lang.org/stable/std/iter/struct.Copied.html)
+- [`Default for std::iter::Enumerate`](https://doc.rust-lang.org/stable/std/iter/struct.Enumerate.html)
+- [`Default for std::iter::Flatten`](https://doc.rust-lang.org/stable/std/iter/struct.Flatten.html)
+- [`Default for std::iter::Fuse`](https://doc.rust-lang.org/stable/std/iter/struct.Fuse.html)
+- [`Default for std::iter::Rev`](https://doc.rust-lang.org/stable/std/iter/struct.Rev.html)
+- [`Default for std::slice::Iter`](https://doc.rust-lang.org/stable/std/slice/struct.Iter.html)
+- [`Default for std::slice::IterMut`](https://doc.rust-lang.org/stable/std/slice/struct.IterMut.html)
+- [`Rc::into_inner`](https://doc.rust-lang.org/stable/alloc/rc/struct.Rc.html#method.into_inner)
+- [`Arc::into_inner`](https://doc.rust-lang.org/stable/alloc/sync/struct.Arc.html#method.into_inner)
+- [`std::cell::OnceCell`](https://doc.rust-lang.org/stable/std/cell/struct.OnceCell.html)
+- [`Option::is_some_and`](https://doc.rust-lang.org/stable/std/option/enum.Option.html#method.is_some_and)
+- [`NonNull::slice_from_raw_parts`](https://doc.rust-lang.org/stable/std/ptr/struct.NonNull.html#method.slice_from_raw_parts)
+- [`Result::is_ok_and`](https://doc.rust-lang.org/stable/std/result/enum.Result.html#method.is_ok_and)
+- [`Result::is_err_and`](https://doc.rust-lang.org/stable/std/result/enum.Result.html#method.is_err_and)
+- [`std::sync::atomic::Atomic*::as_ptr`](https://doc.rust-lang.org/stable/std/sync/atomic/struct.AtomicU8.html#method.as_ptr)
+- [`std::io::IsTerminal`](https://doc.rust-lang.org/stable/std/io/trait.IsTerminal.html)
+- [`std::os::linux::net::SocketAddrExt`](https://doc.rust-lang.org/stable/std/os/linux/net/trait.SocketAddrExt.html)
+- [`std::os::unix::net::UnixDatagram::bind_addr`](https://doc.rust-lang.org/stable/std/os/unix/net/struct.UnixDatagram.html#method.bind_addr)
+- [`std::os::unix::net::UnixDatagram::connect_addr`](https://doc.rust-lang.org/stable/std/os/unix/net/struct.UnixDatagram.html#method.connect_addr)
+- [`std::os::unix::net::UnixDatagram::send_to_addr`](https://doc.rust-lang.org/stable/std/os/unix/net/struct.UnixDatagram.html#method.send_to_addr)
+- [`std::os::unix::net::UnixListener::bind_addr`](https://doc.rust-lang.org/stable/std/os/unix/net/struct.UnixListener.html#method.bind_addr)
+- [`std::path::Path::as_mut_os_str`](https://doc.rust-lang.org/stable/std/path/struct.Path.html#method.as_mut_os_str)
+- [`std::sync::OnceLock`](https://doc.rust-lang.org/stable/std/sync/struct.OnceLock.html)
 
 ### Other changes
 

From c879bdeea70671ad1b2b0fff2a6817efe5ef2486 Mon Sep 17 00:00:00 2001
From: Josh Stone <cuviper@gmail.com>
Date: Wed, 31 May 2023 12:00:43 -0700
Subject: [PATCH 05/10] Link the github tag for relnotes (not live yet)

---
 posts/2023-06-01-Rust-1.70.0.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/posts/2023-06-01-Rust-1.70.0.md b/posts/2023-06-01-Rust-1.70.0.md
index b9e252f7f..62e618a6c 100644
--- a/posts/2023-06-01-Rust-1.70.0.md
+++ b/posts/2023-06-01-Rust-1.70.0.md
@@ -13,7 +13,7 @@ If you have a previous version of Rust installed via rustup, you can get 1.70.0
 rustup update stable
 ```
 
-If you don't have it already, you can [get `rustup`](https://www.rust-lang.org/install.html) from the appropriate page on our website, and check out the [detailed release notes for 1.70.0](https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1700-2023-06-01) on GitHub.
+If you don't have it already, you can [get `rustup`](https://www.rust-lang.org/install.html) from the appropriate page on our website, and check out the [detailed release notes for 1.70.0](https://github.com/rust-lang/rust/releases/tag/1.70.0) on GitHub.
 
 If you'd like to help us out by testing future releases, you might consider updating locally to use the beta channel (`rustup default beta`) or the nightly channel (`rustup default nightly`). Please [report](https://github.com/rust-lang/rust/issues/new/choose) any bugs you might come across!
 
@@ -102,7 +102,7 @@ When `#[test]` functions are compiled, the executable gets a command-line interf
 
 ### Other changes
 
-Check out everything that changed in [Rust](https://github.com/rust-lang/rust/blob/stable/RELEASES.md#version-1700-2023-06-01), [Cargo](https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md#cargo-1700-2023-06-01, and [Clippy](https://github.com/rust-lang/rust-clippy/blob/master/CHANGELOG.md#rust-170).
+Check out everything that changed in [Rust](https://github.com/rust-lang/rust/releases/tag/1.70.0), [Cargo](https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md#cargo-1700-2023-06-01, and [Clippy](https://github.com/rust-lang/rust-clippy/blob/master/CHANGELOG.md#rust-170).
 
 ## Contributors to 1.70.0
 

From b15e9c66220c5a388290af0aa72e19481603abc0 Mon Sep 17 00:00:00 2001
From: Josh Stone <cuviper@gmail.com>
Date: Wed, 31 May 2023 18:35:18 -0700
Subject: [PATCH 06/10] Fix link markdown

Co-authored-by: LegionMammal978 <mattlloydhouse@gmail.com>
---
 posts/2023-06-01-Rust-1.70.0.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/posts/2023-06-01-Rust-1.70.0.md b/posts/2023-06-01-Rust-1.70.0.md
index 62e618a6c..729209004 100644
--- a/posts/2023-06-01-Rust-1.70.0.md
+++ b/posts/2023-06-01-Rust-1.70.0.md
@@ -102,7 +102,7 @@ When `#[test]` functions are compiled, the executable gets a command-line interf
 
 ### Other changes
 
-Check out everything that changed in [Rust](https://github.com/rust-lang/rust/releases/tag/1.70.0), [Cargo](https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md#cargo-1700-2023-06-01, and [Clippy](https://github.com/rust-lang/rust-clippy/blob/master/CHANGELOG.md#rust-170).
+Check out everything that changed in [Rust](https://github.com/rust-lang/rust/releases/tag/1.70.0), [Cargo](https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md#cargo-1700-2023-06-01), and [Clippy](https://github.com/rust-lang/rust-clippy/blob/master/CHANGELOG.md#rust-170).
 
 ## Contributors to 1.70.0
 

From caba6acada541f5216b9f3e4fc2005338640a640 Mon Sep 17 00:00:00 2001
From: Josh Stone <cuviper@gmail.com>
Date: Thu, 1 Jun 2023 09:59:02 -0700
Subject: [PATCH 07/10] Fix the Cargo relnotes link

Co-authored-by: Nathan Stocks <cleancut@github.com>
---
 posts/2023-06-01-Rust-1.70.0.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/posts/2023-06-01-Rust-1.70.0.md b/posts/2023-06-01-Rust-1.70.0.md
index 729209004..a7ff7c818 100644
--- a/posts/2023-06-01-Rust-1.70.0.md
+++ b/posts/2023-06-01-Rust-1.70.0.md
@@ -102,7 +102,7 @@ When `#[test]` functions are compiled, the executable gets a command-line interf
 
 ### Other changes
 
-Check out everything that changed in [Rust](https://github.com/rust-lang/rust/releases/tag/1.70.0), [Cargo](https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md#cargo-1700-2023-06-01), and [Clippy](https://github.com/rust-lang/rust-clippy/blob/master/CHANGELOG.md#rust-170).
+Check out everything that changed in [Rust](https://github.com/rust-lang/rust/releases/tag/1.70.0), [Cargo](https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md#cargo-170-2023-06-01), and [Clippy](https://github.com/rust-lang/rust-clippy/blob/master/CHANGELOG.md#rust-170).
 
 ## Contributors to 1.70.0
 

From bc6d0c2db065ac0f0addb2a20e8f2622a98dceb4 Mon Sep 17 00:00:00 2001
From: Josh Stone <cuviper@gmail.com>
Date: Thu, 1 Jun 2023 10:08:26 -0700
Subject: [PATCH 08/10] Add a note about sparse redownloading

---
 posts/2023-06-01-Rust-1.70.0.md | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/posts/2023-06-01-Rust-1.70.0.md b/posts/2023-06-01-Rust-1.70.0.md
index a7ff7c818..d5d5c8940 100644
--- a/posts/2023-06-01-Rust-1.70.0.md
+++ b/posts/2023-06-01-Rust-1.70.0.md
@@ -25,6 +25,8 @@ Cargo's "sparse" protocol is now enabled by default for reading the index from c
 
 You should see substantially improved performance when fetching information from the crates.io index. Users behind a restrictive firewall will need to ensure that access to `https://index.crates.io` is available. If for some reason you need to stay with the previous default of using the git index hosted by GitHub, the [`registries.crates-io.protocol`](https://doc.rust-lang.org/cargo/reference/config.html#registriescrates-ioprotocol) config setting can be used to change the default.
 
+One side-effect to note about changing the access method is that this also changes the path to the crate cache, so dependencies will be downloaded anew. Once you have fully committed to using the sparse protocol, you may want to clear out the old `$CARGO_HOME/registry/*/github.com-*` paths.
+
 ### `OnceCell` and `OnceLock`
 
 Two new types have been stabilized for one-time initialization of shared data, `OnceCell` and its thread-safe counterpart `OnceLock`. These can be used anywhere that immediate construction is not wanted, and perhaps not even possible like non-`const` data in global variables.

From cc3f14a0643771730e09e8aa6d55bc521b66f68a Mon Sep 17 00:00:00 2001
From: Josh Stone <cuviper@gmail.com>
Date: Thu, 1 Jun 2023 10:30:41 -0700
Subject: [PATCH 09/10] Note the unstable IDE breakage

---
 posts/2023-06-01-Rust-1.70.0.md | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/posts/2023-06-01-Rust-1.70.0.md b/posts/2023-06-01-Rust-1.70.0.md
index d5d5c8940..a311ba757 100644
--- a/posts/2023-06-01-Rust-1.70.0.md
+++ b/posts/2023-06-01-Rust-1.70.0.md
@@ -63,6 +63,8 @@ Note that these named options are not yet available to be used via `Cargo.toml`.
 
 When `#[test]` functions are compiled, the executable gets a command-line interface from the `test` crate. This CLI has a number of options, including some that are not yet stabilized and require specifying `-Zunstable-options` as well, like many other commands in the Rust toolchain. However, while that's only intended to be allowed in nightly builds, that restriction wasn't active in `test` -- until now. Starting with 1.70.0, stable and beta builds of Rust will no longer allow unstable `test` options, making them truly nightly-only as documented.
 
+There are known cases where unstable options may have been used without direct user knowledge, especially `--format json` used in IntelliJ Rust and other IDE plugins. Those projects are already adjusting to this change, and the status of JSON output can be followed in its [tracking issue](https://github.com/rust-lang/rust/issues/49359).
+
 ### Stabilized APIs
 
 - [`NonZero*::MIN/MAX`](https://doc.rust-lang.org/stable/std/num/struct.NonZeroI8.html#associatedconstant.MIN)

From 533906c0b836d4ca28d1afcdeffe0b50d1ccb4e5 Mon Sep 17 00:00:00 2001
From: Josh Stone <cuviper@gmail.com>
Date: Thu, 1 Jun 2023 10:49:22 -0700
Subject: [PATCH 10/10] Add a blurb about IsTerminal

---
 posts/2023-06-01-Rust-1.70.0.md | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/posts/2023-06-01-Rust-1.70.0.md b/posts/2023-06-01-Rust-1.70.0.md
index a311ba757..d09d520f5 100644
--- a/posts/2023-06-01-Rust-1.70.0.md
+++ b/posts/2023-06-01-Rust-1.70.0.md
@@ -51,6 +51,19 @@ fn main() {
 
 Crates such as `lazy_static` and `once_cell` have filled this need in the past, but now these building blocks are part of the standard library, ported from `once_cell`'s `unsync` and `sync` modules. There are still more methods that may be stabilized in the future, as well as companion `LazyCell` and `LazyLock` types that store their initializing function, but this first step in stabilization should already cover many use cases.
 
+### `IsTerminal`
+
+This newly-stabilized trait has a single method, `is_terminal`, to determine if a given file descriptor or handle represents a terminal or TTY. This is another case of standardizing functionality that existed in external crates, like `atty` and `is-terminal`, using the C library `isatty` function on Unix targets and similar functionality elsewhere. A common use case is for programs to distinguish between running in scripts or interactive modes, like presenting colors or even a full TUI when interactive.
+
+```rust
+use std::io::{stdout, IsTerminal};
+
+fn main() {
+    let use_color = stdout().is_terminal();
+    // if so, add color codes to program output...
+}
+```
+
 ### Named levels of debug information
 
 The `-Cdebuginfo` compiler option has previously only supported numbers 0..=2 for increasing amounts of debugging information, where Cargo defaults to 2 in dev and test profiles and 0 in release and bench profiles. These debug levels can now be set by name: "none" (0), "limited" (1), and "full" (2), as well as two new levels, "line-directives-only" and "line-tables-only".