Skip to content

Commit 97bb063

Browse files
authored
Add doc for the clippy_lints::methods::derefs_to_slice() helper (#14564)
changelog: none
2 parents 1a1ad5e + f5122ae commit 97bb063

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: clippy_lints/src/methods/utils.rs

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ use rustc_middle::ty::{self, Ty};
88
use rustc_span::Span;
99
use rustc_span::symbol::sym;
1010

11+
/// Checks if `expr`, of type `ty`, corresponds to a slice or can be dereferenced to a slice, or if
12+
/// `expr` is a method call to `.iter()` on such a type. In these cases, return the slice-like
13+
/// expression.
1114
pub(super) fn derefs_to_slice<'tcx>(
1215
cx: &LateContext<'tcx>,
1316
expr: &'tcx Expr<'tcx>,

0 commit comments

Comments
 (0)