about summary refs log tree commit diff
path: root/src/rustc
diff options
context:
space:
mode:
authorEric Holk <eric.holk@gmail.com>2012-05-24 14:33:21 -0700
committerEric Holk <eric.holk@gmail.com>2012-05-24 15:06:56 -0700
commit4ffe34cacee85685652d3fcea7e3874b5e23ed73 (patch)
treedbfbf1210bfd080398a73c7a47171273863a70cc /src/rustc
parent8b6bfc96cba80dd59c244acbb27487e28ef8280f (diff)
downloadrust-4ffe34cacee85685652d3fcea7e3874b5e23ed73.tar.gz
rust-4ffe34cacee85685652d3fcea7e3874b5e23ed73.zip
Updating the comments in kind.rs to better reflect the current state of things.
Diffstat (limited to 'src/rustc')
-rw-r--r--src/rustc/middle/kind.rs23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/rustc/middle/kind.rs b/src/rustc/middle/kind.rs
index e6facc2f7fd..0b2df1f94c3 100644
--- a/src/rustc/middle/kind.rs
+++ b/src/rustc/middle/kind.rs
@@ -9,15 +9,28 @@ import util::ppaux::{ty_to_str, tys_to_str};
 import syntax::print::pprust::expr_to_str;
 import freevars::freevar_entry;
 
-// Kind analysis pass. There are three kinds:
+// Kind analysis pass.
 //
-//  sendable: scalar types, and unique types containing only sendable types
-//  copyable: boxes, closures, and uniques containing copyable types
-//  noncopyable: resources, or unique types containing resources
+// There are several kinds defined by various operations. The most restrictive
+// kind is noncopyable. The noncopyable kind can be extended with any number
+// of the following attributes.
+//
+//  send: Things that can be sent on channels or included in spawned closures.
+//  copy: Things that can be copied.
+//  const: Things thare are deeply immutable. They are guaranteed never to
+//    change, and can be safely shared without copying between tasks.
+//
+// Send includes scalar types, resources and unique types containing only
+// sendable types.
+//
+// Copy includes boxes, closure and unique types containing copyable types.
+//
+// Const include scalar types, things without non-const fields, and pointers
+// to const things.
 //
 // This pass ensures that type parameters are only instantiated with types
 // whose kinds are equal or less general than the way the type parameter was
-// annotated (with the `send` or `copy` keyword).
+// annotated (with the `send`, `copy` or `const` keyword).
 //
 // It also verifies that noncopyable kinds are not copied. Sendability is not
 // applied, since none of our language primitives send. Instead, the sending