Skip to content

Commit

Permalink
doc: Remove Freeze / NoFreeze from docs
Browse files Browse the repository at this point in the history
  • Loading branch information
flaper87 committed Mar 22, 2014
1 parent 90e9d8e commit a1cb2f5
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 29 deletions.
6 changes: 1 addition & 5 deletions src/doc/rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
14 changes: 5 additions & 9 deletions src/doc/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
14 changes: 4 additions & 10 deletions src/librustc/middle/kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/librustc/middle/typeck/collect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions src/librustdoc/html/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

5 comments on commit a1cb2f5

@bors
Copy link
Contributor

@bors bors commented on a1cb2f5 Mar 22, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from alexcrichton
at flaper87@a1cb2f5

@bors
Copy link
Contributor

@bors bors commented on a1cb2f5 Mar 22, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging FlaPer87/rust/remove-freeze = a1cb2f5 into auto

@bors
Copy link
Contributor

@bors bors commented on a1cb2f5 Mar 22, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FlaPer87/rust/remove-freeze = a1cb2f5 merged ok, testing candidate = 7e7a5e3

@bors
Copy link
Contributor

@bors bors commented on a1cb2f5 Mar 22, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on a1cb2f5 Mar 22, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 7e7a5e3

Please sign in to comment.