From ec50a750f96164e588adcc9ef5d47b8ac89869d1 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Tue, 12 Nov 2019 16:58:37 +0100 Subject: [PATCH] Fix error codes index generation --- src/tools/error_index_generator/build.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tools/error_index_generator/build.rs b/src/tools/error_index_generator/build.rs index c59533da1dc..3261bf5a98b 100644 --- a/src/tools/error_index_generator/build.rs +++ b/src/tools/error_index_generator/build.rs @@ -14,7 +14,9 @@ fn main() { if entry.file_name() == "error_codes.rs" { println!("cargo:rerun-if-changed={}", entry.path().to_str().unwrap()); let file = fs::read_to_string(entry.path()).unwrap() - .replace("syntax::register_diagnostics!", "register_diagnostics!"); + .replace("crate::register_diagnostics!", "register_diagnostics!") + .replace(": include_str!(\"./", + ": include_str!(\"../../../../../../../../src/librustc_error_codes/"); let contents = format!("(|| {{\n{}\n}})()", file); fs::write(&out_dir.join(&format!("error_{}.rs", idx)), &contents).unwrap();