]> git.proxmox.com Git - rustc.git/blobdiff - src/libsyntax/util/small_vector.rs
Imported Upstream version 1.1.0+dfsg1
[rustc.git] / src / libsyntax / util / small_vector.rs
index 6b864d5294766fabffa4448c4440f997c32d6d22..5353d12b67813fe483dee91c92409ab2da067a5b 100644 (file)
@@ -64,7 +64,10 @@ impl<T> SmallVector<T> {
                 let result: &[T] = &[];
                 result
             }
-            One(ref v) => slice::ref_slice(v),
+            One(ref v) => {
+                // FIXME: Could be replaced with `slice::ref_slice(v)` when it is stable.
+                unsafe { slice::from_raw_parts(v, 1) }
+            }
             Many(ref vs) => vs
         }
     }
@@ -201,7 +204,7 @@ impl<T> MoveMap<T> for SmallVector<T> {
 }
 
 #[cfg(test)]
-mod test {
+mod tests {
     use super::*;
 
     #[test]