We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e413dc3 commit fa3a4aeCopy full SHA for fa3a4ae
src/librustc/ty/mod.rs
@@ -700,6 +700,13 @@ impl<T> Deref for List<T> {
700
type Target = [T];
701
#[inline(always)]
702
fn deref(&self) -> &[T] {
703
+ self.as_ref()
704
+ }
705
+}
706
+
707
+impl<T> AsRef<[T]> for List<T> {
708
+ #[inline(always)]
709
+ fn as_ref(&self) -> &[T] {
710
unsafe {
711
slice::from_raw_parts(self.data.as_ptr(), self.len)
712
}
0 commit comments