Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ninja-build_rs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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"
Expand Down
1 change: 1 addition & 0 deletions ninja-build_rs/examples/assert_matches/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
2 changes: 1 addition & 1 deletion ninja-build_rs/examples/assert_matches/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
40 changes: 40 additions & 0 deletions ninja-build_rs/src/nightly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]`
Expand All @@ -135,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),
}
Expand All @@ -144,11 +154,13 @@ 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,
"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()),
}
}
Expand Down Expand Up @@ -232,6 +244,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#"
Expand Down Expand Up @@ -270,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]);
}
"#;
}
}
Expand Down Expand Up @@ -321,6 +353,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(
Expand Down Expand Up @@ -363,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),
}
}
Expand Down
2 changes: 1 addition & 1 deletion ninja-xtask/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading