File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -36,14 +36,27 @@ declare_clippy_lint! {
3636 /// argument may also fail to compile if you change the argument. Applying
3737 /// this lint on them will fix the problem, but they may be in other crates.
3838 ///
39+ /// One notable example of a function that may cause issues, and which cannot
40+ /// easily be changed due to being in the standard library is `Vec::contains`.
41+ /// when called on a `Vec<Vec<T>>`. If a `&Vec` is passed to that method then
42+ /// it will compile, but if a `&[T]` is passed then it will not compile.
43+ ///
44+ /// ```ignore
45+ /// fn cannot_take_a_slice(v: &Vec<u8>) -> bool {
46+ /// let vec_of_vecs: Vec<Vec<u8>> = some_other_fn();
47+ ///
48+ /// vec_of_vecs.contains(v)
49+ /// }
50+ /// ```
51+ ///
3952 /// Also there may be `fn(&Vec)`-typed references pointing to your function.
4053 /// If you have them, you will get a compiler error after applying this lint's
4154 /// suggestions. You then have the choice to undo your changes or change the
4255 /// type of the reference.
4356 ///
4457 /// Note that if the function is part of your public interface, there may be
45- /// other crates referencing it you may not be aware. Carefully deprecate the
46- /// function before applying the lint suggestions in this case.
58+ /// other crates referencing it, of which you may not be aware. Carefully
59+ /// deprecate the function before applying the lint suggestions in this case.
4760 ///
4861 /// **Example:**
4962 /// ```ignore
You can’t perform that action at this time.
0 commit comments