Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(build-rs): Add the 'error' directive #14910

Merged
merged 8 commits into from
Dec 9, 2024
5 changes: 4 additions & 1 deletion crates/build-rs/src/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@
//!
//! Reference: <https://doc.rust-lang.org/cargo/reference/build-scripts.html#outputs-of-the-build-script>

use std::ffi::OsStr;
use std::path::Path;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to automate this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rustfmt feature is unstable :(

use std::{fmt::Display, fmt::Write as _};

use crate::ident::{is_ascii_ident, is_ident};
use std::{ffi::OsStr, fmt::Display, fmt::Write, path::Path, str};

fn emit(directive: &str, value: impl Display) {
println!("cargo::{}={}", directive, value);
Expand Down