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

convert: remove FromError, use From<E> instead #23879

Merged
merged 1 commit into from Apr 1, 2015

Conversation

Projects
None yet
4 participants
@seanmonstar
Copy link
Contributor

seanmonstar commented Mar 31, 2015

This removes the FromError trait, since it can now be expressed using
the new convert::Into trait. All implementations of FromError where
changed to From, and try! was changed to use From::from instead.

Because this removes FromError, it is a breaking change, but fixing it
simply requires changing the words FromError to From, and
from_error to from.

[breaking-change]

r? @alexcrichton or @aturon

convert: remove FromError, use From<E> instead
This removes the FromError trait, since it can now be expressed using
the new convert::Into trait. All implementations of FromError<E> where
changed to From<E>, and `try!` was changed to use From::from instead.

Because this removes FromError, it is a breaking change, but fixing it
simply requires changing the words `FromError` to `From`, and
`from_error` to `from`.

[breaking-change]
@seanmonstar

This comment has been minimized.

Copy link
Contributor Author

seanmonstar commented Mar 31, 2015

I'm still building the tests, but I fixed each instance that showed up with grep.

@seanmonstar

This comment has been minimized.

Copy link
Contributor Author

seanmonstar commented Mar 31, 2015

Erg, this is hitting coherence errors. I can't have From<T> for T...

@aturon

This comment has been minimized.

Copy link
Member

aturon commented Mar 31, 2015

I'm working on resolving that with #23875

I previously hadn't deprecated FromError partly for that reason, but I'm coming around to the idea of dropping it as you're doing here. Thoughts @alexcrichton?

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Mar 31, 2015

☔️ The latest upstream changes (presumably #23884) made this pull request unmergeable. Please resolve the merge conflicts.

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Mar 31, 2015

This sounds like a great idea to me! I'm all for it (although I'd land it either after or in tandem with #23875)

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Mar 31, 2015

@bors: r+ e17f4fc

(I'll rebase as part of a rollup)

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Mar 31, 2015

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Mar 31, 2015

@bors bors merged commit e17f4fc into rust-lang:master Apr 1, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

andersk added a commit to andersk/byteorder-rs that referenced this pull request Apr 2, 2015

Replace FromError with From
As per rust-lang/rust#23879.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>

andersk added a commit to andersk/rustc-serialize-rs that referenced this pull request Apr 2, 2015

Replace FromError with From
As per rust-lang/rust#23879.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>

andersk added a commit to andersk/num-rs that referenced this pull request Apr 2, 2015

Replace FromError with From
As per rust-lang/rust#23879.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>

@andersk andersk referenced this pull request Apr 2, 2015

Merged

Replace FromError with From #73

andersk added a commit to andersk/image-rs that referenced this pull request Apr 2, 2015

Replace FromError with From
As per rust-lang/rust#23879.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>

gbersac added a commit to gbersac/rustc-serialize that referenced this pull request May 8, 2015

Replace FromError with From
As per rust-lang/rust#23879.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>

gbersac added a commit to gbersac/rustc-serialize that referenced this pull request May 23, 2015

Replace FromError with From
As per rust-lang/rust#23879.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
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.