Skip to content

Commit

Permalink
Docs: &A and &mut A are references, not pointers
Browse files Browse the repository at this point in the history
Caught by Brian Smith: #27774 (comment)
  • Loading branch information
SimonSapin committed Sep 25, 2015
1 parent 5ca60d9 commit 761d163
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libcore/slice.rs
Expand Up @@ -1410,15 +1410,15 @@ impl<'a, T> ExactSizeIterator for ChunksMut<'a, T> {}
// Free functions
//

/// Converts a pointer to A into a slice of length 1 (without copying).
/// Converts a reference to A into a slice of length 1 (without copying).
#[unstable(feature = "ref_slice", issue = "27774")]
pub fn ref_slice<A>(s: &A) -> &[A] {
unsafe {
from_raw_parts(s, 1)
}
}

/// Converts a pointer to A into a slice of length 1 (without copying).
/// Converts a reference to A into a slice of length 1 (without copying).
#[unstable(feature = "ref_slice", issue = "27774")]
pub fn mut_ref_slice<A>(s: &mut A) -> &mut [A] {
unsafe {
Expand Down

0 comments on commit 761d163

Please sign in to comment.