@@ -9,15 +9,28 @@ import util::ppaux::{ty_to_str, tys_to_str};
9
9
import syntax:: print:: pprust:: expr_to_str;
10
10
import freevars:: freevar_entry;
11
11
12
- // Kind analysis pass. There are three kinds:
12
+ // Kind analysis pass.
13
13
//
14
- // sendable: scalar types, and unique types containing only sendable types
15
- // copyable: boxes, closures, and uniques containing copyable types
16
- // noncopyable: resources, or unique types containing resources
14
+ // There are several kinds defined by various operations. The most restrictive
15
+ // kind is noncopyable. The noncopyable kind can be extended with any number
16
+ // of the following attributes.
17
+ //
18
+ // send: Things that can be sent on channels or included in spawned closures.
19
+ // copy: Things that can be copied.
20
+ // const: Things thare are deeply immutable. They are guaranteed never to
21
+ // change, and can be safely shared without copying between tasks.
22
+ //
23
+ // Send includes scalar types, resources and unique types containing only
24
+ // sendable types.
25
+ //
26
+ // Copy includes boxes, closure and unique types containing copyable types.
27
+ //
28
+ // Const include scalar types, things without non-const fields, and pointers
29
+ // to const things.
17
30
//
18
31
// This pass ensures that type parameters are only instantiated with types
19
32
// whose kinds are equal or less general than the way the type parameter was
20
- // annotated (with the `send` or `copy ` keyword).
33
+ // annotated (with the `send`, `copy` or `const ` keyword).
21
34
//
22
35
// It also verifies that noncopyable kinds are not copied. Sendability is not
23
36
// applied, since none of our language primitives send. Instead, the sending
0 commit comments