diff options
| author | Jonas Schievink <jonasschievink@gmail.com> | 2020-02-06 23:21:44 +0100 |
|---|---|---|
| committer | Jonas Schievink <jonasschievink@gmail.com> | 2020-02-08 14:29:18 +0100 |
| commit | 66fd4e6ed8fbc00feeccfe0fe9d25e1c1346807d (patch) | |
| tree | fbe08b10091e7e103384b1d40ca48eefd41a446f /src/librustc_ty | |
| parent | 6cad7542da2f10e2110f942de4db59716bacb3df (diff) | |
Make `associated_items` query return a slice
Diffstat (limited to 'src/librustc_ty')
| -rw-r--r-- | src/librustc_ty/ty.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/librustc_ty/ty.rs b/src/librustc_ty/ty.rs index aa05165e3de..b032acf82f5 100644 --- a/src/librustc_ty/ty.rs +++ b/src/librustc_ty/ty.rs @@ -206,12 +206,10 @@ fn associated_item_def_ids(tcx: TyCtxt<'_>, def_id: DefId) -> &[DefId] { } } -fn associated_items<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId) -> ty::AssocItemsIterator<'tcx> { - ty::AssocItemsIterator { - items: tcx.arena.alloc_from_iter( - tcx.associated_item_def_ids(def_id).iter().map(|did| tcx.associated_item(*did)), - ), - } +fn associated_items<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId) -> &'tcx [ty::AssocItem] { + tcx.arena.alloc_from_iter( + tcx.associated_item_def_ids(def_id).iter().map(|did| tcx.associated_item(*did)), + ) } fn def_span(tcx: TyCtxt<'_>, def_id: DefId) -> Span { |
