From b7a8496a073c7ee1a8b4bb9dc4ee4efed80e3522 Mon Sep 17 00:00:00 2001 From: lcnr Date: Wed, 17 Aug 2022 11:22:47 +0200 Subject: [PATCH] add List::as_slice --- compiler/rustc_middle/src/ty/list.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler/rustc_middle/src/ty/list.rs b/compiler/rustc_middle/src/ty/list.rs index db3b5cfd180..79365ef281b 100644 --- a/compiler/rustc_middle/src/ty/list.rs +++ b/compiler/rustc_middle/src/ty/list.rs @@ -65,6 +65,10 @@ impl List { pub fn len(&self) -> usize { self.len } + + pub fn as_slice(&self) -> &[T] { + self + } } impl List {