Skip to content

Commit ec50a75

Browse files
Fix error codes index generation
1 parent cfd4e97 commit ec50a75

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/tools/error_index_generator/build.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ fn main() {
1414
if entry.file_name() == "error_codes.rs" {
1515
println!("cargo:rerun-if-changed={}", entry.path().to_str().unwrap());
1616
let file = fs::read_to_string(entry.path()).unwrap()
17-
.replace("syntax::register_diagnostics!", "register_diagnostics!");
17+
.replace("crate::register_diagnostics!", "register_diagnostics!")
18+
.replace(": include_str!(\"./",
19+
": include_str!(\"../../../../../../../../src/librustc_error_codes/");
1820
let contents = format!("(|| {{\n{}\n}})()", file);
1921

2022
fs::write(&out_dir.join(&format!("error_{}.rs", idx)), &contents).unwrap();

0 commit comments

Comments
 (0)