Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
48fff6f
don't assume we can *always* find a return type hint in async fn
nikomatsakis Oct 9, 2019
061b906
Return `false` from `needs_drop` for all zero-sized arrays
ecstatic-morse Oct 13, 2019
8fd16ba
Remove special case for zero-sized arrays from indirectly mut locals
ecstatic-morse Oct 13, 2019
c08a871
Add regression test for #65348
ecstatic-morse Oct 13, 2019
f81b154
Add troubleshooting section to PGO chapter in rustc book.
michaelwoerister Oct 14, 2019
7528234
Add regression test for issue #64153.
michaelwoerister Oct 14, 2019
af05b23
Fix issue #64153 by checking for .rcgu.o suffix when trying to identi…
michaelwoerister Oct 15, 2019
53187c5
Slides path lifetime to the lifetime resolver
Phosphorus15 Oct 11, 2019
1fb8cfb
Organize `never_type` tests
Centril Oct 15, 2019
d82c1c5
Avoid unused lifetime warning for lifetimes introduced when desugerin…
gilescope Oct 15, 2019
fa3a4ae
Implement AsRef<[T]> for List<T>
spastorino Oct 15, 2019
c1f51b6
Rollup merge of #64603 - gilescope:unused-lifetime-warning, r=matthew…
Centril Oct 15, 2019
fd1cf87
Rollup merge of #65235 - nikomatsakis:issue-65159-async-fn-return-ice…
Centril Oct 15, 2019
2abce06
Rollup merge of #65307 - Phosphorus15:master, r=varkor
Centril Oct 15, 2019
2feabbb
Rollup merge of #65389 - ecstatic-morse:zero-sized-array-no-drop, r=e…
Centril Oct 15, 2019
a32fd51
Rollup merge of #65402 - michaelwoerister:pgo-troubleshooting-docs, r…
Centril Oct 15, 2019
d4e2f44
Rollup merge of #65435 - michaelwoerister:fix-issue-64153, r=alexcric…
Centril Oct 15, 2019
f46d291
Rollup merge of #65438 - Centril:almost, r=varkor
Centril Oct 15, 2019
453d011
Rollup merge of #65444 - spastorino:as-ref-for-list, r=Mark-Simulacrum
Centril Oct 15, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Implement AsRef<[T]> for List<T>
  • Loading branch information
spastorino committed Oct 15, 2019
commit fa3a4aeae5f3a4c403bf07038c56e74df3d9df70
7 changes: 7 additions & 0 deletions src/librustc/ty/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,13 @@ impl<T> Deref for List<T> {
type Target = [T];
#[inline(always)]
fn deref(&self) -> &[T] {
self.as_ref()
}
}

impl<T> AsRef<[T]> for List<T> {
#[inline(always)]
fn as_ref(&self) -> &[T] {
unsafe {
slice::from_raw_parts(self.data.as_ptr(), self.len)
}
Expand Down