Compare commits

..

7 commits

Author SHA1 Message Date
moxian
ccb3612511 Allow specifying NOT-passes on the command line 2025-03-31 04:07:29 -07:00
moxian
21a4843791 Actually, let's not bisect imports by default
I thought it was a good idea, but now that reaper is
not completely busted, i see that this is taking a bit
longer than i'd like.. It's easier to just run reaper again
2025-03-31 04:07:29 -07:00
moxian
2031a180b7 Properly handle imports ending in ::self 2025-03-31 04:07:29 -07:00
moxian
1e46e75c6e Teach item-deleter to delete imports.
Because reaper is finnicky and does not always
work for whatever reason.

The new test from a couple commits ago now passes.
2025-03-31 04:07:28 -07:00
moxian
a70aedada5 Add a split-use pass.
It transforms "use std::io::{Read, Write}" into
"use std::io::Read; use std::io::Write"

Which later allows to remove just precisely the statements
we do not need, and leave rest be.

The test from the last commit does not pass, but that
is seemingly to do with the test harness setup, since it
works fine locally.
2025-03-31 04:07:28 -07:00
moxian
fdf0066e58 Add a test for grouped reexports (failing) 2025-03-31 04:07:28 -07:00
moxian
33c32bc0e7 Minor optimization for now-overlapping paths
Naively, if we have items (1) foo, (2) foo::bar, (3) foo::baz,
we would try to first try to remove all three of them,
and then if that fails, try to remove just (1) and (2)

..except we should already know that that would fail since it still
includes (1) which covers all three items anyway.

So, try to be smarter about this and not do that.

This is achieved by avoiding ever putting both foo and foo::whatever
in the same try-set, as that gives no information on foo::whatever
regardless of if the check passes or fails
2025-03-31 04:07:19 -07:00

View file

@ -282,7 +282,7 @@ fn layer_candidates(mut candidates: Vec<AstPath>) -> Vec<Vec<AstPath>> {
for (no, layer) in layers.iter().enumerate() {
if !layer
.iter()
.all(|known_path| candidate.has_prefix(known_path))
.any(|known_path| candidate.has_prefix(known_path))
{
appropriate_layer_no = Some(no);
break;