about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src/functor.rs
AgeCommit message (Collapse)AuthorLines
2023-10-17Remove `IdFunctor` trait.Nicholas Nethercote-116/+0
It's defined in `rustc_data_structures` but is only used in `rustc_type_ir`. The code is shorter and easier to read if we remove this layer of abstraction and just do the things directly where they are needed.
2023-04-24Split `{Idx, IndexVec, IndexSlice}` into their own modulesMaybe Waffle-1/+1
2023-02-14Refactor refcounted structural_impls via functorsAlan Egerton-1/+50
2022-06-08Use liballoc's specialised in-place vec collectionAlan Egerton-34/+2
liballoc already specialises in-place vector collection, so manually reimplementing it in `IdFunctor::try_map_id` was superfluous.
2021-12-07Make IdFunctor::try_map_id panic-safeAlan Egerton-24/+29
2021-12-03Rollup merge of #88906 - Kixunil:box-maybe-uninit-write, r=dtolnayMatthias Krüger-4/+2
Implement write() method for Box<MaybeUninit<T>> This adds method similar to `MaybeUninit::write` main difference being it returns owned `Box`. This can be used to elide copy from stack safely, however it's not currently tested that the optimization actually occurs. Analogous methods are not provided for `Rc` and `Arc` as those need to handle the possibility of sharing. Some version of them may be added in the future. This was discussed in #63291 which this change extends.
2021-12-02Implement write() method for Box<MaybeUninit<T>>Martin Habovstiak-4/+2
This adds method similar to `MaybeUninit::write` main difference being it returns owned `Box`. This can be used to elide copy from stack safely, however it's not currently tested that the optimization actually occurs. Analogous methods are not provided for `Rc` and `Arc` as those need to handle the possibility of sharing. Some version of them may be added in the future. This was discussed in #63291 which this change extends.
2021-12-02Remove no-longer used `IdFunctor::map_id`Alan Egerton-8/+0
2021-11-27Use intrinsic pointer methodsAlan Egerton-7/+5
2021-11-27Delegate from `map_id` to `try_map_id`Alan Egerton-57/+6
2021-11-27Avoid UB when short-circuiting try_map_id for VecAlan Egerton-4/+11
2021-11-26Make `TypeFoldable` implementors short-circuit on errorLeSeulArtichaut-1/+69
Co-authored-by: Alan Egerton <eggyal@gmail.com>
2021-08-30Use MaybeUninit::write in functor.rsest31-1/+1
MaybeUninit::write is stable as of 1.55.0.
2020-11-16wordslcnr-1/+1
2020-11-16add IdFunctor to rustc_data_structuresBastian Kauschke-0/+82