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

Clarify effect of orphan rule changes on From/Into #73421

Merged
merged 1 commit into from
Jul 16, 2020
Merged

Clarify effect of orphan rule changes on From/Into #73421

merged 1 commit into from
Jul 16, 2020

Conversation

janikrabe
Copy link
Contributor

Updated documentation for std::convert and std::convert::From to reflect changes to orphan rule in Rust 1.41. It should no longer be necessary to implement Into directly, unless targeting an older version.

r? @steveklabnik

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @steveklabnik (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 16, 2020
@Elinvynia Elinvynia added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 2, 2020
@Dylan-DPC-zz
Copy link

r? @Mark-Simulacrum

@Mark-Simulacrum
Copy link
Member

I'm going to tentatively r? @joshtriplett here who may have a better handle on the exact orphan rule changes we made / their effects.

@joshtriplett
Copy link
Member

The release notes mention:

You can now pass type parameters to foreign items when implementing traits. E.g. You can now write impl From for Vec {}.

The reference updates for the new orphan rules are at
https://github.com/rust-lang/reference/pull/703/files

I think this PR is accurate.

@joshtriplett
Copy link
Member

joshtriplett commented Jul 15, 2020

As a nit, could you please reverse the two conditions (with the note about only when targeting older versions coming first), so that it's more immediately obvious most people should not do this?

Updated documentation for `std::convert` and `std::convert::From` to
reflect changes to orphan rule in Rust 1.41. It should no longer be
necessary to implement Into directly, unless targeting an older version.
@janikrabe
Copy link
Contributor Author

@joshtriplett thanks, good point! I've done that; please let me know if you'd like me to change anything else.

@joshtriplett
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jul 15, 2020

📌 Commit d2fe7a7 has been approved by joshtriplett

@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 Jul 15, 2020
Manishearth added a commit to Manishearth/rust that referenced this pull request Jul 16, 2020
Clarify effect of orphan rule changes on From/Into

Updated documentation for `std::convert` and `std::convert::From` to reflect changes to orphan rule in Rust 1.41. It should no longer be necessary to implement `Into` directly, unless targeting an older version.

r? @steveklabnik
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 16, 2020
…arth

Rollup of 7 pull requests

Successful merges:

 - rust-lang#73421 (Clarify effect of orphan rule changes on From/Into)
 - rust-lang#74037 (Update reference to CONTRIBUTING.md)
 - rust-lang#74203 (Enforce the static symbol order.)
 - rust-lang#74295 (Add and fix BTreeMap comments)
 - rust-lang#74352 (Use local links in the alloc docs.)
 - rust-lang#74377 (Move libstd's default feature to libtest)
 - rust-lang#74381 (Update docs for str::as_bytes_mut.)

Failed merges:

r? @ghost
@bors bors merged commit 31121cb into rust-lang:master Jul 16, 2020
@cuviper cuviper added this to the 1.47.0 milestone May 2, 2024
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants