Skip to content

Commit

Permalink
Rollup merge of rust-lang#121539 - Enselic:fix-large-move, r=Nilstrieb
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
matthiaskrgr authored Feb 24, 2024
2 parents d978a1c + ff930d4 commit 7e8fa8f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/rustc_target/src/spec/base/apple/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fn simulator_targets_set_abi() {
aarch64_apple_watchos_sim::target(),
];

for target in all_sim_targets {
for target in &all_sim_targets {
assert_eq!(target.abi, "sim")
}
}
Expand Down

0 comments on commit 7e8fa8f

Please sign in to comment.