diff options
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/util/small_vector.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libsyntax/util/small_vector.rs b/src/libsyntax/util/small_vector.rs index 6b864d52947..153f9d4a26d 100644 --- a/src/libsyntax/util/small_vector.rs +++ b/src/libsyntax/util/small_vector.rs @@ -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 } } |
