Compare commits

..

7 commits

Author SHA1 Message Date
moxian
6c67c7e12d Allow specifying NOT-passes on the command line 2025-03-31 03:50:21 -07:00
moxian
7b28f80cd6 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 03:50:13 -07:00
moxian
4af04f2191 Properly handle imports ending in ::self 2025-03-31 03:47:59 -07:00
moxian
f7b1ea31ee 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-30 23:08:23 -07:00
moxian
1f6cec7d7b 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-30 23:08:23 -07:00
moxian
963a1faf69 Add a test for grouped reexports (failing) 2025-03-30 23:08:23 -07:00
moxian
5d4605c8cc 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-30 23:08:23 -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()
.any(|known_path| candidate.has_prefix(known_path))
.all(|known_path| candidate.has_prefix(known_path))
{
appropriate_layer_no = Some(no);
break;