Commit ac6353e
authored
Rollup merge of rust-lang#131777 - practicalrs:fix_trivially_copy_pass_by_ref, r=jieyouxu
Fix trivially_copy_pass_by_ref in stable_mir
Hi,
This PR fixes the following clippy warnings
```
warning: this argument (8 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
--> compiler/stable_mir/src/mir/body.rs:1042:34
|
1042 | fn subslice_ty(ty: Ty, from: &u64, to: &u64, from_end: &bool) -> Result<Ty, Error> {
| ^^^^ help: consider passing by value instead: `u64`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref
= note: requested on the command line with `-W clippy::trivially-copy-pass-by-ref`
warning: this argument (8 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
--> compiler/stable_mir/src/mir/body.rs:1042:44
|
1042 | fn subslice_ty(ty: Ty, from: &u64, to: &u64, from_end: &bool) -> Result<Ty, Error> {
| ^^^^ help: consider passing by value instead: `u64`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref
warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
--> compiler/stable_mir/src/mir/body.rs:1042:60
|
1042 | fn subslice_ty(ty: Ty, from: &u64, to: &u64, from_end: &bool) -> Result<Ty, Error> {
| ^^^^^ help: consider passing by value instead: `bool`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref
```
Best regards,
Michal1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1028 | 1028 | | |
1029 | 1029 | | |
1030 | 1030 | | |
1031 | | - | |
| 1031 | + | |
1032 | 1032 | | |
1033 | 1033 | | |
1034 | 1034 | | |
| |||
1039 | 1039 | | |
1040 | 1040 | | |
1041 | 1041 | | |
1042 | | - | |
| 1042 | + | |
1043 | 1043 | | |
1044 | 1044 | | |
1045 | 1045 | | |
1046 | 1046 | | |
1047 | 1047 | | |
1048 | | - | |
| 1048 | + | |
1049 | 1049 | | |
1050 | 1050 | | |
1051 | 1051 | | |
| |||
0 commit comments