File tree Expand file tree Collapse file tree 4 files changed +18
-21
lines changed Expand file tree Collapse file tree 4 files changed +18
-21
lines changed Original file line number Diff line number Diff line change @@ -51,12 +51,3 @@ fn issue_1432() {
51
51
52
52
let _ = v. iter ( ) . filter ( |& a| a. is_empty ( ) ) ;
53
53
}
54
-
55
- #[ allow( dead_code) ]
56
- fn test_cow_with_ref ( c : & Cow < [ i32 ] > ) {
57
- }
58
-
59
- #[ allow( dead_code) ]
60
- fn test_cow ( c : Cow < [ i32 ] > ) {
61
- let _c = c;
62
- }
Original file line number Diff line number Diff line change @@ -38,13 +38,5 @@ error: this pattern creates a reference to a reference
38
38
50 | let _ = v.iter().filter(|&ref a| a.is_empty());
39
39
| ^^^^^ help: change this to: `a`
40
40
41
- error: using a reference to `Cow` is not recommended.
42
- --> $DIR/needless_borrow.rs:56:25
43
- |
44
- 56 | fn test_cow_with_ref(c: &Cow<[i32]>) {
45
- | ^^^^^^^^^^^ help: change this to: `&[i32]`
46
- |
47
- = note: `-D ptr-arg` implied by `-D warnings`
48
-
49
- error: aborting due to 7 previous errors
41
+ error: aborting due to 6 previous errors
50
42
Original file line number Diff line number Diff line change 1
-
2
-
3
1
#![ allow( unused, many_single_char_names) ]
4
2
#![ warn( ptr_arg) ]
5
3
4
+ use std:: borrow:: Cow ;
5
+
6
6
fn do_vec ( x : & Vec < i64 > ) {
7
7
//Nothing here
8
8
}
@@ -67,3 +67,11 @@ fn false_positive_capacity_too(x: &String) -> String {
67
67
x. clone ( )
68
68
}
69
69
70
+ #[ allow( dead_code) ]
71
+ fn test_cow_with_ref ( c : & Cow < [ i32 ] > ) {
72
+ }
73
+
74
+ #[ allow( dead_code) ]
75
+ fn test_cow ( c : Cow < [ i32 ] > ) {
76
+ let _c = c;
77
+ }
Original file line number Diff line number Diff line change @@ -76,5 +76,11 @@ help: change `y.as_str()` to
76
76
62 | let c = y;
77
77
| ^
78
78
79
- error: aborting due to 6 previous errors
79
+ error: using a reference to `Cow` is not recommended.
80
+ --> $DIR/ptr_arg.rs:71:25
81
+ |
82
+ 71 | fn test_cow_with_ref(c: &Cow<[i32]>) {
83
+ | ^^^^^^^^^^^ help: change this to: `&[i32]`
84
+
85
+ error: aborting due to 7 previous errors
80
86
You can’t perform that action at this time.
0 commit comments