]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #22218 - huonw:raw-docs, r=steveklabnik,huonw
authorManish Goregaokar <manishsmail@gmail.com>
Sun, 15 Feb 2015 12:52:31 +0000 (18:22 +0530)
committerManish Goregaokar <manishsmail@gmail.com>
Sun, 15 Feb 2015 12:52:31 +0000 (18:22 +0530)
commit8cc3fbd41dddbb11f442a17902cd0d276aa22566
treee161c7ec52efc9aad02a2ac2979b30b9aa606814
parent63091efa3bdcb18a6fac8af48acfa5634087624b
parent7a52932f4cd65f57bcc8d77f12e32066b2a9c432
Rollup merge of #22218 - huonw:raw-docs, r=steveklabnik,huonw

This overhauls the very meager docs that currently exist to clarify
various understandable confusions that I've noticed, e.g. people look in
`std::raw` for the "real" types of slices like `&[T]`, or think that
`Slice<T>` refers to `[T]` (fixes #22214).

This patch takes the liberty of offering some "style" guidance around
`raw::Slice`, since there's more restricted ways to duplicate all
functionality connected to it: `std::slice::from_raw_parts{,_mut}` for
construction and `.as_{,mut_}ptr` & `.len` for deconstruction.

It also deprecates the `std::raw::Closure` type which is now useless for
non-type-erased closures, and replaced by `TraitObject` for `&Fn`, `&mut
FnMut` etc, so I guess it should be called a:

[breaking-change]