Skip to content

serialize: Use assoc types + less old_orphan_check #20514

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

Merged
merged 1 commit into from
Jan 5, 2015

Conversation

alexcrichton
Copy link
Member

This commit moves the libserialize crate (and will force the hand of the
rustc-serialize crate) to not require the old_orphan_check feature gate as
well as using associated types wherever possible. Concretely, the following
changes were made:

  • The error type of Encoder and Decoder is now an associated type, meaning
    that these traits have no type parameters.
  • The Encoder and Decoder type parameters on the Encodable and Decodable
    traits have moved to the corresponding method of the trait. This movement
    alleviates the dependency on old_orphan_check but implies that
    implementations can no longer be specialized for the type of encoder/decoder
    being implemented.

Due to the trait definitions changing, this is a:

[breaking-change]

@rust-highfive
Copy link
Contributor

r? @nikomatsakis

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

@alexcrichton
Copy link
Member Author

r? @aturon

@rust-highfive rust-highfive assigned aturon and unassigned nikomatsakis Jan 4, 2015
@aturon
Copy link
Member

aturon commented Jan 4, 2015

r=me after the tidy failure is fixed

This commit moves the libserialize crate (and will force the hand of the
rustc-serialize crate) to not require the `old_orphan_check` feature gate as
well as using associated types wherever possible. Concretely, the following
changes were made:

* The error type of `Encoder` and `Decoder` is now an associated type, meaning
  that these traits have no type parameters.

* The `Encoder` and `Decoder` type parameters on the `Encodable` and `Decodable`
  traits have moved to the corresponding method of the trait. This movement
  alleviates the dependency on `old_orphan_check` but implies that
  implementations can no longer be specialized for the type of encoder/decoder
  being implemented.

Due to the trait definitions changing, this is a:

[breaking-change]
@alexcrichton alexcrichton force-pushed the serialize-associated-type branch from d9ed606 to 0cb7a40 Compare January 5, 2015 07:00
alexcrichton added a commit to alexcrichton/rust that referenced this pull request Jan 5, 2015
This commit moves the libserialize crate (and will force the hand of the
rustc-serialize crate) to not require the `old_orphan_check` feature gate as
well as using associated types wherever possible. Concretely, the following
changes were made:

* The error type of `Encoder` and `Decoder` is now an associated type, meaning
  that these traits have no type parameters.

* The `Encoder` and `Decoder` type parameters on the `Encodable` and `Decodable`
  traits have moved to the corresponding method of the trait. This movement
  alleviates the dependency on `old_orphan_check` but implies that
  implementations can no longer be specialized for the type of encoder/decoder
  being implemented.

Due to the trait definitions changing, this is a:

[breaking-change]
bors added a commit that referenced this pull request Jan 5, 2015
…=aturon

This commit moves the libserialize crate (and will force the hand of the
rustc-serialize crate) to not require the `old_orphan_check` feature gate as
well as using associated types wherever possible. Concretely, the following
changes were made:

* The error type of `Encoder` and `Decoder` is now an associated type, meaning
  that these traits have no type parameters.

* The `Encoder` and `Decoder` type parameters on the `Encodable` and `Decodable`
  traits have moved to the corresponding method of the trait. This movement
  alleviates the dependency on `old_orphan_check` but implies that
  implementations can no longer be specialized for the type of encoder/decoder
  being implemented.

Due to the trait definitions changing, this is a:

[breaking-change]
@bors bors merged commit 0cb7a40 into rust-lang:master Jan 5, 2015
tetsuharuohzeki added a commit to tetsuharuohzeki/rustc-serialize that referenced this pull request Jan 6, 2015
@alexcrichton alexcrichton deleted the serialize-associated-type branch January 7, 2015 05:15
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.

5 participants