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

Implement Clone::clone_from for Option and Result #61348

Merged
merged 2 commits into from Jun 12, 2019

Conversation

Projects
None yet
7 participants
@m-ou-se
Copy link
Contributor

commented May 30, 2019

See #28481

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

commented May 30, 2019

r? @KodrAus

(rust_highfive has picked a reviewer for you, use r? to override)

Show resolved Hide resolved src/libcore/option.rs Outdated
@scottmcm

This comment has been minimized.

Copy link
Member

commented Jun 1, 2019

These are still fully-structural impls, right? Could the #[derive] just be made to emit these?

@m-ou-se

This comment has been minimized.

Copy link
Contributor Author

commented Jun 1, 2019

These are still fully-structural impls, right? Could the #[derive] just be made to emit these?

There's been a few discussions on this. #27939 was closed because it would affect the compile times too much.

Also, I think it might go wrong when there are multiple fields: If some fields are succesfully clone_from'd, but another panics, the object might be left in an invalid state. But it should be possible if there's only one field.

@m-ou-se m-ou-se force-pushed the fusion-engineering-forks:clone-from branch from dcdfd5a to 67fd995 Jun 1, 2019

@Centril

This comment has been minimized.

Copy link
Member

commented Jun 10, 2019

@bors try

@bors

This comment has been minimized.

Copy link
Contributor

commented Jun 10, 2019

⌛️ Trying commit 67fd995 with merge 1406f73...

bors added a commit that referenced this pull request Jun 10, 2019

Auto merge of #61348 - dronesforwork-forks:clone-from, r=<try>
Implement Clone::clone_from for Option and Result

See #28481

Done

@bors

This comment has been minimized.

Copy link
Contributor

commented Jun 10, 2019

☀️ Try build successful - checks-travis
Build commit: 1406f73

@Centril

This comment has been minimized.

Copy link
Member

commented Jun 10, 2019

@rust-timer

This comment has been minimized.

Copy link

commented Jun 10, 2019

Success: Queued 1406f73 with parent 400b409, comparison URL.

@rust-timer

This comment has been minimized.

Copy link

commented Jun 10, 2019

Finished benchmarking try commit 1406f73, comparison URL.

@Centril

This comment has been minimized.

Copy link
Member

commented Jun 10, 2019

Looks like noise.

@KodrAus

This comment has been minimized.

Copy link
Contributor

commented Jun 11, 2019

Based on the discussion in #28481 this looks good to me.

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

commented Jun 11, 2019

📌 Commit 67fd995 has been approved by KodrAus

Centril added a commit to Centril/rust that referenced this pull request Jun 12, 2019

Rollup merge of rust-lang#61348 - dronesforwork-forks:clone-from, r=K…
…odrAus

Implement Clone::clone_from for Option and Result

See rust-lang#28481

bors added a commit that referenced this pull request Jun 12, 2019

Auto merge of #61758 - Centril:rollup-ew2uxng, r=Centril
Rollup of 9 pull requests

Successful merges:

 - #60187 (Generator optimization: Overlap locals that never have storage live at the same time)
 - #61348 (Implement Clone::clone_from for Option and Result)
 - #61568 (Use Symbol, Span in libfmt_macros)
 - #61632 (ci: Collect CPU usage statistics on Azure)
 - #61654 (use pattern matching for slices destructuring)
 - #61671 (implement nth_back for Range(Inclusive))
 - #61688 (is_fp and is_floating_point do the same thing, remove the former)
 - #61705 (Pass cflags rather than cxxflags to LLVM as CMAKE_C_FLAGS)
 - #61734 (Migrate rust-by-example to MdBook2)

Failed merges:

r? @ghost

@bors bors merged commit 67fd995 into rust-lang:master Jun 12, 2019

2 checks passed

Travis CI - Pull Request Build Passed
Details
homu Test successful
Details

@m-ou-se m-ou-se deleted the fusion-engineering-forks:clone-from branch Jun 12, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.