about summary refs log tree commit diff
path: root/compiler/rustc_arena
AgeCommit message (Collapse)AuthorLines
2022-12-10compiler: remove unnecessary imports and qualified pathsKaDiWa-1/+1
2022-11-22`rustc_arena`: remove a couple of `ref` patternsMaybe Waffle-10/+6
2022-08-23Make use of `[wrapping_]byte_{add,sub}`Maybe Waffle-1/+2
...replacing `.cast().wrapping_offset().cast()` & similar code.
2022-08-21Rollup merge of #100822 - WaffleLapkin:no_offset_question_mark, r=scottmcmMatthias Krüger-1/+1
Replace most uses of `pointer::offset` with `add` and `sub` As PR title says, it replaces `pointer::offset` in compiler and standard library with `pointer::add` and `pointer::sub`. This generally makes code cleaner, easier to grasp and removes (or, well, hides) integer casts. This is generally trivially correct, `.offset(-constant)` is just `.sub(constant)`, `.offset(usized as isize)` is just `.add(usized)`, etc. However in some cases we need to be careful with signs of things. r? ````@scottmcm```` _split off from #100746_
2022-08-21Replace most uses of `pointer::offset` with `add` and `sub`Maybe Waffle-1/+1
2022-08-18Add diagnostic translation lints to crates that don't emit them5225225-0/+2
2022-08-10Stabilize ptr_const_castMartin Habovstiak-1/+0
This stabilizes `ptr_const_cast` feature as was decided in a recent [FCP](https://github.com/rust-lang/rust/issues/92675#issuecomment-1190660233) Closes #92675
2022-07-07Rollup merge of #97711 - Nilstrieb:rustc-arena-ub, r=wesleywiserDylan DPC-12/+39
Improve soundness of rustc_arena Make it runnable in miri by changing the loop iteration count for some tests in miri. Also fix a stacked borrows issue with box.
2022-07-06Fix stacked borrows violation in rustc_arenaNilstrieb-8/+19
There was a problem with storing a `Box<T>` in a struct, where the current rules would invalidate the value. this makes it store a raw pointer instead, circumventing the aliasing problems.
2022-06-27Update `smallvec` to 1.8.1.Nicholas Nethercote-1/+1
This pulls in https://github.com/servo/rust-smallvec/pull/282, which gives some small wins for rustc.
2022-06-03Adapt tests to be able to run in miriNilstrieb-4/+20
Decrease the Ns of bug loops to a smaller N, which makes them a lot faster in miri.
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-02-02Remove unused dep from rustc_arenaest31-1/+0
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-09-20Migrate to 2021Mark Rousskov-1/+1
2021-08-30Remove unused arena macro argsbjorn3-1/+1
2021-08-28Auto merge of #85690 - bstrie:m2_arena, r=jackh726,nagisabors-78/+76
Macros 2.0-ify rustc_arena For the purpose of battle-testing macros 2.0 I'm looking to dogfood it in rustc, one crate at a time. (Note that there are only 12 changed lines if you ignore whitespace.)
2021-07-29rfc3052: Remove authors field from Cargo manifestsJade-1/+0
Since RFC 3052 soft deprecated the authors field anyway, hiding it from crates.io, docs.rs, and making Cargo not add it by default, and it is not generally up to date/useful information, we should remove it from crates in this repo.
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/+26
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-15Rollup merge of #82077 - pierwill:edit-droparena, r=lcnrJonas Schievink-6/+9
Edit `rustc_arena::DropArena` docs - Add a "Safety" section, edit formatting for clarity - Add missing punctuation in code comments
2021-02-14bumped smallvec depsklensy-1/+1
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-2/+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