Skip to content

Commit 63c5d38

Browse files
committed
temp
1 parent 744b241 commit 63c5d38

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

tests/ui/lint/noop-method-call.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// check-pass
22

33
#![allow(unused)]
4-
#![warn(noop_method_call)]
4+
#![warn(noop_method_call, clone_double_ref)]
55

66
use std::borrow::Borrow;
77
use std::ops::Deref;
@@ -15,6 +15,7 @@ fn main() {
1515
let non_clone_type_ref = &PlainType(1u32);
1616
let non_clone_type_ref_clone: &PlainType<u32> = non_clone_type_ref.clone();
1717
//~^ WARNING call to `.clone()` on a reference in this situation does nothing
18+
//~| WARNING using `clone` on a double-reference, which copies the reference of type `PlainType<u32>`
1819

1920
let clone_type_ref = &CloneType(1u32);
2021
let clone_type_ref_clone: CloneType<u32> = clone_type_ref.clone();
@@ -23,6 +24,7 @@ fn main() {
2324
// peels the outer reference off
2425
let clone_type_ref = &&CloneType(1u32);
2526
let clone_type_ref_clone: &CloneType<u32> = clone_type_ref.clone();
27+
//~^ WARNING using `clone` on a double-reference, which copies the reference of type `CloneType<u32>`
2628

2729
let non_deref_type = &PlainType(1u32);
2830
let non_deref_type_deref: &PlainType<u32> = non_deref_type.deref();
@@ -42,6 +44,7 @@ fn main() {
4244

4345
let xs = ["a", "b", "c"];
4446
let _v: Vec<&str> = xs.iter().map(|x| x.clone()).collect(); // ok, but could use `*x` instead
47+
//~^ WARNING using `clone` on a double-reference, which copies the reference of type `str`
4548
}
4649

4750
fn generic<T>(non_clone_type: &PlainType<T>) {

tests/ui/trait-bounds/issue-94680.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// check-pass
22

3+
#![allow(clone_double_ref)]
4+
35
fn main() {
46
println!("{:?}", {
57
type T = ();

tests/ui/trivial-bounds/issue-73021-impossible-inline.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// revisions: no-opt inline
33
// [inline]compile-flags: -Zmir-opt-level=3 --emit=mir
44
#![feature(trivial_bounds)]
5-
#![allow(unused)]
5+
#![allow(unused, clone_double_ref)]
66

77
trait Foo {
88
fn test(&self);

0 commit comments

Comments
 (0)