-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
std: Remove ?Sized bounds from many I/O functions #23316
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r? @aturon (rust_highfive has picked a reviewer for you, use r? to override) |
☔ The latest upstream changes (presumably #23229) made this pull request unmergeable. Please resolve the merge conflicts. |
alexcrichton
force-pushed
the
less-question-sized
branch
from
March 13, 2015 03:57
22bc0de
to
9a6d653
Compare
Lovely! @bors: r+ 9a6d653 |
⌛ Testing commit 9a6d653 with merge f6c8476... |
💔 Test failed - auto-mac-64-opt |
|
It is a frequent pattern among I/O functions to take `P: AsPath + ?Sized` or `AsOsStr` instead of `AsPath`. Most of these functions do not need to take ownership of their argument, but for libraries in general it's much more ergonomic to not deal with `?Sized` at all and simply require an argument `P` instead of `&P`. This change is aimed at removing unsightly `?Sized` bounds while retaining the same level of usability as before. All affected functions now take ownership of their arguments instead of taking them by reference, but due to the forwarding implementations of `AsOsStr` and `AsPath` all code should continue to work as it did before. This is strictly speaking a breaking change due to the signatures of these functions changing, but normal idiomatic usage of these APIs should not break in practice. [breaking-change]
alexcrichton
force-pushed
the
less-question-sized
branch
from
March 15, 2015 06:24
9a6d653
to
60a4a2d
Compare
@bors: r=aturon |
bors
added a commit
that referenced
this pull request
Mar 15, 2015
It is a frequent pattern among I/O functions to take `P: AsPath + ?Sized` or `AsOsStr` instead of `AsPath`. Most of these functions do not need to take ownership of their argument, but for libraries in general it's much more ergonomic to not deal with `?Sized` at all and simply require an argument `P` instead of `&P`. This change is aimed at removing unsightly `?Sized` bounds while retaining the same level of usability as before. All affected functions now take ownership of their arguments instead of taking them by reference, but due to the forwarding implementations of `AsOsStr` and `AsPath` all code should continue to work as it did before. This is strictly speaking a breaking change due to the signatures of these functions changing, but normal idiomatic usage of these APIs should not break in practice. [breaking-change]
semarie
added a commit
to semarie/rust
that referenced
this pull request
Mar 15, 2015
SimonSapin
added a commit
to servo/rust-url
that referenced
this pull request
Mar 17, 2015
Ms2ger
added a commit
to servo/rust-png
that referenced
this pull request
Mar 21, 2015
Ms2ger
added a commit
to servo/rust-png
that referenced
this pull request
Mar 21, 2015
Ms2ger
added a commit
to servo/rust-png
that referenced
this pull request
Mar 21, 2015
Ms2ger
added a commit
to servo/rust-png
that referenced
this pull request
Mar 21, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It is a frequent pattern among I/O functions to take
P: AsPath + ?Sized
orAsOsStr
instead ofAsPath
. Most of these functions do not need to takeownership of their argument, but for libraries in general it's much more
ergonomic to not deal with
?Sized
at all and simply require an argumentP
instead of
&P
.This change is aimed at removing unsightly
?Sized
bounds while retaining thesame level of usability as before. All affected functions now take ownership of
their arguments instead of taking them by reference, but due to the forwarding
implementations of
AsOsStr
andAsPath
all code should continue to work as itdid before.
This is strictly speaking a breaking change due to the signatures of these
functions changing, but normal idiomatic usage of these APIs should not break in
practice.
[breaking-change]