auto merge of #16897 : japaric/rust/mut-slice-collection, r=alexcrichton

This commit is contained in:
bors 2014-09-01 21:31:00 +00:00
commit 0bdac78da8

View File

@ -996,6 +996,15 @@ impl<'a, T> Collection for &'a [T] {
}
}
#[experimental = "trait is experimental"]
impl<'a, T> Collection for &'a mut [T] {
/// Returns the length of a vector
#[inline]
fn len(&self) -> uint {
self.repr().len
}
}
#[unstable = "waiting for DST"]
impl<'a, T> Default for &'a [T] {
fn default() -> &'a [T] { &[] }