Merge pull request #2309 from rust-lang/restore-static

example assumes a static exists
This commit is contained in:
Tshepang Mbambo 2025-03-30 00:18:06 +02:00 committed by GitHub
commit 55aebf682d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -34,9 +34,9 @@ impl rustc_span::source_map::FileLoader for MyFileLoader {
fn read_file(&self, path: &Path) -> io::Result<String> { fn read_file(&self, path: &Path) -> io::Result<String> {
if path == Path::new("main.rs") { if path == Path::new("main.rs") {
Ok(r#" Ok(r#"
static MESSAGE: &str = "Hello, World!";
fn main() { fn main() {
let message = "Hello, World!"; println!("{MESSAGE}");
println!("{message}");
} }
"# "#
.to_string()) .to_string())