From 3e265e784225a6f74c21dd3cc8cc0a28947dddba Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Mon, 1 Jul 2013 23:37:11 -0700 Subject: [PATCH 1/3] Small documentation changes I'm leaving the Sized kind undocumented since it isn't fully implemented yet. --- doc/rust.md | 3 --- src/libstd/bool.rs | 1 + src/libstd/kinds.rs | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/doc/rust.md b/doc/rust.md index cc53d7d17a25a..c61cbe6476ce8 100644 --- a/doc/rust.md +++ b/doc/rust.md @@ -2869,9 +2869,6 @@ The kinds are: : Types of this kind can be safely sent between tasks. This kind includes scalars, owning pointers, owned closures, and structural types containing only other owned types. All `Send` types are `Static`. -`Static` - : Types of this kind do not contain any borrowed pointers; - this can be a useful guarantee for code that breaks borrowing assumptions using [`unsafe` operations](#unsafe-functions). `Copy` : This kind includes all types that can be copied. All types with sendable kind are copyable, as are managed boxes, managed closures, diff --git a/src/libstd/bool.rs b/src/libstd/bool.rs index e6be164099bf0..b0b586df4b58e 100644 --- a/src/libstd/bool.rs +++ b/src/libstd/bool.rs @@ -122,6 +122,7 @@ pub fn xor(a: bool, b: bool) -> bool { (a && !b) || (!a && b) } * ~~~ {.rust} * rusti> std::bool::implies(true, true) * true +* ~~~ * * ~~~ {.rust} * rusti> std::bool::implies(true, false) diff --git a/src/libstd/kinds.rs b/src/libstd/kinds.rs index f350e10616805..6c16ecc0d4ef8 100644 --- a/src/libstd/kinds.rs +++ b/src/libstd/kinds.rs @@ -18,7 +18,7 @@ intrinsic properties of the type. These classifications, often called They cannot be implemented by user code, but are instead implemented by the compiler automatically for the types to which they apply. -The 4 kinds are +The 3 kinds are * Copy - types that may be copied without allocation. This includes scalar types and managed pointers, and exludes owned pointers. It From 863e75f0a1f70494a8a036d35e8358748fb963a3 Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Sun, 30 Jun 2013 20:12:57 -0400 Subject: [PATCH 2/3] Fixed documentation for finalize->drop change --- doc/rust.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/rust.md b/doc/rust.md index c61cbe6476ce8..0b413783c35cd 100644 --- a/doc/rust.md +++ b/doc/rust.md @@ -2876,13 +2876,13 @@ The kinds are: Types with destructors (types that implement `Drop`) can not implement `Copy`. `Drop` : This is not strictly a kind, but its presence interacts with kinds: the `Drop` - trait provides a single method `finalize` that takes no parameters, and is run + trait provides a single method `drop` that takes no parameters, and is run when values of the type are dropped. Such a method is called a "destructor", and are always executed in "top-down" order: a value is completely destroyed before any of the values it owns run their destructors. Only `Send` types that do not implement `Copy` can implement `Drop`. -> **Note:** The `finalize` method may be renamed in future versions of Rust. +> **Note:** The `drop` method may be renamed in future versions of Rust. _Default_ : Types with destructors, closure environments, From c63b3f8e285b39349f198eca15ec252a2c8938db Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Sun, 30 Jun 2013 20:18:34 -0400 Subject: [PATCH 3/3] Removing the rename warning Now that the finalize->drop rename has happened, this hopefully shouldn't end up changing again. --- doc/rust.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/rust.md b/doc/rust.md index 0b413783c35cd..b23efe773ebe5 100644 --- a/doc/rust.md +++ b/doc/rust.md @@ -2882,8 +2882,6 @@ The kinds are: before any of the values it owns run their destructors. Only `Send` types that do not implement `Copy` can implement `Drop`. -> **Note:** The `drop` method may be renamed in future versions of Rust. - _Default_ : Types with destructors, closure environments, and various other _non-first-class_ types,