* Data races
* Dereferencing a null/dangling raw pointer
-* Mutating an immutable value/reference, if it is not marked as non-`Freeze`
+* Mutating an immutable value/reference
* Reads of [undef](http://llvm.org/docs/LangRef.html#undefined-values) (uninitialized) memory
* Breaking the [pointer aliasing rules](http://llvm.org/docs/LangRef.html#pointer-aliasing-rules)
with raw pointers (a subset of the rules used by C)
Types in Rust are categorized into kinds, based on various properties of the components of the type.
The kinds are:
-`Freeze`
- : Types of this kind are deeply immutable;
- they contain no mutable memory locations
- directly or indirectly via pointers.
`Send`
: Types of this kind can be safely sent between tasks.
This kind includes scalars, owning pointers, owned closures, and
These are types that are safe to be used across several threads with access to
a `&T` pointer. `MutexArc` is an example of a *sharable* type with internal mutable data.
-* `Freeze` - Constant (immutable) types.
-These are types that do not contain anything intrinsically mutable.
-Intrinsically mutable values include `Cell` in the standard library.
-
* `'static` - Non-borrowed types.
These are types that do not contain any data whose lifetime is bound to
a particular stack frame. These are types that do not contain any
given signature. This means that we can call `print` on an argument
of any type that implements the `Printable` trait.
-Rust's built-in `Send` and `Freeze` types are examples of traits that
+Rust's built-in `Send` and `Share` types are examples of traits that
don't provide any methods.
Traits may be implemented for specific types with [impls]. An impl for
respective kind bounds. However, this default behavior can be overridden by
specifying a list of bounds on the trait type, for example, by writing `~Trait:`
(which indicates that the contents of the owned trait need not fulfill any
-bounds), or by writing `~Trait:Send+Freeze`, which indicates that in addition
-to fulfilling `Send`, contents must also fulfill `Freeze`, and as a consequence,
-the trait itself fulfills `Freeze`.
+bounds), or by writing `~Trait:Send+Share`, which indicates that in addition
+to fulfilling `Send`, contents must also fulfill `Share`, and as a consequence,
+the trait itself fulfills `Share`.
* `~Trait:Send` is equivalent to `~Trait`.
* `&Trait:` is equivalent to `&Trait`.
Builtin kind bounds can also be specified on closure types in the same way (for
-example, by writing `fn:Freeze()`), and the default behaviours are the same as
+example, by writing `fn:Send()`), and the default behaviours are the same as
for traits of the same storage class.
## Trait inheritance
// 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.
-// freeze: Things thare are deeply immutable. They are guaranteed never to
-// change, and can be safely shared without copying between tasks.
+// Send: Things that can be sent on channels or included in spawned closures. It
+// includes scalar types as well as classes and unique types containing only
+// sendable types.
// 'static: Things that do not contain references.
//
-// Send includes scalar types as well as classes and unique types containing
-// only sendable types.
-//
-// Freeze include scalar types, things without non-const fields, and pointers
-// to freezable 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 `Freeze` bound).
+// annotated (with the `Send` bound).
//
// It also verifies that noncopyable kinds are not copied. Sendability is not
// applied, since none of our language primitives send. Instead, the sending
* Translate the AST's notion of ty param bounds (which are an
* enum consisting of a newtyped Ty or a region) to ty's
* notion of ty param bounds, which can either be user-defined
- * traits, or one of the two built-in traits (formerly known
- * as kinds): Freeze and Send.
+ * traits, or the built-in trait (formerly known as kind): Send.
*/
let mut param_bounds = ty::ParamBounds {
///
/// This structure purposefully does not implement `Clone` because it's intended
/// to be a fairly large and expensive structure to clone. Instead this adheres
-/// to both `Send` and `Freeze` so it may be stored in a `Arc` instance and
-/// shared among the various rendering tasks.
+/// to `Send` so it may be stored in a `Arc` instance and shared among the various
+/// rendering tasks.
pub struct Cache {
/// Mapping of typaram ids to the name of the type parameter. This is used
/// when pretty-printing a type (so pretty printing doesn't have to
// The AST represents all type param bounds as types.
// typeck::collect::compute_bounds matches these against
// the "special" built-in traits (see middle::lang_items) and
-// detects Copy, Send, Send, and Freeze.
+// detects Copy, Send and Share.
#[deriving(Clone, Eq, Encodable, Decodable, Hash)]
pub enum TyParamBound {
TraitTyParamBound(TraitRef),