about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAaron Turon <aturon@mozilla.com>2014-10-03 10:46:41 -0700
committerAaron Turon <aturon@mozilla.com>2014-10-06 16:32:30 -0700
commit07cfc252a1d34b25fcb6c84403071bd183794ae2 (patch)
tree0b557caad6b4ea6f63df9d0daaf8703c49f9a31a
parentb5ba2f5517b1f90d07969ca3facdf5132e42436c (diff)
downloadrust-07cfc252a1d34b25fcb6c84403071bd183794ae2.tar.gz
rust-07cfc252a1d34b25fcb6c84403071bd183794ae2.zip
Remove core::any::AnyPrivate
[Previously](https://github.com/rust-lang/rust/commit/e5da6a71a6a0b46dd3630fc8326e6d5906a1fde6),
the `Any` trait was split into a private portion and an (empty) public
portion, in order to hide the implementation strategy used for
downcasting. However, the [new
rules](https://github.com/rust-lang/rust/commit/e9ad12c0cae5c43ada6641c7dc840a0fbe5010a2)
for privacy forbid `AnyPrivate` from actually being private.

This patch thus reverts the introduction of `AnyPrivate`.

Although this is unlikely to break any real code, it removes a public
trait and is therefore a:

[breaking-change]
-rw-r--r--src/libcore/any.rs9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/libcore/any.rs b/src/libcore/any.rs
index fd5007ff415..c4b07d42e69 100644
--- a/src/libcore/any.rs
+++ b/src/libcore/any.rs
@@ -91,20 +91,15 @@ pub enum Void { }
 /// Every type with no non-`'static` references implements `Any`, so `Any` can
 /// be used as a trait object to emulate the effects dynamic typing.
 #[stable]
-pub trait Any: AnyPrivate + 'static {}
-
-/// An inner trait to ensure that only this module can call `get_type_id()`.
-pub trait AnyPrivate {
+pub trait Any: 'static {
     /// Get the `TypeId` of `self`
     fn get_type_id(&self) -> TypeId;
 }
 
-impl<T: 'static> AnyPrivate for T {
+impl<T: 'static> Any for T {
     fn get_type_id(&self) -> TypeId { TypeId::of::<T>() }
 }
 
-impl<T: 'static + AnyPrivate> Any for T {}
-
 ///////////////////////////////////////////////////////////////////////////////
 // Extension methods for Any trait objects.
 // Implemented as three extension traits so that the methods can be generic.