From d1b2d29528b7794b41e66fc2136e395a02f8529b Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 30 May 2024 05:59:35 +0200 Subject: Merging upstream version 1.73.0+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/lint/suspicious-double-ref-op.stderr | 33 ++++++++++++--------------- 1 file changed, 15 insertions(+), 18 deletions(-) (limited to 'tests/ui/lint/suspicious-double-ref-op.stderr') diff --git a/tests/ui/lint/suspicious-double-ref-op.stderr b/tests/ui/lint/suspicious-double-ref-op.stderr index d15487ca2..f5a71d40f 100644 --- a/tests/ui/lint/suspicious-double-ref-op.stderr +++ b/tests/ui/lint/suspicious-double-ref-op.stderr @@ -1,5 +1,5 @@ error: using `.clone()` on a double reference, which returns `&Vec` instead of cloning the inner type - --> $DIR/suspicious-double-ref-op.rs:7:23 + --> $DIR/suspicious-double-ref-op.rs:15:23 | LL | let z: &Vec<_> = y.clone(); | ^^^^^^^^ @@ -10,26 +10,23 @@ note: the lint level is defined here LL | #![deny(suspicious_double_ref_op, noop_method_call)] | ^^^^^^^^^^^^^^^^^^^^^^^^ -error: call to `.clone()` on a reference in this situation does nothing - --> $DIR/suspicious-double-ref-op.rs:24:25 +error: using `.clone()` on a double reference, which returns `&CloneType` instead of cloning the inner type + --> $DIR/suspicious-double-ref-op.rs:33:63 | -LL | let _ = &mut encoded.clone(); - | ^^^^^^^^ unnecessary method call - | - = note: the type `&[u8]` which `clone` is being called on is the same as the type returned from `clone`, so the method call does not do anything and can be removed -note: the lint level is defined here - --> $DIR/suspicious-double-ref-op.rs:2:35 - | -LL | #![deny(suspicious_double_ref_op, noop_method_call)] - | ^^^^^^^^^^^^^^^^ +LL | let clone_type_ref_clone: &CloneType = clone_type_ref.clone(); + | ^^^^^^^^ -error: call to `.clone()` on a reference in this situation does nothing - --> $DIR/suspicious-double-ref-op.rs:26:21 +error: using `.deref()` on a double reference, which returns `&PlainType` instead of dereferencing the inner type + --> $DIR/suspicious-double-ref-op.rs:37:63 | -LL | let _ = &encoded.clone(); - | ^^^^^^^^ unnecessary method call +LL | let non_deref_type_deref: &PlainType = non_deref_type.deref(); + | ^^^^^^^^ + +error: using `.clone()` on a double reference, which returns `&str` instead of cloning the inner type + --> $DIR/suspicious-double-ref-op.rs:41:44 | - = note: the type `&[u8]` which `clone` is being called on is the same as the type returned from `clone`, so the method call does not do anything and can be removed +LL | let _v: Vec<&str> = xs.iter().map(|x| x.clone()).collect(); // could use `*x` instead + | ^^^^^^^^ -error: aborting due to 3 previous errors +error: aborting due to 4 previous errors -- cgit v1.2.3