mirror of
https://github.com/Noratrieb/cargo-minimize.git
synced 2026-01-15 08:55:02 +01:00
Fix delete-unused-functions panics
The pass used to (?) track invalidated files itself,
but now that functionality has been moved up one level,
but also kinda not really.
So here we clarify this by:
- making reaper not care about tracking invalidated files anymore
- making processor yes care about tracking invalidated files, and
ensuring that it does not call process_file again after gettin
ProcessState::FileInvalidated, as it advertizes to do.
This commit is contained in:
parent
1d46b44fcf
commit
b4e587506f
2 changed files with 13 additions and 28 deletions
|
|
@ -19,7 +19,7 @@ pub(crate) trait Pass {
|
|||
|
||||
/// Process a file. The state of the processor might get invalidated in the process as signaled with
|
||||
/// `ProcessState::FileInvalidated`. When a file is invalidated, the minimizer will call `Processor::refersh_state`
|
||||
/// before calling the this function on the same file again.
|
||||
/// before calling this function on the same file again.
|
||||
fn process_file(
|
||||
&mut self,
|
||||
krate: &mut syn::File,
|
||||
|
|
@ -203,14 +203,14 @@ impl Minimizer {
|
|||
if after.reproduces_issue() {
|
||||
change.commit();
|
||||
checker.reproduces();
|
||||
if has_made_change == ProcessState::FileInvalidated {
|
||||
invalidated_files.insert(file);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
change.rollback()?;
|
||||
checker.does_not_reproduce();
|
||||
}
|
||||
|
||||
if has_made_change == ProcessState::FileInvalidated {
|
||||
invalidated_files.insert(file);
|
||||
}
|
||||
}
|
||||
ProcessState::NoChange => {
|
||||
if self.options.no_color {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue