diff options
| author | P1start <rewi-github@whanau.org> | 2014-06-12 19:54:03 +1200 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-06-13 13:53:34 -0700 |
| commit | 00e1a6923773500f0d5b9bad64d05eb5d4a24c53 (patch) | |
| tree | ffc8791eeafcc28db227ab6f3be9b7470fdaa8ba | |
| parent | 42d538e6157cc4f923b4c2b8a3382d6465c90447 (diff) | |
| download | rust-00e1a6923773500f0d5b9bad64d05eb5d4a24c53.tar.gz rust-00e1a6923773500f0d5b9bad64d05eb5d4a24c53.zip | |
Clarify `Any` docs
The `Any` docs previously did not state that only `'static` types implement it.
| -rw-r--r-- | src/libcore/any.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libcore/any.rs b/src/libcore/any.rs index 2a03eacf13c..ed743f40a4b 100644 --- a/src/libcore/any.rs +++ b/src/libcore/any.rs @@ -8,10 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -//! Traits for dynamic typing of any type (through runtime reflection) +//! Traits for dynamic typing of any `'static` type (through runtime reflection) //! //! This module implements the `Any` trait, which enables dynamic typing -//! of any type, through runtime reflection. +//! of any `'static` type through runtime reflection. //! //! `Any` itself can be used to get a `TypeId`, and has more features when used as a trait object. //! As `&Any` (a borrowed trait object), it has the `is` and `as_ref` methods, to test if the @@ -32,8 +32,10 @@ pub enum Void { } // Any trait /////////////////////////////////////////////////////////////////////////////// -/// The `Any` trait is implemented by all types, and can be used as a trait object -/// for dynamic typing +/// The `Any` trait is implemented by all `'static` types, and can be used for dynamic typing +/// +/// Every type with no non-`'static` references implements `Any`, so `Any` can be used as a trait +/// object to emulate the effects dynamic typing. pub trait Any { /// Get the `TypeId` of `self` fn get_type_id(&self) -> TypeId; |
