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

compiler/rustc_target/src/spec/base/apple/tests.rs: Avoid unnecessary large move #121539

Merged
merged 1 commit into from
Feb 24, 2024

Conversation

Enselic
Copy link
Member

@Enselic Enselic commented Feb 24, 2024

Fixes:

$ MAGIC_EXTRA_RUSTFLAGS=-Zmove-size-limit=4096 ./x test compiler/rustc_target
error: moving 6216 bytes
  --> compiler/rustc_target/src/spec/base/apple/tests.rs:17:19
   |
17 |     for target in all_sim_targets {
   |                   ^^^^^^^^^^^^^^^ value moved from here
   |
   = note: The current maximum size is 4096, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
   = note: `-D large-assignments` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(large_assignments)]`

Part of #83518

The goal is to enable the lint by default at one point. There are many cases where it needs to be allowed. But here we don't need to allow it. We can simply fix it.

I don't want to enable the lint in the file, because I don't want the "default size threshold for when a value is OK to move" to be duplicated in many places. We'll want the threshold in one central place once we enable it by default.

… large move

Fixes:

    $ MAGIC_EXTRA_RUSTFLAGS=-Zmove-size-limit=4096 ./x test compiler/rustc_target
    error: moving 6216 bytes
      --> compiler/rustc_target/src/spec/base/apple/tests.rs:17:19
       |
    17 |     for target in all_sim_targets {
       |                   ^^^^^^^^^^^^^^^ value moved from here
       |
       = note: The current maximum size is 4096, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
       = note: `-D large-assignments` implied by `-D warnings`
       = help: to override `-D warnings` add `#[allow(large_assignments)]`
@rustbot
Copy link
Collaborator

rustbot commented Feb 24, 2024

r? @TaKO8Ki

rustbot has assigned @TaKO8Ki.
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 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 Feb 24, 2024
@rustbot
Copy link
Collaborator

rustbot commented Feb 24, 2024

These commits modify compiler targets.
(See the Target Tier Policy.)

@Noratrieb
Copy link
Member

Would be nice if the compiler suggested borrowing
@bors r+ rollup

@bors
Copy link
Contributor

bors commented Feb 24, 2024

📌 Commit ff930d4 has been approved by Nilstrieb

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Feb 24, 2024

🌲 The tree is currently closed for pull requests below priority 50. This pull request will be tested once the tree is reopened.

@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 Feb 24, 2024
@Enselic
Copy link
Member Author

Enselic commented Feb 24, 2024

Would be nice if the compiler suggested borrowing

Good idea. I added it as a task to the tracking issue.

@compiler-errors compiler-errors assigned Noratrieb and unassigned TaKO8Ki Feb 24, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 24, 2024
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#121435 (Account for RPITIT in E0310 explicit lifetime constraint suggestion)
 - rust-lang#121490 (Rustdoc: include crate name in links for local primitives)
 - rust-lang#121520 (delay cloning of iterator items)
 - rust-lang#121522 (check that simd_insert/extract indices are in-bounds)
 - rust-lang#121531 (Ignore less tests in debug builds)
 - rust-lang#121539 (compiler/rustc_target/src/spec/base/apple/tests.rs: Avoid unnecessary large move)
 - rust-lang#121542 (update stdarch)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 7e8fa8f into rust-lang:master Feb 24, 2024
11 checks passed
@rustbot rustbot added this to the 1.78.0 milestone Feb 24, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Feb 24, 2024
Rollup merge of rust-lang#121539 - Enselic:fix-large-move, r=Nilstrieb

compiler/rustc_target/src/spec/base/apple/tests.rs: Avoid unnecessary large move

Fixes:

    $ MAGIC_EXTRA_RUSTFLAGS=-Zmove-size-limit=4096 ./x test compiler/rustc_target
    error: moving 6216 bytes
      --> compiler/rustc_target/src/spec/base/apple/tests.rs:17:19
       |
    17 |     for target in all_sim_targets {
       |                   ^^^^^^^^^^^^^^^ value moved from here
       |
       = note: The current maximum size is 4096, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
       = note: `-D large-assignments` implied by `-D warnings`
       = help: to override `-D warnings` add `#[allow(large_assignments)]`

Part of rust-lang#83518

The goal is to enable the lint by default at one point. There are many cases where it needs to be allowed. But here we don't need to allow it. We can simply fix it.

I don't want to enable the lint in the file, because I don't want the "default size threshold for when a value is OK to move" to be duplicated in many places. We'll want the threshold in one central place once we enable it by default.
@Enselic Enselic deleted the fix-large-move branch September 16, 2024 16:38
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