]> git.lizzy.rs Git - rust.git/blobdiff - src/bootstrap/run.rs
Rollup merge of #102871 - notriddle:notriddle/trait-impl-anchor, r=GuillaumeGomez
[rust.git] / src / bootstrap / run.rs
index 25abe7a72fdc8d5b6512106406771b66bce3dd20..511872903d14e29d7e2c28ff6efa7b2584785a3d 100644 (file)
@@ -103,3 +103,25 @@ fn run(self, builder: &Builder<'_>) -> Self::Output {
         builder.run(&mut cmd);
     }
 }
+
+#[derive(Debug, PartialOrd, Ord, Copy, Clone, Hash, PartialEq, Eq)]
+pub struct ReplaceVersionPlaceholder;
+
+impl Step for ReplaceVersionPlaceholder {
+    type Output = ();
+    const ONLY_HOSTS: bool = true;
+
+    fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
+        run.path("src/tools/replace-version-placeholder")
+    }
+
+    fn make_run(run: RunConfig<'_>) {
+        run.builder.ensure(ReplaceVersionPlaceholder);
+    }
+
+    fn run(self, builder: &Builder<'_>) -> Self::Output {
+        let mut cmd = builder.tool_cmd(Tool::ReplaceVersionPlaceholder);
+        cmd.arg(&builder.src);
+        builder.run(&mut cmd);
+    }
+}