From 85c809a17a67c99e02d20eed045bddce7f6aa4d1 Mon Sep 17 00:00:00 2001 From: Mike Foster Date: Fri, 3 Jul 2026 16:56:01 +0000 Subject: [PATCH 1/6] can_vector --- ninja-build_rs/src/nightly.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/ninja-build_rs/src/nightly.rs b/ninja-build_rs/src/nightly.rs index c93124b..fc48dd8 100644 --- a/ninja-build_rs/src/nightly.rs +++ b/ninja-build_rs/src/nightly.rs @@ -115,6 +115,11 @@ pub enum UnstableFeature { /// use std::assert_matches::assert_matches; /// ``` assert_matches, + /// ## Provides cfg flags for feature [`can_vector`](https://github.com/rust-lang/rust/issues/69941) + /// - `#![cfg_attr(unstable_can_vector, feature(can_vector))]` + /// - `#[cfg(has_can_vector)]` + /// - this gates [`std::io::Read::is_read_vectored`] & [`std::io::Write::is_write_vectored`] + can_vector, /// ## Provides cfg flags: /// - `#![cfg_attr(unstable_iterator_try_collect, feature(iterator_try_collect))]` /// - `#[cfg(has_iterator_try_collect)]` @@ -144,6 +149,7 @@ impl UnstableFeature { fn from(feature: &str) -> Self { match feature { "assert_matches" => Self::assert_matches, + "can_vector" => Self::can_vector, "iterator_try_collect" => Self::iterator_try_collect, "never_type" => Self::never_type, "proc_macro_diagnostic" => Self::proc_macro_diagnostic, @@ -232,6 +238,15 @@ fn main() { "#; } + pub mod can_vector { + pub const AVAILABLE: &str = r#" +use std::io::Read; +fn main() { + std::io::empty().is_read_vectored(); +} +"#; + } + pub mod iterator_try_collect { // vec! not array: https://internals.rust-lang.org/t/code-compiles-on-playground-but-fails-when-passed-via-stdin-to-rustc/24393 pub const AVAILABLE: &str = r#" @@ -321,6 +336,10 @@ impl Nightly for AutoCfg { autocfg::emit("assert_matches_location=\"module\""); } } + UnstableFeature::can_vector => { + unstable(ac, &feature, allowed); + has(ac, &feature, allowed, probes::can_vector::AVAILABLE); + } UnstableFeature::iterator_try_collect => { unstable(self, &feature, allowed); has( From c6561f661a1482e821354018149ebb6a3e570a20 Mon Sep 17 00:00:00 2001 From: Mike Foster Date: Fri, 3 Jul 2026 17:09:56 +0000 Subject: [PATCH 2/6] write_all_vectored --- ninja-build_rs/src/nightly.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/ninja-build_rs/src/nightly.rs b/ninja-build_rs/src/nightly.rs index fc48dd8..2bf92ee 100644 --- a/ninja-build_rs/src/nightly.rs +++ b/ninja-build_rs/src/nightly.rs @@ -140,6 +140,11 @@ pub enum UnstableFeature { /// - `#![cfg_attr(unstable_try_trait_v2_residual, feature(try_trait_v2_residual))]` /// - `#[cfg(has_try_trait_v2_residual)]` try_trait_v2_residual, + /// ## Provides cfg flags for feature [`write_all_vectored`](https://github.com/rust-lang/rust/issues/70436) + /// - `#![cfg_attr(unstable_write_all_vectored, feature(write_all_vectored))]` + /// - `#[cfg(has_write_all_vectored)]` + /// - this gates [`std::io::Write::write_all_vectored`] + write_all_vectored, /// only provides `unstable_...` - please raise a PR to add a custom probe for `has_...` OtherFeature(String), } @@ -155,6 +160,7 @@ impl UnstableFeature { "proc_macro_diagnostic" => Self::proc_macro_diagnostic, "try_trait_v2" => Self::try_trait_v2, "try_trait_v2_residual" => Self::try_trait_v2_residual, + "write_all_vectored" => Self::write_all_vectored, _ => Self::OtherFeature(feature.to_string()), } } @@ -285,6 +291,17 @@ use std::ops::Try; pub mod try_trait_v2_residual { pub const AVAILABLE: &str = r#" use std::ops::Residual; +"#; + } + + pub mod write_all_vectored { + pub const AVAILABLE: &str = r#" +use std::io::{empty, Write, IoSlice}; +fn main() { + let buf: [u8;_] = [0]; + let slice = IoSlice::new(&buf); + empty().write_all_vectored(&mut [slice]); +} "#; } } @@ -382,6 +399,10 @@ impl Nightly for AutoCfg { probes::try_trait_v2_residual::AVAILABLE, ); } + UnstableFeature::write_all_vectored => { + unstable(ac, &feature, allowed); + has(ac, &feature, allowed, probes::write_all_vectored::AVAILABLE); + } UnstableFeature::OtherFeature(_) => unstable(self, &feature, allowed), } } From 1a1bf54328aa94e9bdd93b0647786e67aaaecfea Mon Sep 17 00:00:00 2001 From: Mike Foster Date: Fri, 3 Jul 2026 17:29:18 +0000 Subject: [PATCH 3/6] v bump --- ninja-build_rs/Cargo.toml | 2 +- ninja-xtask/Cargo.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ninja-build_rs/Cargo.toml b/ninja-build_rs/Cargo.toml index e31e712..930292f 100644 --- a/ninja-build_rs/Cargo.toml +++ b/ninja-build_rs/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ninja-build_rs" -version = "0.4.0" +version = "0.4.1" edition = "2024" readme = "README.md" description = "build script helpers for working with nightly" diff --git a/ninja-xtask/Cargo.lock b/ninja-xtask/Cargo.lock index 8b15137..b67b163 100644 --- a/ninja-xtask/Cargo.lock +++ b/ninja-xtask/Cargo.lock @@ -853,4 +853,4 @@ checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" [[patch.unused]] name = "ninja-build_rs" -version = "0.4.0" +version = "0.4.1" From ece7ecbf6814497e0c4895db576ecb722fc4c3d2 Mon Sep 17 00:00:00 2001 From: Mike Foster Date: Fri, 3 Jul 2026 18:47:39 +0000 Subject: [PATCH 4/6] set msrv --- ninja-build_rs/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/ninja-build_rs/Cargo.toml b/ninja-build_rs/Cargo.toml index 930292f..55bbdef 100644 --- a/ninja-build_rs/Cargo.toml +++ b/ninja-build_rs/Cargo.toml @@ -10,6 +10,7 @@ homepage = "https://github.com/MusicalNinjaDad/rust" repository = "https://github.com/MusicalNinjaDad/rust" categories = ["development-tools::build-utils"] license = "MIT" +rust-version = "1.85.1" [dependencies] autocfg = "1.5.1" From 45c3d112ff8770f2a7a0f1b757cfa23b58ba9dd5 Mon Sep 17 00:00:00 2001 From: Mike Foster Date: Fri, 3 Jul 2026 18:55:04 +0000 Subject: [PATCH 5/6] set msrv in test fixture --- ninja-build_rs/examples/assert_matches/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/ninja-build_rs/examples/assert_matches/Cargo.toml b/ninja-build_rs/examples/assert_matches/Cargo.toml index a5fe4ae..6e68afe 100644 --- a/ninja-build_rs/examples/assert_matches/Cargo.toml +++ b/ninja-build_rs/examples/assert_matches/Cargo.toml @@ -3,6 +3,7 @@ name = "ninja-build_rs-assert_matches_fixture" edition = "2024" version = "0.0.0" publish = false +rust-version = "1.85.1" [lib] From bf19ac6ad8bbde13c322656a6256d260418e8f07 Mon Sep 17 00:00:00 2001 From: Mike Foster Date: Fri, 3 Jul 2026 18:58:58 +0000 Subject: [PATCH 6/6] use correct msrv when testing fixture --- ninja-build_rs/examples/assert_matches/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ninja-build_rs/examples/assert_matches/test.sh b/ninja-build_rs/examples/assert_matches/test.sh index 8304e99..e28ec2c 100755 --- a/ninja-build_rs/examples/assert_matches/test.sh +++ b/ninja-build_rs/examples/assert_matches/test.sh @@ -5,4 +5,4 @@ set -euxo pipefail RUSTC_BOOTSTRAP=0 cargo +stable test cargo +nightly test cargo +nightly-2026-01-01 test -RUSTC_BOOTSTRAP=0 cargo +1.85.0 test +RUSTC_BOOTSTRAP=0 cargo +1.85.1 test