Skip to content

Commit aa1423b

Browse files
committed
---
yaml --- r: 36509 b: refs/heads/try2 c: 38ba2c4 h: refs/heads/master i: 36507: 380bfd1 v: v3
1 parent 8c92cb1 commit aa1423b

File tree

2 files changed

+37
-6
lines changed

2 files changed

+37
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: b52a4b412e515620c2c3ccbe8b7f8c7e0300f6ff
8+
refs/heads/try2: 38ba2c4941ede8d999a0208c50f1ad077ba259da
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
1010
refs/heads/dist-snap: 22efa39382d41b084fde1719df7ae8ce5697d8c9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try2/src/libcore/kinds.rs

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,35 @@
1-
//! The kind traits
1+
/*!
2+
The kind traits
23
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+
*/
733

834
#[lang="copy"]
935
pub trait Copy {
@@ -15,6 +41,11 @@ pub trait Send {
1541
// Empty.
1642
}
1743

44+
#[lang="const"]
45+
pub trait Const {
46+
// Empty.
47+
}
48+
1849
#[lang="owned"]
1950
pub trait Owned {
2051
// Empty.

0 commit comments

Comments
 (0)