提交 4ffe34ca 编写于 作者: E Eric Holk

Updating the comments in kind.rs to better reflect the current state of things.

上级 8b6bfc96
......@@ -9,15 +9,28 @@
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册