Skip to content

Commit 4ffe34c

Browse files
committed
Updating the comments in kind.rs to better reflect the current state of things.
1 parent 8b6bfc9 commit 4ffe34c

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

src/rustc/middle/kind.rs

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,28 @@ import util::ppaux::{ty_to_str, tys_to_str};
99
import syntax::print::pprust::expr_to_str;
1010
import freevars::freevar_entry;
1111

12-
// Kind analysis pass. There are three kinds:
12+
// Kind analysis pass.
1313
//
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.
1730
//
1831
// This pass ensures that type parameters are only instantiated with types
1932
// 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).
2134
//
2235
// It also verifies that noncopyable kinds are not copied. Sendability is not
2336
// applied, since none of our language primitives send. Instead, the sending

0 commit comments

Comments
 (0)