]> git.lizzy.rs Git - rust.git/blob - tests/ui/implicit_clone.stderr
Fix `unnecessary_cast` suggestion when taking a reference
[rust.git] / tests / ui / implicit_clone.stderr
1 error: implicitly cloning a `Vec` by calling `to_owned` on its dereferenced type
2   --> $DIR/implicit_clone.rs:66:13
3    |
4 LL |     let _ = vec.to_owned();
5    |             ^^^^^^^^^^^^^^ help: consider using: `vec.clone()`
6    |
7    = note: `-D clippy::implicit-clone` implied by `-D warnings`
8
9 error: implicitly cloning a `Vec` by calling `to_vec` on its dereferenced type
10   --> $DIR/implicit_clone.rs:67:13
11    |
12 LL |     let _ = vec.to_vec();
13    |             ^^^^^^^^^^^^ help: consider using: `vec.clone()`
14
15 error: implicitly cloning a `Vec` by calling `to_owned` on its dereferenced type
16   --> $DIR/implicit_clone.rs:71:13
17    |
18 LL |     let _ = vec_ref.to_owned();
19    |             ^^^^^^^^^^^^^^^^^^ help: consider using: `vec_ref.clone()`
20
21 error: implicitly cloning a `Vec` by calling `to_vec` on its dereferenced type
22   --> $DIR/implicit_clone.rs:72:13
23    |
24 LL |     let _ = vec_ref.to_vec();
25    |             ^^^^^^^^^^^^^^^^ help: consider using: `vec_ref.clone()`
26
27 error: implicitly cloning a `String` by calling `to_owned` on its dereferenced type
28   --> $DIR/implicit_clone.rs:84:13
29    |
30 LL |     let _ = str.to_owned();
31    |             ^^^^^^^^^^^^^^ help: consider using: `str.clone()`
32
33 error: implicitly cloning a `Kitten` by calling `to_owned` on its dereferenced type
34   --> $DIR/implicit_clone.rs:88:13
35    |
36 LL |     let _ = kitten.to_owned();
37    |             ^^^^^^^^^^^^^^^^^ help: consider using: `kitten.clone()`
38
39 error: implicitly cloning a `PathBuf` by calling `to_owned` on its dereferenced type
40   --> $DIR/implicit_clone.rs:98:13
41    |
42 LL |     let _ = pathbuf.to_owned();
43    |             ^^^^^^^^^^^^^^^^^^ help: consider using: `pathbuf.clone()`
44
45 error: implicitly cloning a `PathBuf` by calling `to_path_buf` on its dereferenced type
46   --> $DIR/implicit_clone.rs:99:13
47    |
48 LL |     let _ = pathbuf.to_path_buf();
49    |             ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `pathbuf.clone()`
50
51 error: implicitly cloning a `OsString` by calling `to_owned` on its dereferenced type
52   --> $DIR/implicit_clone.rs:102:13
53    |
54 LL |     let _ = os_string.to_owned();
55    |             ^^^^^^^^^^^^^^^^^^^^ help: consider using: `os_string.clone()`
56
57 error: implicitly cloning a `OsString` by calling `to_os_string` on its dereferenced type
58   --> $DIR/implicit_clone.rs:103:13
59    |
60 LL |     let _ = os_string.to_os_string();
61    |             ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `os_string.clone()`
62
63 error: implicitly cloning a `PathBuf` by calling `to_path_buf` on its dereferenced type
64   --> $DIR/implicit_clone.rs:114:13
65    |
66 LL |     let _ = pathbuf_ref.to_path_buf();
67    |             ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(*pathbuf_ref).clone()`
68
69 error: implicitly cloning a `PathBuf` by calling `to_path_buf` on its dereferenced type
70   --> $DIR/implicit_clone.rs:117:13
71    |
72 LL |     let _ = pathbuf_ref.to_path_buf();
73    |             ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(**pathbuf_ref).clone()`
74
75 error: aborting due to 12 previous errors
76