Skip to content

Commit

Permalink
Rollup merge of rust-lang#114505 - ouz-a:cleanup_mir, r=RalfJung
Browse files Browse the repository at this point in the history
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`
  • Loading branch information
matthiaskrgr authored Aug 6, 2023
2 parents ec1d61e + 44cd3bc commit 261837c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clippy_lints/src/dereference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,7 @@ fn referent_used_exactly_once<'tcx>(
&& let [location] = *local_assignments(mir, local).as_slice()
&& let Some(statement) = mir.basic_blocks[location.block].statements.get(location.statement_index)
&& let StatementKind::Assign(box (_, Rvalue::Ref(_, _, place))) = statement.kind
&& !place.has_deref()
&& !place.is_indirect_first_projection()
// Ensure not in a loop (https://github.com/rust-lang/rust-clippy/issues/9710)
&& TriColorDepthFirstSearch::new(&mir.basic_blocks).run_from(location.block, &mut CycleDetector).is_none()
{
Expand Down

0 comments on commit 261837c

Please sign in to comment.