Repository: dtolnay/cargo-expand (language: rust)

Issue:
Investigate whether `cargo check` can perform expansion
Currently `cargo expand` is implemented in terms of `cargo rustc` which appears to compile the crate, similar to `cargo build`. Investigate whether there is a way for `cargo rustc` to behave like `cargo check` instead. Check is generally going to complete faster than build.


Discussion / hints:

Fix patch:
diff --git a/src/main.rs b/src/main.rs
index 3c48901..9f4263e 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -121,7 +121,7 @@ fn wrap_args<I>(it: I, outfile: Option<&PathBuf>) -> Vec<OsString>
 where
     I: IntoIterator<Item = OsString>,
 {
-    let mut args = vec!["rustc".into()];
+    let mut args = vec!["rustc".into(), "--profile=check".into()];
     let mut ends_with_test = false;
     let mut ends_with_example = false;
     let mut has_color = false;


Test patch: