about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTshepang Mbambo <tshepang@gmail.com>2025-03-30 00:16:39 +0200
committerTshepang Mbambo <tshepang@gmail.com>2025-03-30 00:16:39 +0200
commit471a2a8b87d8b5ba03a43a2c067dd322c1f5e7af (patch)
tree7130830fa302cdf2836b93abcc09d85b496211d8
parent904fedf65eb1dfac85c6694a0f76c0d1e930322e (diff)
downloadrust-471a2a8b87d8b5ba03a43a2c067dd322c1f5e7af.tar.gz
rust-471a2a8b87d8b5ba03a43a2c067dd322c1f5e7af.zip
example assumes a static exists
This was removed, likely by mistake, during a refactor.
-rw-r--r--src/doc/rustc-dev-guide/examples/rustc-driver-example.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/doc/rustc-dev-guide/examples/rustc-driver-example.rs b/src/doc/rustc-dev-guide/examples/rustc-driver-example.rs
index fb8b13ad154..0e3450086ba 100644
--- a/src/doc/rustc-dev-guide/examples/rustc-driver-example.rs
+++ b/src/doc/rustc-dev-guide/examples/rustc-driver-example.rs
@@ -34,9 +34,9 @@ impl rustc_span::source_map::FileLoader for MyFileLoader {
     fn read_file(&self, path: &Path) -> io::Result<String> {
         if path == Path::new("main.rs") {
             Ok(r#"
+static MESSAGE: &str = "Hello, World!";
 fn main() {
-    let message = "Hello, World!";
-    println!("{message}");
+    println!("{MESSAGE}");
 }
 "#
             .to_string())