diff options
| author | bors <bors@rust-lang.org> | 2014-10-01 05:32:16 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-10-01 05:32:16 +0000 |
| commit | fe93a549a49983837747986797a40d85ba047cad (patch) | |
| tree | 0645a0f8ea66b6656013ededda9c4a5107f4435b /src/libcore | |
| parent | 2f15dcd4d3865f9cc466637027eb02d5607b2bb7 (diff) | |
| parent | 0cf60b6bb8fed2cad4407fdf86a49a7eebbd62e6 (diff) | |
auto merge of #17132 : reem/rust/any-static-bound, r=alexcrichton
This bound is already implicit through the AnyPrivate trait, but since it is not explicit, you still have to write Box<Any + 'static>, even though Any can only be 'static. Introducing the 'static bound here makes this bound explicit, making Box<Any> legal.
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/any.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libcore/any.rs b/src/libcore/any.rs index fb70cb5b752..fd5007ff415 100644 --- a/src/libcore/any.rs +++ b/src/libcore/any.rs @@ -91,7 +91,7 @@ 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 {} +pub trait Any: AnyPrivate + 'static {} /// An inner trait to ensure that only this module can call `get_type_id()`. pub trait AnyPrivate { @@ -132,7 +132,7 @@ pub trait AnyRefExt<'a> { } #[stable] -impl<'a> AnyRefExt<'a> for &'a Any+'a { +impl<'a> AnyRefExt<'a> for &'a Any { #[inline] #[stable] fn is<T: 'static>(self) -> bool { @@ -181,7 +181,7 @@ pub trait AnyMutRefExt<'a> { } #[stable] -impl<'a> AnyMutRefExt<'a> for &'a mut Any+'a { +impl<'a> AnyMutRefExt<'a> for &'a mut Any { #[inline] #[unstable = "naming conventions around acquiring references may change"] fn downcast_mut<T: 'static>(self) -> Option<&'a mut T> { |
