Skip to content

Conversation

@zachs18
Copy link
Contributor

@zachs18 zachs18 commented Nov 19, 2025

Tracking issue: #149075

Accepted ACP: rust-lang/libs-team#483

This PR implements clone_from_ref (and try_* and _*in variants), to get a Box<T>, Arc<T>, or Rc<T> by cloning from a &T where T: CloneToUninit.

The "Implement..." commits replace some ad-hoc conversions with clone_from_ref variants, which can be split out to a separate PR if desired.

This PR will conflict with #148769 due to usage of Layout::dangling (which that PR is renaming to dangling_ptr), so they should not be rolled up together, and the one which merges later will need to be amended.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Nov 19, 2025
@rustbot
Copy link
Collaborator

rustbot commented Nov 19, 2025

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
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

@rust-log-analyzer

This comment has been minimized.

@rustbot

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rustbot
Copy link
Collaborator

rustbot commented Nov 19, 2025

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@Mark-Simulacrum
Copy link
Member

@bors r+ rollup=iffy

@bors
Copy link
Collaborator

bors commented Nov 26, 2025

📌 Commit 2eac4db has been approved by Mark-Simulacrum

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 Nov 26, 2025
@bors
Copy link
Collaborator

bors commented Nov 26, 2025

⌛ Testing commit 2eac4db with merge 1be6b13...

@bors
Copy link
Collaborator

bors commented Nov 26, 2025

☀️ Test successful - checks-actions
Approved by: Mark-Simulacrum
Pushing 1be6b13 to main...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 26, 2025
@bors bors merged commit 1be6b13 into rust-lang:main Nov 26, 2025
12 checks passed
@rustbot rustbot added this to the 1.93.0 milestone Nov 26, 2025
@github-actions
Copy link
Contributor

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 99ca3fc (parent) -> 1be6b13 (this PR)

Test differences

Show 1264 test diffs

1264 doctest diffs were found. These are ignored, as they are noisy.

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 1be6b13be73dc12e98e51b403add4c41a0b77759 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. pr-check-1: 2058.4s -> 1641.8s (-20.2%)
  2. x86_64-rust-for-linux: 3066.3s -> 2461.1s (-19.7%)
  3. x86_64-gnu-tools: 3673.6s -> 3077.5s (-16.2%)
  4. dist-x86_64-apple: 7537.1s -> 8653.2s (+14.8%)
  5. aarch64-gnu-llvm-20-2: 2528.3s -> 2156.7s (-14.7%)
  6. x86_64-msvc-2: 6575.8s -> 7303.4s (+11.1%)
  7. dist-aarch64-llvm-mingw: 5344.3s -> 5933.8s (+11.0%)
  8. x86_64-gnu-stable: 7716.5s -> 6875.3s (-10.9%)
  9. aarch64-gnu-debug: 4289.0s -> 3827.1s (-10.8%)
  10. dist-arm-linux-gnueabi: 5298.6s -> 4729.2s (-10.7%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (1be6b13): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

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

Max RSS (memory usage)

Results (primary 1.1%, secondary 4.2%)

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

mean range count
Regressions ❌
(primary)
3.2% [3.2%, 3.2%] 1
Regressions ❌
(secondary)
4.2% [4.2%, 4.2%] 1
Improvements ✅
(primary)
-1.0% [-1.0%, -1.0%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.1% [-1.0%, 3.2%] 2

Cycles

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

Binary size

Results (primary -0.1%, secondary -0.1%)

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

mean range count
Regressions ❌
(primary)
0.0% [0.0%, 0.0%] 4
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.2% [-0.6%, -0.1%] 5
Improvements ✅
(secondary)
-0.1% [-0.1%, -0.1%] 38
All ❌✅ (primary) -0.1% [-0.6%, 0.0%] 9

Bootstrap: 475.097s -> 468.01s (-1.49%)
Artifact size: 386.96 MiB -> 386.86 MiB (-0.02%)

makai410 pushed a commit to makai410/rust that referenced this pull request Dec 10, 2025
…acrum

Add `Box::clone_from_ref` and similar under `feature(clone_from_ref)`

Tracking issue: rust-lang#149075

Accepted ACP: rust-lang/libs-team#483

This PR implements `clone_from_ref` (and `try_*` and `_*in` variants), to get a `Box<T>`, `Arc<T>`, or `Rc<T>` by cloning from a `&T` where `T: CloneToUninit`.

The "Implement..." commits replace some ad-hoc conversions with `clone_from_ref` variants, which can be split out to a separate PR if desired.

This PR will conflict with rust-lang#148769 due to usage of `Layout::dangling` (which that PR is renaming to `dangling_ptr`), so they should not be rolled up together, and the one which merges later will need to be amended.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants