diff --git a/docs/code-examples/build.rs b/docs/code-examples/build.rs index 43b70a3f426b..0834fb1e91e7 100644 --- a/docs/code-examples/build.rs +++ b/docs/code-examples/build.rs @@ -42,7 +42,9 @@ fn main() { "let args = _args;", ); let contents = format!( - "//! DO NOT EDIT! This is a py. The original is in {path:?}.\n{contents}" + "//! DO NOT EDIT! This file was autogenerated by `{}`. The original is in `{}`.\n{contents}", + file!().replace('\\', "/"), + path.to_str().unwrap().replace('\\', "/"), ); let target_path = examples_path.join(format!("{example_name}.rs"));