Skip to content

Commit 261837c

Browse files
authored
Rollup merge of rust-lang#114505 - ouz-a:cleanup_mir, r=RalfJung
Add documentation to has_deref Documentation of `has_deref` needed some polish to be more clear about where it should be used and what's it's purpose. cc rust-lang#114401 r? `@RalfJung`
2 parents ec1d61e + 44cd3bc commit 261837c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_lints/src/dereference.rs

+1-1
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)