Skip to content

Commit 44cd3bc

Browse files
committed
cleanup misinformation regarding has_deref
1 parent b0e64a9 commit 44cd3bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_lints/src/dereference.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1170,7 +1170,7 @@ fn referent_used_exactly_once<'tcx>(
11701170
&& let [location] = *local_assignments(mir, local).as_slice()
11711171
&& let Some(statement) = mir.basic_blocks[location.block].statements.get(location.statement_index)
11721172
&& let StatementKind::Assign(box (_, Rvalue::Ref(_, _, place))) = statement.kind
1173-
&& !place.has_deref()
1173+
&& !place.is_indirect_first_projection()
11741174
// Ensure not in a loop (https://github.com/rust-lang/rust-clippy/issues/9710)
11751175
&& TriColorDepthFirstSearch::new(&mir.basic_blocks).run_from(location.block, &mut CycleDetector).is_none()
11761176
{

0 commit comments

Comments
 (0)