Skip to content

Remove unneeded drop_in_place calls #144883

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

scottmcm
Copy link
Member

@scottmcm scottmcm commented Aug 4, 2025

Might as well pull this out from #144561 because this is still used in things like Vec::truncate where it'd be nice to allow it be removed if inlined enough to see that the type is Copy.

So long as perf says it's ok, at least 🤞

@rustbot
Copy link
Collaborator

rustbot commented Aug 4, 2025

r? @nnethercote

rustbot has assigned @nnethercote.
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 Aug 4, 2025
@rustbot
Copy link
Collaborator

rustbot commented Aug 4, 2025

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@scottmcm
Copy link
Member Author

scottmcm commented Aug 4, 2025

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Aug 4, 2025
@rust-bors
Copy link

rust-bors bot commented Aug 4, 2025

⌛ Trying commit 952f142 with merge 641adcb

To cancel the try build, run the command @bors try cancel.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 4, 2025
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-miri failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
tests/fail/tree_borrows/reserved/cell-protected-write.rs ... ok
tests/fail/weak_memory/weak_uninit.rs ... ok

FAILED TEST: tests/fail/stacked_borrows/drop_in_place_retag.rs
command: MIRI_ENV_VAR_TEST="0" MIRI_TEMP="/tmp/miri-uitest-GUclM8" RUST_BACKTRACE="1" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/miri" "--error-format=json" "--sysroot=/checkout/obj/build/x86_64-unknown-linux-gnu/miri-sysroot" "-Dwarnings" "-Dunused" "-Ainternal_features" "-Zui-testing" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/x86_64-unknown-linux-gnu/tmp/miri_ui/0/tests/fail/stacked_borrows" "tests/fail/stacked_borrows/drop_in_place_retag.rs" "--edition" "2021"

error: test got exit status: 0, but expected 1
 = note: compilation succeeded, but was expected to fail

error: no output was emitted
Execute `./miri test --bless` to remove `tests/fail/stacked_borrows/drop_in_place_retag.stderr`

error: `/retag .* for Unique permission .* only grants SharedReadOnly permission/` does not match diagnostics outside the testfile
##[error] --> tests/fail/stacked_borrows/drop_in_place_retag.rs:4:26
  |
4 | //@error-in-other-file: /retag .* for Unique permission .* only grants SharedReadOnly permission/
  |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected because of this pattern
  |

full stderr:

---

Location:
   /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ui_test-0.30.2/src/lib.rs:365

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
error: test failed, to rerun pass `--test ui`

Caused by:
  process didn't exit successfully: `/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/x86_64-unknown-linux-gnu/release/deps/ui-48471e55e94b1667` (exit status: 1)
Command has failed. Rerun with -v to see more details.
Build completed unsuccessfully in 0:39:33
  local time: Mon Aug  4 06:27:11 UTC 2025
  network time: Mon, 04 Aug 2025 06:27:12 GMT
##[error]Process completed with exit code 1.
Post job cleanup.

@rust-bors
Copy link

rust-bors bot commented Aug 4, 2025

☀️ Try build successful (CI)
Build commit: 641adcb (641adcb8fe61a1a2f4cc317723476b9d171e2813, parent: 07b7dc90ee4df5815dbb91ef8e98cb93571230f5)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (641adcb): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (secondary -2.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.4% [-2.4%, -2.4%] 1
All ❌✅ (primary) - - 0

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 467.146s -> 468.977s (0.39%)
Artifact size: 377.00 MiB -> 377.01 MiB (0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants