1
Fork 0

doc: Remove Freeze / NoFreeze from docs

This commit is contained in:
Flavio Percoco 2014-03-22 14:42:32 +01:00
parent 90e9d8ee62
commit a1cb2f5d8c
6 changed files with 14 additions and 29 deletions

View file

@ -1019,7 +1019,7 @@ never invoking this behaviour or exposing an API making it possible for it to oc
* Data races * Data races
* Dereferencing a null/dangling raw pointer * 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 * 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) * 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) with raw pointers (a subset of the rules used by C)
@ -3434,10 +3434,6 @@ call to the method `make_string`.
Types in Rust are categorized into kinds, based on various properties of the components of the type. Types in Rust are categorized into kinds, based on various properties of the components of the type.
The kinds are: The kinds are:
`Freeze`
: Types of this kind are deeply immutable;
they contain no mutable memory locations
directly or indirectly via pointers.
`Send` `Send`
: Types of this kind can be safely sent between tasks. : Types of this kind can be safely sent between tasks.
This kind includes scalars, owning pointers, owned closures, and This kind includes scalars, owning pointers, owned closures, and

View file

@ -2099,10 +2099,6 @@ unless they contain managed boxes, managed closures, or references.
These are types that are safe to be used across several threads with access to 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. 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. * `'static` - Non-borrowed types.
These are types that do not contain any data whose lifetime is bound to 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 a particular stack frame. These are types that do not contain any
@ -2152,7 +2148,7 @@ We say that the `Printable` trait _provides_ a `print` method with the
given signature. This means that we can call `print` on an argument given signature. This means that we can call `print` on an argument
of any type that implements the `Printable` trait. 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. don't provide any methods.
Traits may be implemented for specific types with [impls]. An impl for Traits may be implemented for specific types with [impls]. An impl for
@ -2444,15 +2440,15 @@ Consequently, the trait objects themselves automatically fulfill their
respective kind bounds. However, this default behavior can be overridden by 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:` 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 (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 bounds), or by writing `~Trait:Send+Share`, which indicates that in addition
to fulfilling `Send`, contents must also fulfill `Freeze`, and as a consequence, to fulfilling `Send`, contents must also fulfill `Share`, and as a consequence,
the trait itself fulfills `Freeze`. the trait itself fulfills `Share`.
* `~Trait:Send` is equivalent to `~Trait`. * `~Trait:Send` is equivalent to `~Trait`.
* `&Trait:` is equivalent to `&Trait`. * `&Trait:` is equivalent to `&Trait`.
Builtin kind bounds can also be specified on closure types in the same way (for 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. for traits of the same storage class.
## Trait inheritance ## Trait inheritance

View file

@ -30,20 +30,14 @@ use syntax::visit::Visitor;
// kind is noncopyable. The noncopyable kind can be extended with any number // kind is noncopyable. The noncopyable kind can be extended with any number
// of the following attributes. // of the following attributes.
// //
// send: Things that can be sent on channels or included in spawned closures. // Send: Things that can be sent on channels or included in spawned closures. It
// freeze: Things thare are deeply immutable. They are guaranteed never to // includes scalar types as well as classes and unique types containing only
// change, and can be safely shared without copying between tasks. // sendable types.
// 'static: Things that do not contain references. // '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 // 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 // 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 // It also verifies that noncopyable kinds are not copied. Sendability is not
// applied, since none of our language primitives send. Instead, the sending // applied, since none of our language primitives send. Instead, the sending

View file

@ -1027,8 +1027,7 @@ pub fn ty_generics(ccx: &CrateCtxt,
* Translate the AST's notion of ty param bounds (which are an * Translate the AST's notion of ty param bounds (which are an
* enum consisting of a newtyped Ty or a region) to ty's * enum consisting of a newtyped Ty or a region) to ty's
* notion of ty param bounds, which can either be user-defined * notion of ty param bounds, which can either be user-defined
* traits, or one of the two built-in traits (formerly known * traits, or the built-in trait (formerly known as kind): Send.
* as kinds): Freeze and Send.
*/ */
let mut param_bounds = ty::ParamBounds { let mut param_bounds = ty::ParamBounds {

View file

@ -116,8 +116,8 @@ pub enum Implementor {
/// ///
/// This structure purposefully does not implement `Clone` because it's intended /// 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 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 /// to `Send` so it may be stored in a `Arc` instance and shared among the various
/// shared among the various rendering tasks. /// rendering tasks.
pub struct Cache { pub struct Cache {
/// Mapping of typaram ids to the name of the type parameter. This is used /// 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 /// when pretty-printing a type (so pretty printing doesn't have to

View file

@ -169,7 +169,7 @@ pub static DUMMY_NODE_ID: NodeId = -1;
// The AST represents all type param bounds as types. // The AST represents all type param bounds as types.
// typeck::collect::compute_bounds matches these against // typeck::collect::compute_bounds matches these against
// the "special" built-in traits (see middle::lang_items) and // 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)] #[deriving(Clone, Eq, Encodable, Decodable, Hash)]
pub enum TyParamBound { pub enum TyParamBound {
TraitTyParamBound(TraitRef), TraitTyParamBound(TraitRef),