Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix trivially_copy_pass_by_ref in stable_mir #131777

Merged
merged 1 commit into from
Oct 16, 2024

Conversation

practicalrs
Copy link
Contributor

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,
Michal

@rustbot
Copy link
Collaborator

rustbot commented Oct 16, 2024

r? @celinval

rustbot has assigned @celinval.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot
Copy link
Collaborator

rustbot commented Oct 16, 2024

This PR changes Stable MIR

cc @oli-obk, @celinval, @ouz-a

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 16, 2024
Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@jieyouxu
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Oct 16, 2024

📌 Commit 89ea9e4 has been approved by jieyouxu

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 16, 2024
Urgau added a commit to Urgau/rust that referenced this pull request Oct 16, 2024
…s_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,
Michal
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 16, 2024
Rollup of 10 pull requests

Successful merges:

 - rust-lang#129181 (Pass end position of span through inline ASM cookie)
 - rust-lang#130989 (Don't check unsize goal in MIR validation when opaques remain)
 - rust-lang#131657 (Rustfmt `for<'a> async` correctly)
 - rust-lang#131691 (Delay ambiguous intra-doc link resolution after `Cache` has been populated)
 - rust-lang#131730 (Refactor some `core::fmt` macros)
 - rust-lang#131751 (Rename `can_coerce` to `may_coerce`, and then structurally resolve correctly in the probe)
 - rust-lang#131753 (Unify `secondary_span` and `swap_secondary_and_primary` args in `note_type_err`)
 - rust-lang#131776 (Emscripten: Xfail backtrace ui tests)
 - rust-lang#131777 (Fix trivially_copy_pass_by_ref in stable_mir)
 - rust-lang#131778 (Fix needless_lifetimes in stable_mir)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 16, 2024
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#130989 (Don't check unsize goal in MIR validation when opaques remain)
 - rust-lang#131657 (Rustfmt `for<'a> async` correctly)
 - rust-lang#131691 (Delay ambiguous intra-doc link resolution after `Cache` has been populated)
 - rust-lang#131730 (Refactor some `core::fmt` macros)
 - rust-lang#131751 (Rename `can_coerce` to `may_coerce`, and then structurally resolve correctly in the probe)
 - rust-lang#131753 (Unify `secondary_span` and `swap_secondary_and_primary` args in `note_type_err`)
 - rust-lang#131776 (Emscripten: Xfail backtrace ui tests)
 - rust-lang#131777 (Fix trivially_copy_pass_by_ref in stable_mir)
 - rust-lang#131778 (Fix needless_lifetimes in stable_mir)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit ac6353e into rust-lang:master Oct 16, 2024
6 checks passed
@rustbot rustbot added this to the 1.84.0 milestone Oct 16, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Oct 16, 2024
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,
Michal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants