Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .ripr/allow-attributes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ crates/ripr/src/cli/progress.rs|expect(dead_code)|1|#9501: `cfg_attr(not(test),
crates/ripr/src/edit_cage/mod.rs|expect(dead_code)|1|#9501: `cfg_attr(not(test), expect(dead_code))` on the explicit-module capture API and authority fields beyond the attempt binding, exercised by tests only.
crates/ripr/src/lib.rs|expect(dead_code)|2|#9501: two `cfg_attr(not(test), expect(dead_code))` on staged internal contracts: #3163 connects the RepairAttempt delta producer and #2657 the first producer, each before public projection.
xtask/src/rust_region_scan.rs|allow(dead_code)|1|#9501: `cfg_attr` text inside a fixture literal or doc example (not a live suppression); newly inventoried because the scanner reads attribute text anywhere. Remove this row if the literals are removed.
crates/ripr/src/analysis/test_grip_evidence/value_contradiction.rs|allow(dead_code)|1|#4681: `exact_value_assertion_verdict` is the bare shadow-aware oracle entry exercised from this module's unit tests; production paths use `exact_value_assertion_verdict_for_test` with index-aware public-parent delegation.
90 changes: 64 additions & 26 deletions crates/ripr/src/analysis/test_grip_evidence/related_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,37 +387,75 @@ pub(super) fn match_helper_owner_call(
if owner.name.is_empty() {
return;
}
// A free owner is reached through a helper only when the helper body
// spells a bare or module-qualified call of it; a helper calling only
// `Type::name(..)` never credits the free `name` beside it (#6713).
let indices = if owner.free_function {
context
.tests_by_free_helper_owner_call_name
.get(&owner.name)
} else {
context.tests_by_helper_owner_call_name.get(&owner.name)
};
let Some(indices) = indices else {
return;
};
for test_index in indices {
if owner.inherent_receiver
&& !owner.inherent_owner.is_some_and(|function| {
context.inherent_helper_reaches_owner(*test_index, function)
})
{
let mut lookup_names = vec![owner.name.clone()];
if let Some(module_path) = &owner.module_path {
let normalized = module_path.replace('/', "::");
if !normalized.is_empty() {
lookup_names.push(format!("{normalized}::{}", owner.name));
}
}
let mut linked = BTreeSet::new();
for lookup_name in &lookup_names {
let batch = if owner.free_function {
context
.tests_by_free_helper_owner_call_name
.get(lookup_name)
} else {
context.tests_by_helper_owner_call_name.get(lookup_name)
};
let Some(batch) = batch else {
continue;
};
for &test_index in batch {
if linked.contains(&test_index) {
continue;
}
if owner.inherent_receiver
&& !owner.inherent_owner.is_some_and(|function| {
context.inherent_helper_reaches_owner(test_index, function)
})
{
continue;
}
if lookup_name == &owner.name
&& owner.function.is_some_and(|owner_fn| {
owner_same_file_helper_name_collision(context.index, owner_fn)
&& context.tests.get(test_index).is_none_or(|indexed| {
!context::production_delegation_from_test_reaches_owner(
context.index,
indexed.test,
owner_fn,
)
})
})
{
continue;
}
linked.insert(test_index);
insert_related_candidate(
candidates,
context,
prefix,
test_index,
RelationReason::HelperOwnerCall,
);
}
insert_related_candidate(
candidates,
context,
prefix,
*test_index,
RelationReason::HelperOwnerCall,
);
}
}

fn owner_same_file_helper_name_collision(index: &RustIndex, owner: &FunctionSummary) -> bool {
index
.functions()
.iter()
.filter(|function| {
function.file == owner.file
&& function.name == owner.name
&& !function.source_role.is_evidence_role()
})
.count()
> 1
}

pub(super) fn match_target_affinity_owner_call(
candidates: &mut BTreeMap<usize, RelationReason>,
seam: &RepoSeam,
Expand Down
Loading
Loading