diff options
| author | Flavio Percoco <flaper87@gmail.com> | 2014-03-22 14:42:32 +0100 |
|---|---|---|
| committer | Flavio Percoco <flaper87@gmail.com> | 2014-03-22 15:47:34 +0100 |
| commit | a1cb2f5d8c4ce807b27b09344b5ef7d9cd94c04d (patch) | |
| tree | d27e46c57903f919e2b60acc828a0ce031b8736b /src | |
| parent | 90e9d8ee6258079e25d49480fcafb41945aa6fbe (diff) | |
| download | rust-a1cb2f5d8c4ce807b27b09344b5ef7d9cd94c04d.tar.gz rust-a1cb2f5d8c4ce807b27b09344b5ef7d9cd94c04d.zip | |
doc: Remove Freeze / NoFreeze from docs
Diffstat (limited to 'src')
| -rw-r--r-- | src/doc/rust.md | 6 | ||||
| -rw-r--r-- | src/doc/tutorial.md | 14 | ||||
| -rw-r--r-- | src/librustc/middle/kind.rs | 14 | ||||
| -rw-r--r-- | src/librustc/middle/typeck/collect.rs | 3 | ||||
| -rw-r--r-- | src/librustdoc/html/render.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/ast.rs | 2 |
6 files changed, 14 insertions, 29 deletions
diff --git a/src/doc/rust.md b/src/doc/rust.md index deb26610ada..a61e8081848 100644 --- a/src/doc/rust.md +++ b/src/doc/rust.md @@ -1019,7 +1019,7 @@ never invoking this behaviour or exposing an API making it possible for it to oc * 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) @@ -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. 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 diff --git a/src/doc/tutorial.md b/src/doc/tutorial.md index 3c0439b7cd1..b854841487d 100644 --- a/src/doc/tutorial.md +++ b/src/doc/tutorial.md @@ -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 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 @@ -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 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 @@ -2444,15 +2440,15 @@ Consequently, the trait objects themselves automatically fulfill their 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 diff --git a/src/librustc/middle/kind.rs b/src/librustc/middle/kind.rs index 9d8f35eb980..ee5d896a1c0 100644 --- a/src/librustc/middle/kind.rs +++ b/src/librustc/middle/kind.rs @@ -30,20 +30,14 @@ use syntax::visit::Visitor; // 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 diff --git a/src/librustc/middle/typeck/collect.rs b/src/librustc/middle/typeck/collect.rs index 4eeae31d0a4..6c6d6a2867c 100644 --- a/src/librustc/middle/typeck/collect.rs +++ b/src/librustc/middle/typeck/collect.rs @@ -1027,8 +1027,7 @@ pub fn ty_generics(ccx: &CrateCtxt, * 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 { diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index 4079fafb368..0e9025303d0 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -116,8 +116,8 @@ pub enum Implementor { /// /// 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 diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 41038705d4d..f2a256165e2 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -169,7 +169,7 @@ pub static DUMMY_NODE_ID: NodeId = -1; // 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), |
