-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
redundant_allocation Arc; But a function is too long
- Loading branch information
lyj
committed
Jun 2, 2021
1 parent
cf5f894
commit 0bacc4c
Showing
4 changed files
with
144 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,82 @@ | ||
error: usage of `Rc<&T>` | ||
--> $DIR/redundant_allocation.rs:22:22 | ||
--> $DIR/redundant_allocation.rs:23:22 | ||
| | ||
LL | pub fn test1<T>(foo: Rc<&T>) {} | ||
| ^^^^^^ help: try: `&T` | ||
| | ||
= note: `-D clippy::redundant-allocation` implied by `-D warnings` | ||
|
||
error: usage of `Rc<&T>` | ||
--> $DIR/redundant_allocation.rs:24:19 | ||
--> $DIR/redundant_allocation.rs:25:19 | ||
| | ||
LL | pub fn test2(foo: Rc<&MyStruct>) {} | ||
| ^^^^^^^^^^^^^ help: try: `&MyStruct` | ||
|
||
error: usage of `Rc<&T>` | ||
--> $DIR/redundant_allocation.rs:26:19 | ||
--> $DIR/redundant_allocation.rs:27:19 | ||
| | ||
LL | pub fn test3(foo: Rc<&MyEnum>) {} | ||
| ^^^^^^^^^^^ help: try: `&MyEnum` | ||
|
||
error: usage of `Rc<Rc<T>>` | ||
--> $DIR/redundant_allocation.rs:32:17 | ||
--> $DIR/redundant_allocation.rs:33:17 | ||
| | ||
LL | pub fn test5(a: Rc<Rc<bool>>) {} | ||
| ^^^^^^^^^^^^ help: try: `Rc<bool>` | ||
|
||
error: usage of `Rc<Box<T>>` | ||
--> $DIR/redundant_allocation.rs:36:17 | ||
--> $DIR/redundant_allocation.rs:37:17 | ||
| | ||
LL | pub fn test6(a: Rc<Box<bool>>) {} | ||
| ^^^^^^^^^^^^^ help: try: `Rc<bool>` | ||
|
||
error: usage of `Box<&T>` | ||
--> $DIR/redundant_allocation.rs:40:22 | ||
--> $DIR/redundant_allocation.rs:41:22 | ||
| | ||
LL | pub fn test7<T>(foo: Box<&T>) {} | ||
| ^^^^^^^ help: try: `&T` | ||
|
||
error: usage of `Box<&T>` | ||
--> $DIR/redundant_allocation.rs:42:19 | ||
--> $DIR/redundant_allocation.rs:43:19 | ||
| | ||
LL | pub fn test8(foo: Box<&MyStruct>) {} | ||
| ^^^^^^^^^^^^^^ help: try: `&MyStruct` | ||
|
||
error: usage of `Box<&T>` | ||
--> $DIR/redundant_allocation.rs:44:19 | ||
--> $DIR/redundant_allocation.rs:45:19 | ||
| | ||
LL | pub fn test9(foo: Box<&MyEnum>) {} | ||
| ^^^^^^^^^^^^ help: try: `&MyEnum` | ||
|
||
error: aborting due to 8 previous errors | ||
error: usage of `Arc<&T>` | ||
--> $DIR/redundant_allocation.rs:51:23 | ||
| | ||
LL | pub fn test11<T>(foo: Arc<&T>) {} | ||
| ^^^^^^^ help: try: `&T` | ||
|
||
error: usage of `Arc<&T>` | ||
--> $DIR/redundant_allocation.rs:53:20 | ||
| | ||
LL | pub fn test12(foo: Arc<&MyStruct>) {} | ||
| ^^^^^^^^^^^^^^ help: try: `&MyStruct` | ||
|
||
error: usage of `Arc<&T>` | ||
--> $DIR/redundant_allocation.rs:55:20 | ||
| | ||
LL | pub fn test13(foo: Arc<&MyEnum>) {} | ||
| ^^^^^^^^^^^^ help: try: `&MyEnum` | ||
|
||
error: usage of `Arc<Arc<T>>` | ||
--> $DIR/redundant_allocation.rs:61:18 | ||
| | ||
LL | pub fn test15(a: Arc<Arc<bool>>) {} | ||
| ^^^^^^^^^^^^^^ help: try: `Arc<bool>` | ||
|
||
error: usage of `Arc<Box<T>>` | ||
--> $DIR/redundant_allocation.rs:65:18 | ||
| | ||
LL | pub fn test16(a: Arc<Box<bool>>) {} | ||
| ^^^^^^^^^^^^^^ help: try: `Arc<bool>` | ||
|
||
error: aborting due to 13 previous errors | ||
|