about summary refs log tree commit diff
path: root/compiler/rustc_arena/src
AgeCommit message (Collapse)AuthorLines
2022-03-29mark FIXMES for all the places found that are probably offset_fromAria Beingessner-0/+6
2022-03-29Make some rustc code conform to strict provenance.Aria Beingessner-9/+11
There's some really bad stuff around `ty` and pointer tagging stuff that was too much work to handle here.
2022-01-28Clarify `ArenaAllocatable`'s second parameter.Nicholas Nethercote-5/+10
It's simply a binary thing to allow different behaviour for `Copy` vs `!Copy` types. The new code makes this much clearer; I was scratching my head over the old code for some time.
2022-01-28Add some comments.Nicholas Nethercote-7/+21
2022-01-26Rename `TypedArenaChunk` as `ArenaChunk`.Nicholas Nethercote-9/+9
Because it's used within both `TypedArena` and `DroplessArena`. The commit also makes `<u8>` the default parameter.
2021-11-19Add some comments.Nicholas Nethercote-3/+12
Also use `Default::default()` in one `TypedArena::default()`, for consistency with `DroplessArena::default()`.
2021-11-17Remove unnecessary lifetime argument from arena macros.Nicholas Nethercote-5/+5
Because it's always `'tcx`. In fact, some of them use a mixture of passed-in `$tcx` and hard-coded `'tcx`, so no other lifetime would even work. This makes the code easier to read.
2021-11-15Remove `DropArena`.Nicholas Nethercote-134/+7
Most arena-allocate types that impl `Drop` get their own `TypedArena`, but a few infrequently used ones share a `DropArena`. This sharing adds complexity but doesn't help performance or memory usage. Perhaps it was more effective in the past prior to some other improvements to arenas. This commit removes `DropArena` and the sharing of arenas via the `few` attribute of the `arena_types` macro. This change removes over 100 lines of code and nine uses of `unsafe` (one of which affects the parallel compiler) and makes the remaining code easier to read.
2021-08-30Remove unused arena macro argsbjorn3-1/+1
2021-05-25rustc_arena: macros 2.0bstrie-78/+76
2021-03-27Remove (lots of) dead codeJoshua Nelson-20/+0
Found with https://github.com/est31/warnalyzer. Dubious changes: - Is anyone else using rustc_apfloat? I feel weird completely deleting x87 support. - Maybe some of the dead code in rustc_data_structures, in case someone wants to use it in the future? - Don't change rustc_serialize I plan to scrap most of the json module in the near future (see https://github.com/rust-lang/compiler-team/issues/418) and fixing the tests needed more work than I expected. TODO: check if any of the comments on the deleted code should be kept.
2021-03-19Rollup merge of #83197 - jyn514:cfg-test-dead-code, r=joshtriplettDylan DPC-16/+18
Move some test-only code to test files Split out from https://github.com/rust-lang/rust/pull/83185.
2021-03-17Move some test-only code to test filesJoshua Nelson-16/+18
This also relaxes the bounds on some structs and moves them to the impl block instead.
2021-03-10Update to rustc-rayon 0.3.1Josh Stone-9/+25
This pulls in rust-lang/rustc-rayon#8 to fix #81425. (h/t @ammaraskar) That revealed weak constraints on `rustc_arena::DropArena`, because its `DropType` was holding type-erased raw pointers to generic `T`. We can implement `Send` for `DropType` (under `cfg(parallel_compiler)`) by requiring all `T: Send` before they're type-erased.
2021-02-20Update the bootstrap compilerJoshua Nelson-1/+0
Note this does not change `core::derive` since it was merged after the beta bump.
2021-02-13Edit `rustc_arena::DropArena` docspierwill-6/+9
- Add a "Safety" section, edit formatting for clarity - Add missing punctuation in code comments
2021-01-31Rollup merge of #80470 - SimonSapin:array-intoiter-type, r=m-ou-seJonas Schievink-2/+0
Stabilize by-value `[T; N]` iterator `core::array::IntoIter` Tracking issue: https://github.com/rust-lang/rust/issues/65798 This is unblocked now that `min_const_generics` has been stabilized in https://github.com/rust-lang/rust/pull/79135. This PR does *not* include the corresponding `IntoIterator` impl, which is https://github.com/rust-lang/rust/pull/65819. Instead, an iterator can be constructed through the `new` method. `new` would become unnecessary when `IntoIterator` is implemented and might be deprecated then, although it will stay stable.
2021-01-29`fn cold_path` doesn't need to be pubHenry Boisdequin-1/+1
2020-12-29Stabilize by-value `[T; N]` iterator `core::array::IntoIter`Simon Sapin-2/+0
Tracking issue: https://github.com/rust-lang/rust/issues/65798 This is unblocked now that `min_const_generics` has been stabilized in https://github.com/rust-lang/rust/pull/79135. This PR does *not* include the corresponding `IntoIterator` impl, which is https://github.com/rust-lang/rust/pull/65819. Instead, an iterator can be constructed through the `new` method. `new` would become unnecessary when `IntoIterator` is implemented and might be deprecated then, although it will stay stable.
2020-12-26stabilize min_const_genericsBastian Kauschke-1/+1
2020-11-20Use specialization to avoid copyingDániel Buga-13/+71
2020-10-30Fix even more clippy warningsJoshua Nelson-6/+4
2020-10-27Fix typos in arena commentsDániel Buga-2/+2
2020-10-20Track element count only for types that need dropDániel Buga-2/+6
2020-10-17Make sure arenas don't allocate bigger than HUGE_PAGEDániel Buga-8/+4
2020-10-15Arena: Copy cold_path and remove rustc_data_structures dependencyDániel Buga-1/+6
2020-09-26Remove unused #[allow(...)] statements from compiler/est31-1/+0
2020-09-25Auto merge of #77172 - jonas-schievink:rollup-a041rou, r=jonas-schievinkbors-1/+1
Rollup of 15 pull requests Successful merges: - #75438 (Use adaptive SVG favicon for rustdoc like other rust sites) - #76304 (Make delegation methods of `std::net::IpAddr` unstably const) - #76724 (Allow a unique name to be assigned to dataflow graphviz output) - #76978 (Documented From impls in std/sync/mpsc/mod.rs) - #77044 (Liballoc bench vec use mem take not replace) - #77050 (Typo fix: "satsify" -> "satisfy") - #77074 (add array::from_ref) - #77078 (Don't use an if guard to check equality with a constant) - #77079 (Use `Self` in docs when possible) - #77081 (Merge two almost identical match arms) - #77121 (Updated html_root_url for compiler crates) - #77136 (Suggest `const_mut_refs`, not `const_fn` for mutable references in `const fn`) - #77160 (Suggest `const_fn_transmute`, not `const_fn`) - #77164 (Remove workaround for deref issue that no longer exists.) - #77165 (Followup to #76673) Failed merges: r? `@ghost`
2020-09-23/nightly/nightly-rustcErik Hofmayer-1/+1
2020-09-23Updated html_root_url for compiler cratesErik Hofmayer-1/+1
2020-09-21DroplessArena: Allocate objects from the end of memory chunkTomasz Miąsko-21/+16
Allocating from the end of memory chunk simplifies the alignment code and reduces the number of checked arithmetic operations.
2020-09-20Rollup merge of #76821 - est31:remove_redundant_nightly_features, ↵Ralf Jung-3/+1
r=oli-obk,Mark-Simulacrum Remove redundant nightly features Removes a bunch of redundant/outdated nightly features. The first commit removes a `core_intrinsics` use for which a stable wrapper has been provided since. The second commit replaces the `const_generics` feature with `min_const_generics` which might get stabilized this year. The third commit is the result of a trial/error run of removing every single feature and then adding it back if compile failed. A bunch of unused features are the result that the third commit removes.
2020-09-18Add bench_typed_arena_clear_100 benchest31-0/+11
2020-09-18Replace loop with drop_in_place callest31-6/+1
2020-09-18Dogfood new_uninit and maybe_uninit_slice in rustc_arenaest31-19/+16
2020-09-17Remove intrinsics::arith_offset use from libarenaest31-3/+1
The use of arith_offset was added in 803e9ae67b770d8500c4ab5862e988d29118356a before the stable wrapper of the intrinsic was available. https://doc.rust-lang.org/stable/std/intrinsics/fn.arith_offset.html
2020-08-30mv compiler to compiler/mark-0/+905