about summary refs log tree commit diff
path: root/compiler/rustc_index/src
AgeCommit message (Collapse)AuthorLines
2024-09-08IntervalSet: add comment about representationRalf Jung-1/+1
2024-09-08Auto merge of #129346 - nnethercote:fix-double-handling-in-collect_tokens, ↵bors-1/+1
r=petrochenkov Fix double handling in `collect_tokens` Double handling of AST nodes can occur in `collect_tokens`. This is when an inner call to `collect_tokens` produces an AST node, and then an outer call to `collect_tokens` produces the same AST node. This can happen in a few places, e.g. expression statements where the statement delegates `HasTokens` and `HasAttrs` to the expression. It will also happen more after #124141. This PR fixes some double handling cases that cause problems, including #129166. r? `@petrochenkov`
2024-08-31disable size asserts in the compiler when randomizing layoutsThe 8472-0/+11
2024-08-28Rollup merge of #129401 - ↵Jubilee-1/+1
workingjubilee:partial-initialization-of-stabilization, r=dtolnay,joboet Partially stabilize `feature(new_uninit)` Finished comment period: https://github.com/rust-lang/rust/issues/63291#issuecomment-2183022955 The following API has been stabilized from https://github.com/rust-lang/rust/issues/63291 ```rust impl<T> Box<T> { pub fn new_uninit() -> Box<MaybeUninit<T>> {…} } impl<T> Rc<T> { pub fn new_uninit() -> Rc<MaybeUninit<T>> {…} } impl<T> Arc<T> { pub fn new_uninit() -> Arc<MaybeUninit<T>> {…} } impl<T> Box<[T]> { pub fn new_uninit_slice(len: usize) -> Box<[MaybeUninit<T>]> {…} } impl<T> Rc<[T]> { pub fn new_uninit_slice(len: usize) -> Rc<[MaybeUninit<T>]> {…} } impl<T> Arc<[T]> { pub fn new_uninit_slice(len: usize) -> Arc<[MaybeUninit<T>]> {…} } impl<T> Box<MaybeUninit<T>> { pub unsafe fn assume_init(self) -> Box<T> {…} } impl<T> Box<[MaybeUninit<T>]> { pub unsafe fn assume_init(self) -> Box<[T]> {…} } impl<T> Rc<MaybeUninit<T>> { pub unsafe fn assume_init(self) -> Rc<T> {…} } impl<T> Rc<[MaybeUninit<T>]> { pub unsafe fn assume_init(self) -> Rc<[T]> {…} } impl<T> Arc<MaybeUninit<T>> { pub unsafe fn assume_init(self) -> Arc<T> {…} } impl<T> Arc<[MaybeUninit<T>]> { pub unsafe fn assume_init(self) -> Arc<[T]> {…} } ``` The remaining API is split between new issues - `new_zeroed_alloc`: https://github.com/rust-lang/rust/issues/129396 - `box_uninit_write`: https://github.com/rust-lang/rust/issues/129397 All relevant code is thus either stabilized or split out of that issue, so this closes #63291 as, with the FCP concluded, that issue has served its purpose. try-job: x86_64-rust-for-linux
2024-08-27compiler: Remove feature(new_uninit)Jubilee Young-1/+1
2024-08-27Add `warn(unreachable_pub)` to `rustc_index`.Nicholas Nethercote-0/+1
2024-08-23library: Move unstable API of new_uninit to new featuresJubilee Young-0/+1
- `new_zeroed` variants move to `new_zeroed_alloc` - the `write` fn moves to `box_uninit_write` The remainder will be stabilized in upcoming patches, as it was decided to only stabilize `uninit*` and `assume_init`.
2024-08-24Avoid double-handling of attributes in `collect_tokens`.Nicholas Nethercote-1/+1
By keeping track of attributes that have been previously processed. This fixes the `macro-rules-derive-cfg.stdout` test, and is necessary for #124141 which removes nonterminals. Also shrink the `SmallVec` inline size used in `IntervalSet`. 2 gives slightly better perf than 4 now that there's an `IntervalSet` in `Parser`, which is cloned reasonably often.
2024-08-13Add and use `IndexVec::append`Josh Stone-0/+5
2024-07-29Reformat `use` declarations.Nicholas Nethercote-24/+15
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-15Fix feature gating on rustc_index to not use implicit featuresMichael Goulet-3/+3
2024-07-04Auto merge of #127170 - bjorn3:no_specialize_index_borrowck, r=michaelwoeristerbors-4/+1
Stop using specialization in rustc_index and rustc_borrowck For rustc_borrowck the version with specialization isn't much more readable anyway IMO. For rustc_index it probably doesn't affect perf in any noticeable way anyway.
2024-07-04Use `IndexVec` for coroutine local mappingLiu Dingming-0/+5
2024-06-30Remove usage of specialization from newtype_index!bjorn3-4/+1
2024-06-12Use `tidy` to sort crate attributes for all compiler crates.Nicholas Nethercote-1/+3
We already do this for a number of crates, e.g. `rustc_middle`, `rustc_span`, `rustc_metadata`, `rustc_span`, `rustc_errors`. For the ones we don't, in many cases the attributes are a mess. - There is no consistency about order of attribute kinds (e.g. `allow`/`deny`/`feature`). - Within attribute kind groups (e.g. the `feature` attributes), sometimes the order is alphabetical, and sometimes there is no particular order. - Sometimes the attributes of a particular kind aren't even grouped all together, e.g. there might be a `feature`, then an `allow`, then another `feature`. This commit extends the existing sorting to all compiler crates, increasing consistency. If any new attribute line is added there is now only one place it can go -- no need for arbitrary decisions. Exceptions: - `rustc_log`, `rustc_next_trait_solver` and `rustc_type_ir_macros`, because they have no crate attributes. - `rustc_codegen_gcc`, because it's quasi-external to rustc (e.g. it's ignored in `rustfmt.toml`).
2024-04-18Simplify `static_assert_size`s.Nicholas Nethercote-1/+1
We want to run them on all 64-bit platforms.
2024-04-03Check `x86_64` size assertions on `aarch64`, tooZalathar-1/+1
This makes it easier for contributors on aarch64 workstations (e.g. Macs) to notice when these assertions have been violated.
2024-03-06doc: Add better explanationorion GONZALEZ (contractor)-1/+18
2024-02-06Invert diagnostic lints.Nicholas Nethercote-2/+0
That is, change `diagnostic_outside_of_impl` and `untranslatable_diagnostic` from `allow` to `deny`, because more than half of the compiler has be converted to use translated diagnostics. This commit removes more `deny` attributes than it adds `allow` attributes, which proves that this change is warranted.
2024-01-27Auto merge of #120024 - Mark-Simulacrum:fast-union-merge, r=cjgillotbors-0/+6
Merge into larger interval set This reduces the work done while merging rows. In at least one case (#50450), we have thousands of union([range], [20,000 ranges]), which previously inserted each of the 20,000 ranges one by one. Now we only insert one range into the right hand set after copying the set over. This cuts the runtime of the test case in #50450 from ~26 seconds to ~6 seconds locally, though it doesn't change the memory usage peak (~9.5GB).
2024-01-26Rollup merge of #119800 - dev-ardi:tmp, r=wesleywiserMatthias Krüger-0/+7
Document `rustc_index::vec::IndexVec` Document a few of the methods. Part of https://github.com/rust-lang/rust/issues/93792.
2024-01-26Update compiler/rustc_index/src/vec.rsArdi-0/+1
Co-authored-by: Wesley Wiser <wwiser@gmail.com>
2024-01-25Remove unused featuresclubby789-9/+2
2024-01-22Remove uses of HybridBitSet.Camille GILLOT-2/+2
2024-01-16Merge into larger interval setMark Rousskov-0/+6
This reduces the work done while merging rows. In at least one case (issue 50450), we have thousands of union([range], [20,000 ranges]), which previously inserted each of the 20,000 ranges one by one. Now we only insert one range into the right hand set after copying the set over.
2024-01-10Fix some mistakes + new docardi-6/+5
2024-01-10Oh wellardi-15/+3
2024-01-10Document the struct and a few methodsardi-0/+19
2024-01-06Auto merge of #119499 - cjgillot:dtm-opt, r=nnethercotebors-11/+5
Two small bitset optimisations
2024-01-02Reuse `bitwise` in BitMatrix.Camille GILLOT-11/+5
2023-12-31Avoid specialization for the Span Encodable and Decodable implsbjorn3-4/+4
2023-12-23Mention the relevant tracking issue next to my `bit_set` hackNadrieril-0/+2
2023-12-15Make `rustc_index::bit_set` available on stableNadrieril-12/+37
2023-11-22Replace `no_ord_impl` with `orderable`.Nicholas Nethercote-0/+1
Similar to the previous commit, this replaces `newtype_index`'s opt-out `no_ord_impl` attribute with the opt-in `orderable` attribute.
2023-11-18Begin nightly-ifying rustc_type_irMichael Goulet-3/+2
2023-11-13Remove unnecessary annotation.Nicholas Nethercote-2/+0
2023-11-13Remove `IndexSlice::convert_index_type`.Nicholas Nethercote-4/+0
2023-11-13Remove `impl FiniteBitSetTy for {u64,u128}`.Nicholas Nethercote-48/+0
Only the impl for `u32` is used. These can be reinstated easily if needed in the future.
2023-11-13Remove `BitSet::to_hybrid`.Nicholas Nethercote-6/+0
2023-11-13Remove `BitSet::words`.Nicholas Nethercote-9/+4
2023-10-06Preserve DebugInfo in DeadStoreElimination.Camille GILLOT-1/+7
2023-08-24Auto merge of #115094 - Mark-Simulacrum:bootstrap-update, r=ozkanonurbors-1/+1
Update bootstrap compiler to 1.73.0 beta
2023-08-23Bump cfg(bootstrap)Mark Rousskov-1/+1
2023-08-22Convert it into a warningNilstrieb-1/+6
Co-authored-by: León Orell Valerian Liehr <me@fmease.dev>
2023-08-22Add disclaimer on size assertion macroNilstrieb-0/+7
Sometimes people are inspired by rustc to add size assertions to their code and copy the macro. This is bad because it causes hard build errors. rustc happens to be special where it makes this okay.
2023-08-03Add `internal_features` lintNilstrieb-0/+1
It lints against features that are inteded to be internal to the compiler and standard library. Implements MCP #596. We allow `internal_features` in the standard library and compiler as those use many features and this _is_ the standard library from the "internal to the compiler and standard library" after all. Marking some features as internal wasn't exactly the most scientific approach, I just marked some mostly obvious features. While there is a categorization in the macro, it's not very well upheld (should probably be fixed in another PR). We always pass `-Ainternal_features` in the testsuite About 400 UI tests and several other tests use internal features. Instead of throwing the attribute on each one, just always allow them. There's nothing wrong with testing internal features^^
2023-07-12Re-format let-else per rustfmt updateMark Rousskov-3/+1
2023-05-25Auto merge of #111925 - Manishearth:rollup-z6z6l2v, r=Manishearthbors-4/+4
Rollup of 5 pull requests Successful merges: - #111741 (Use `ObligationCtxt` in custom type ops) - #111840 (Expose more information in `get_body_with_borrowck_facts`) - #111876 (Roll compiler_builtins to 0.1.92) - #111912 (Use `Option::is_some_and` and `Result::is_ok_and` in the compiler ) - #111915 (libtest: Improve error when missing `-Zunstable-options`) r? `@ghost` `@rustbot` modify labels: rollup
2023-05-24Use `Option::is_some_and` and `Result::is_ok_and` in the compilerMaybe Waffle-4/+4
2023-05-19Leverage the interval property to precompute borrow kill points.Camille GILLOT-0/+24