about summary refs log tree commit diff
path: root/compiler/rustc_index
AgeCommit message (Collapse)AuthorLines
2023-10-30Clean up `rustc_*/Cargo.toml`.Nicholas Nethercote-3/+5
- Sort dependencies and features sections. - Add `tidy` markers to the sorted sections so they stay sorted. - Remove empty `[lib`] sections. - Remove "See more keys..." comments. Excluded files: - rustc_codegen_{cranelift,gcc}, because they're external. - rustc_lexer, because it has external use. - stable_mir, because it has external use.
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
2023-04-24Decorative changes to `IndexVec`Maybe Waffle-13/+12
2023-04-24`const`-ify some `{IndexVec, IndexSlice}` methodsMaybe Waffle-11/+11
2023-04-24move index code aroundMaybe Waffle-99/+100
2023-04-24Split `{Idx, IndexVec, IndexSlice}` into their own modulesMaybe Waffle-297/+317
2023-04-18Don't allocate it `IndexVec::remove`Maybe Waffle-1/+1
2023-04-17Make `IndexVec::ensure_contains_elem` return a reference to the elementMaybe Waffle-9/+9
2023-04-09Fix some clippy::complexityNilstrieb-8/+5
2023-04-06Auto merge of #109915 - scottmcm:layout-indexvec, r=oli-obkbors-0/+43
Use `FieldIdx` in `FieldsShape` Finally got to the main motivating example from https://github.com/rust-lang/compiler-team/issues/606 :)
2023-04-04Use `FieldIdx` in `FieldsShape`Scott McMurray-0/+43
Finally got to the main motivating example from the MCP :)
2023-04-03Doc-comment `IndexVec::from_elem` and use it in a few more placesScott McMurray-0/+11
2023-04-02Use `&IndexSlice` instead of `&IndexVec` where possibleScott McMurray-2/+40
All the same reasons as for `[T]`: more general, less pointer chasing, and `&mut IndexSlice` emphasizes that it doesn't change *length*.
2023-04-01Use `FieldIdx` in various things related to aggregatesScott McMurray-0/+6
Shrank `AggregateKind` by 8 bytes on x64, since the active field of a union is tracked as an `Option<FieldIdx>` instead of `Option<usize>`.
2023-03-30Add `IndexSlice` to go with `IndexVec`Scott McMurray-70/+160
Moves the methods that don't need full `IndexVec`-ness over to `IndexSlice`, and have `IndexVec` deref to `IndexSlice` so everything keeps working.
2023-03-29Rename `IndexVec::last` → `last_index`Scott McMurray-1/+1
As I've been trying to replace a `Vec` with an `IndexVec`, having `last` exist on both but returning very different types makes the transition a bit awkward -- the errors are later, where you get things like "there's no `ty` method on `mir::Field`" rather than a more localized error like "hey, there's no `last` on `IndexVec`". So I propose renaming `last` to `last_index` to help distinguish `Vec::last`, which returns an element, and `IndexVec::last_index`, which returns an index. (Similarly, `Iterator::last` also returns an element, not an index.)
2023-03-21Use `SmallVec` in bitsetsNilstrieb-5/+7
This doesn't increase their size and means that we don't have to heap allocate for small sets.
2023-03-03Match unmatched backticks in compiler/ that are part of rustdocest31-1/+1
2023-01-19Fix IndexVec::drain_enumeratedMichael Goulet-1/+6
2023-01-05Fix `uninlined_format_args` for some compiler cratesnils-5/+2
Convert all the crates that have had their diagnostic migration completed (except save_analysis because that will be deleted soon and apfloat because of the licensing problem).
2022-12-18A few small cleanups for `newtype_index`Nilstrieb-1/+1
Remove the `..` from the body, only a few invocations used it and it's inconsistent with rust syntax. Use `;` instead of `,` between consts. As the Rust syntax gods inteded.
2022-12-18Make `#[max]` an attribute in `newtype_index`Nilstrieb-1/+4
2022-12-12minor code cleanupsMatthias Krüger-1/+1
2022-12-10compiler: remove unnecessary imports and qualified pathsKaDiWa-1/+0
2022-11-24move things from rustc_target::abi to rustc_abihkalbasi-7/+12
2022-11-24make rustc_target usable outside of rustchkalbasi-9/+21
2022-11-01Implement Idx for OwnerId.Camille GILLOT-0/+2
2022-09-29Remove from compiler/ cratesreez12g-1/+0
2022-09-28Rollup merge of #102232 - Urgau:stabilize-bench_black_box, r=TaKO8KiYuki Okushi-1/+0
Stabilize bench_black_box This PR stabilize `feature(bench_black_box)`. ```rust pub fn black_box<T>(dummy: T) -> T; ``` The FCP was completed in https://github.com/rust-lang/rust/issues/64102. `@rustbot` label +T-libs-api -T-libs
2022-09-27Stabilize bench_black_boxUrgau-1/+0
2022-09-26remove cfg(bootstrap)Pietro Albini-1/+0
2022-09-15Only enable the let_else feature on bootstrapest31-1/+1
On later stages, the feature is already stable. Result of running: rg -l "feature.let_else" compiler/ src/librustdoc/ library/ | xargs sed -s -i "s#\\[feature.let_else#\\[cfg_attr\\(bootstrap, feature\\(let_else\\)#"
2022-08-18Add diagnostic translation lints to crates that don't emit them5225225-0/+2
2022-08-12debuginfo: Change C++-like encoding for enums.Michael Woerister-1/+3
The updated encoding should be able to handle niche layouts where more than one variant has fields.
2022-07-31Auto merge of #99052 - tmiasko:bitset-clone-from, r=Mark-Simulacrumbors-6/+19
Fix cloning from a BitSet with a different domain size The previous implementation incorrectly assumed that the number of words in a bit set is equal to the domain size. The new implementation delegates to `Vec::clone_from` which is specialized for `Copy` elements. Fixes #99006.
2022-07-21Edit `rustc_index::vec::IndexVec::pick3_mut` docspierwill-2/+6
Clarify when this method will panic. Also fix formatting for `pick2_mut`.
2022-07-08Fix cloning from a BitSet with a different domain sizeTomasz Miąsko-6/+19
The previous implementation incorrectly assumed that the number of words in a bit set is equal to the domain size. The new implementation delegates to `Vec::clone_from` which is specialized for `Copy` elements.
2022-07-04Use a bitset instead of a hash map in HIR ID validatorJakub Beránek-0/+10
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-21Auto merge of #95576 - DrMeepster:box_erasure, r=oli-obkbors-0/+12
Remove dereferencing of Box from codegen Through #94043, #94414, #94873, and #95328, I've been fixing issues caused by Box being treated like a pointer when it is not a pointer. However, these PRs just introduced special cases for Box. This PR removes those special cases and instead transforms a deref of Box into a deref of the pointer it contains. Hopefully, this is the end of the Box<T, A> ICEs.
2022-06-17Auto merge of #97863 - JakobDegen:bitset-choice, r=nnethercotebors-18/+135
`BitSet` related perf improvements This commit makes two changes: 1. Changes `MaybeLiveLocals` to use `ChunkedBitSet` 2. Overrides the `fold` method for the iterator for `ChunkedBitSet` I have local benchmarks verifying that each of these changes individually yield significant perf improvements to #96451 . I'm hoping this will be true outside of that context too. If that is not the case, I'll try to gate things on where they help as needed r? `@nnethercote` who I believe was working on closely related things, cc `@tmiasko` because of the destprop pr