diff options
Diffstat (limited to 'xtask/src/lib.rs')
-rw-r--r-- | xtask/src/lib.rs | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/xtask/src/lib.rs b/xtask/src/lib.rs index 2fdb08f2e..f3ad81ba7 100644 --- a/xtask/src/lib.rs +++ b/xtask/src/lib.rs | |||
@@ -62,17 +62,6 @@ pub fn run_rustfmt(mode: Mode) -> Result<()> { | |||
62 | Ok(()) | 62 | Ok(()) |
63 | } | 63 | } |
64 | 64 | ||
65 | fn reformat(text: impl std::fmt::Display) -> Result<String> { | ||
66 | let _e = pushenv("RUSTUP_TOOLCHAIN", "stable"); | ||
67 | ensure_rustfmt()?; | ||
68 | let stdout = run!( | ||
69 | "rustfmt --config-path {} --config fn_single_line=true", project_root().join("rustfmt.toml").display(); | ||
70 | <text.to_string().as_bytes() | ||
71 | )?; | ||
72 | let preamble = "Generated file, do not edit by hand, see `xtask/src/codegen`"; | ||
73 | Ok(format!("//! {}\n\n{}\n", preamble, stdout)) | ||
74 | } | ||
75 | |||
76 | fn ensure_rustfmt() -> Result<()> { | 65 | fn ensure_rustfmt() -> Result<()> { |
77 | let out = run!("rustfmt --version")?; | 66 | let out = run!("rustfmt --version")?; |
78 | if !out.contains("stable") { | 67 | if !out.contains("stable") { |
@@ -103,7 +92,7 @@ pub fn run_clippy() -> Result<()> { | |||
103 | } | 92 | } |
104 | 93 | ||
105 | pub fn run_fuzzer() -> Result<()> { | 94 | pub fn run_fuzzer() -> Result<()> { |
106 | let _d = pushd("./crates/ra_syntax"); | 95 | let _d = pushd("./crates/syntax"); |
107 | let _e = pushenv("RUSTUP_TOOLCHAIN", "nightly"); | 96 | let _e = pushenv("RUSTUP_TOOLCHAIN", "nightly"); |
108 | if run!("cargo fuzz --help").is_err() { | 97 | if run!("cargo fuzz --help").is_err() { |
109 | run!("cargo install cargo-fuzz")?; | 98 | run!("cargo install cargo-fuzz")?; |
@@ -139,7 +128,7 @@ pub fn run_pre_cache() -> Result<()> { | |||
139 | } | 128 | } |
140 | 129 | ||
141 | fs2::remove_file("./target/.rustc_info.json")?; | 130 | fs2::remove_file("./target/.rustc_info.json")?; |
142 | let to_delete = ["ra_", "heavy_test", "xtask"]; | 131 | let to_delete = ["hir", "heavy_test", "xtask", "ide", "rust-analyzer"]; |
143 | for &dir in ["./target/debug/deps", "target/debug/.fingerprint"].iter() { | 132 | for &dir in ["./target/debug/deps", "target/debug/.fingerprint"].iter() { |
144 | for entry in Path::new(dir).read_dir()? { | 133 | for entry in Path::new(dir).read_dir()? { |
145 | let entry = entry?; | 134 | let entry = entry?; |