rust-reduce
rust-reduce copied to clipboard
Improve invocation
Any objections to a PR that walkdir to find .rs files in a crate's subdirs and then reduces them?
Looking to use this as a way to reduce an ICE found in rustc to a minimal reproduction.
I think I've misunderstood. I see there's a parse_and_inline_modules. If I point it to main.rs or lib.rs it should drag everything else in. Will try that.
That works, though a little fiddly the copy pasting of rustc command line and adding in the $1 arg. It would be even better if we could package it as cargo-reduce and then one could type cargo reduce "regex expression" and it would run cargo check repeatedly in place.
That would make it childs play to run. One could still provide an arg for a shell script to run if people wanted to run more than cargo check/regex.
(Easy setup is important as when the test1.sh isn't quite pointing to the right file it deletes everything).
I think you always need some kind of shell script as you need to somehow determine whether a particular compiler run is "interesting" or not. Inserting a shell script means the user can write arbitrary an arbitrary script to determine interestingness.
I'm open to ideas on this.