Improve unset OUT_DIR error message

This commit is contained in:
Lukas Wirth 2025-02-20 13:05:06 +01:00
parent e865b249e6
commit 6b32c8329f
2 changed files with 3 additions and 3 deletions

View File

@ -833,7 +833,7 @@ fn env_expand(
if key.as_str() == "OUT_DIR" { if key.as_str() == "OUT_DIR" {
err = Some(ExpandError::other( err = Some(ExpandError::other(
span, span,
r#"`OUT_DIR` not set, enable "build scripts" to fix"#, r#"`OUT_DIR` not set, build scripts may have failed to run"#,
)); ));
} }

View File

@ -133,7 +133,7 @@ macro_rules! env { () => {} }
macro_rules! concat { () => {} } macro_rules! concat { () => {} }
include!(concat!(env!("OUT_DIR"), "/out.rs")); include!(concat!(env!("OUT_DIR"), "/out.rs"));
//^^^^^^^^^ error: `OUT_DIR` not set, enable "build scripts" to fix //^^^^^^^^^ error: `OUT_DIR` not set, build scripts may have failed to run
"#, "#,
); );
} }
@ -186,7 +186,7 @@ fn main() {
//^^^^^^^ error: expected string literal //^^^^^^^ error: expected string literal
env!("OUT_DIR"); env!("OUT_DIR");
//^^^^^^^^^ error: `OUT_DIR` not set, enable "build scripts" to fix //^^^^^^^^^ error: `OUT_DIR` not set, build scripts may have failed to run
compile_error!("compile_error works"); compile_error!("compile_error works");
//^^^^^^^^^^^^^ error: compile_error works //^^^^^^^^^^^^^ error: compile_error works