Skip to content

Commit 9f3029a

Browse files
committed
---
yaml --- r: 16031 b: refs/heads/try c: 4ffe34c h: refs/heads/master i: 16029: ebb73a2 16027: 98477f7 16023: 0ed5c5c 16015: b4e18c3 15999: 5ba5733 v: v3
1 parent aaed88b commit 9f3029a

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: 8b6bfc96cba80dd59c244acbb27487e28ef8280f
5+
refs/heads/try: 4ffe34cacee85685652d3fcea7e3874b5e23ed73
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/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)