auto merge of #14359 : brson/rust/minordoc, r=alexcrichton
This commit is contained in:
commit
53db981148
|
@ -88,11 +88,10 @@
|
||||||
//! ```
|
//! ```
|
||||||
//! extern crate collections;
|
//! extern crate collections;
|
||||||
//!
|
//!
|
||||||
//! use collections::HashMap;
|
|
||||||
//! use std::cell::RefCell;
|
//! use std::cell::RefCell;
|
||||||
//!
|
//!
|
||||||
//! struct Graph {
|
//! struct Graph {
|
||||||
//! edges: HashMap<uint, uint>,
|
//! edges: Vec<(uint, uint)>,
|
||||||
//! span_tree_cache: RefCell<Option<Vec<(uint, uint)>>>
|
//! span_tree_cache: RefCell<Option<Vec<(uint, uint)>>>
|
||||||
//! }
|
//! }
|
||||||
//!
|
//!
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
//! The Rust Core Library
|
//! # The Rust Core Library
|
||||||
//!
|
//!
|
||||||
//! The Rust Core Library is the dependency-free foundation of [The
|
//! The Rust Core Library is the dependency-free foundation of [The
|
||||||
//! Rust Standard Library](../std/index.html). It is the portable glue
|
//! Rust Standard Library](../std/index.html). It is the portable glue
|
||||||
|
|
|
@ -10,23 +10,18 @@
|
||||||
|
|
||||||
// FIXME: talk about offset, copy_memory, copy_nonoverlapping_memory
|
// FIXME: talk about offset, copy_memory, copy_nonoverlapping_memory
|
||||||
|
|
||||||
//! Conveniences for working with unsafe pointers, the `*T`, and `*mut T` types.
|
//! Operations on unsafe pointers, `*T`, and `*mut T`.
|
||||||
//!
|
//!
|
||||||
//! Working with unsafe pointers in Rust is fairly uncommon,
|
//! Working with unsafe pointers in Rust is uncommon,
|
||||||
//! and often limited to some narrow use cases: holding
|
//! typically limited to a few patterns.
|
||||||
//! an unsafe pointer when safe pointers are unsuitable;
|
|
||||||
//! checking for null; and converting back to safe pointers.
|
|
||||||
//! As a result, there is not yet an abundance of library code
|
|
||||||
//! for working with unsafe pointers, and in particular,
|
|
||||||
//! since pointer math is fairly uncommon in Rust, it is not
|
|
||||||
//! all that convenient.
|
|
||||||
//!
|
//!
|
||||||
//! Use the [`null` function](fn.null.html) to create null pointers,
|
//! Use the [`null` function](fn.null.html) to create null pointers,
|
||||||
//! the [`is_null`](trait.RawPtr.html#tymethod.is_null)
|
//! the [`is_null`](trait.RawPtr.html#tymethod.is_null)
|
||||||
//! and [`is_not_null`](trait.RawPtr.html#method.is_not_null)
|
//! and [`is_not_null`](trait.RawPtr.html#method.is_not_null)
|
||||||
//! methods of the [`RawPtr` trait](trait.RawPtr.html) to check for null.
|
//! methods of the [`RawPtr` trait](trait.RawPtr.html) to check for null.
|
||||||
//! The `RawPtr` trait is imported by the prelude, so `is_null` etc.
|
//! The `RawPtr` trait is imported by the prelude, so `is_null` etc.
|
||||||
//! work everywhere.
|
//! work everywhere. The `RawPtr` also defines the `offset` method,
|
||||||
|
//! for pointer math.
|
||||||
//!
|
//!
|
||||||
//! # Common ways to create unsafe pointers
|
//! # Common ways to create unsafe pointers
|
||||||
//!
|
//!
|
||||||
|
@ -316,7 +311,7 @@ pub unsafe fn array_each<T>(arr: **T, cb: |*T|) {
|
||||||
array_each_with_len(arr, len, cb);
|
array_each_with_len(arr, len, cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Extension methods for raw pointers.
|
/// Methods on raw pointers
|
||||||
pub trait RawPtr<T> {
|
pub trait RawPtr<T> {
|
||||||
/// Returns the null pointer.
|
/// Returns the null pointer.
|
||||||
fn null() -> Self;
|
fn null() -> Self;
|
||||||
|
|
|
@ -20,8 +20,7 @@
|
||||||
//! modules deal with unsafe pointers and memory manipulation.
|
//! modules deal with unsafe pointers and memory manipulation.
|
||||||
//! [`kinds`](../core/kinds/index.html) defines the special built-in traits,
|
//! [`kinds`](../core/kinds/index.html) defines the special built-in traits,
|
||||||
//! and [`raw`](../core/raw/index.html) the runtime representation of Rust types.
|
//! and [`raw`](../core/raw/index.html) the runtime representation of Rust types.
|
||||||
//! These are some of the lowest-level building blocks of Rust
|
//! These are some of the lowest-level building blocks in Rust.
|
||||||
//! abstractions.
|
|
||||||
//!
|
//!
|
||||||
//! ## Math on primitive types and math traits
|
//! ## Math on primitive types and math traits
|
||||||
//!
|
//!
|
||||||
|
|
Loading…
Reference in New Issue