File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 8
8
// option. This file may not be copied, modified, or distributed
9
9
// except according to those terms.
10
10
11
- //! Traits for dynamic typing of any type (through runtime reflection)
11
+ //! Traits for dynamic typing of any `'static` type (through runtime reflection)
12
12
//!
13
13
//! This module implements the `Any` trait, which enables dynamic typing
14
- //! of any type, through runtime reflection.
14
+ //! of any `'static` type through runtime reflection.
15
15
//!
16
16
//! `Any` itself can be used to get a `TypeId`, and has more features when used as a trait object.
17
17
//! 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 { }
32
32
// Any trait
33
33
///////////////////////////////////////////////////////////////////////////////
34
34
35
- /// The `Any` trait is implemented by all types, and can be used as a trait object
36
- /// for dynamic typing
35
+ /// The `Any` trait is implemented by all `'static` types, and can be used for dynamic typing
36
+ ///
37
+ /// Every type with no non-`'static` references implements `Any`, so `Any` can be used as a trait
38
+ /// object to emulate the effects dynamic typing.
37
39
pub trait Any {
38
40
/// Get the `TypeId` of `self`
39
41
fn get_type_id ( & self ) -> TypeId ;
You can’t perform that action at this time.
0 commit comments