File tree Expand file tree Collapse file tree 2 files changed +37
-6
lines changed
branches/try2/src/libcore Expand file tree Collapse file tree 2 files changed +37
-6
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
5
5
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
- refs/heads/try2: b52a4b412e515620c2c3ccbe8b7f8c7e0300f6ff
8
+ refs/heads/try2: 38ba2c4941ede8d999a0208c50f1ad077ba259da
9
9
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
10
10
refs/heads/dist-snap: 22efa39382d41b084fde1719df7ae8ce5697d8c9
11
11
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
Original file line number Diff line number Diff line change 1
- //! The kind traits
1
+ /*!
2
+ The kind traits
2
3
3
- #[ lang="const" ]
4
- pub trait Const {
5
- // Empty.
6
- }
4
+ Rust types can be classified in vairous useful ways according to
5
+ intrinsic properties of the type. These classifications, often called
6
+ 'kinds', are represented as traits.
7
+
8
+ They cannot be implemented by user code, but are instead implemented
9
+ by the compiler automatically for the types to which they apply.
10
+
11
+ The 4 kinds are
12
+
13
+ * Copy - types that may be copied without allocation. This includes
14
+ scalar types and managed pointers, and exludes owned pointers. It
15
+ also excludes types that implement `Drop`.
16
+
17
+ * Send - owned types and types containing owned types. These types
18
+ may be transferred across task boundaries.
19
+
20
+ * Const - types that are deeply immutable. Const types are used for
21
+ freezable data structures.
22
+
23
+ * Owned - types that do not contain borrowed pointers. Note that this
24
+ meaning of 'owned' conflicts with 'owned pointers'. The two notions
25
+ of ownership are different.
26
+
27
+ `Copy` types include both implicitly copyable types that the compiler
28
+ will copy automatically and non-implicitly copyable types that require
29
+ the `copy` keyword to copy. Types that do not implement `Copy` may
30
+ instead implement `Clone`.
31
+
32
+ */
7
33
8
34
#[ lang="copy" ]
9
35
pub trait Copy {
@@ -15,6 +41,11 @@ pub trait Send {
15
41
// Empty.
16
42
}
17
43
44
+ #[ lang="const" ]
45
+ pub trait Const {
46
+ // Empty.
47
+ }
48
+
18
49
#[ lang="owned" ]
19
50
pub trait Owned {
20
51
// Empty.
You can’t perform that action at this time.
0 commit comments