fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.4 KiB32 linesraw
1error: using `.clone()` on a double reference, which returns `&Vec<i32>` instead of cloning the inner type
2  --> $DIR/suspicious-double-ref-op.rs:15:23
3   |
4LL |     let z: &Vec<_> = y.clone();
5   |                       ^^^^^^^^
6   |
7note: the lint level is defined here
8  --> $DIR/suspicious-double-ref-op.rs:2:9
9   |
10LL | #![deny(suspicious_double_ref_op, noop_method_call)]
11   |         ^^^^^^^^^^^^^^^^^^^^^^^^
12
13error: using `.clone()` on a double reference, which returns `&CloneType<u32>` instead of cloning the inner type
14  --> $DIR/suspicious-double-ref-op.rs:33:63
15   |
16LL |     let clone_type_ref_clone: &CloneType<u32> = clone_type_ref.clone();
17   |                                                               ^^^^^^^^
18
19error: using `.deref()` on a double reference, which returns `&PlainType<u32>` instead of dereferencing the inner type
20  --> $DIR/suspicious-double-ref-op.rs:37:63
21   |
22LL |     let non_deref_type_deref: &PlainType<u32> = non_deref_type.deref();
23   |                                                               ^^^^^^^^
24
25error: using `.clone()` on a double reference, which returns `&str` instead of cloning the inner type
26  --> $DIR/suspicious-double-ref-op.rs:41:44
27   |
28LL |     let _v: Vec<&str> = xs.iter().map(|x| x.clone()).collect(); // could use `*x` instead
29   |                                            ^^^^^^^^
30
31error: aborting due to 4 previous errors
32