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

seanmonstar
Copy link
Contributor

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

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
Copy link
Contributor Author

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

@seanmonstar
Copy link
Contributor Author

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

@aturon
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
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
Copy link
Member

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
Copy link
Member

@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
@bors bors merged commit e17f4fc into rust-lang:master Apr 1, 2015
andersk added a commit to andersk/byteorder-rs that referenced this pull request Apr 2, 2015
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
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
As per rust-lang/rust#23879.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
andersk added a commit to andersk/image-rs that referenced this pull request Apr 2, 2015
As per rust-lang/rust#23879.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
gbersac pushed a commit to gbersac/rustc-serialize that referenced this pull request May 8, 2015
As per rust-lang/rust#23879.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
gbersac pushed a commit to gbersac/rustc-serialize that referenced this pull request May 23, 2015
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants