about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-07-19Change the primary CGU merging algorithm.Nicholas Nethercote-14/+66
Instead of repeatedly merging the two smallest CGUs, we now use a merging algorithm that aims to minimize the duplication of inlined functions. `exa-0.10.1` was one benchmark that saw particularly good results. The old CGU stats: ``` INTERNALIZE - unique items: 2774 (1216 root + 1558 inlined), unique size: 122065 (77219 root + 44846 inlined) - placed items: 3834 (1216 root + 2618 inlined), placed size: 154552 (77219 root + 77333 inlined) - placed/unique items ratio: 1.38, placed/unique size ratio: 1.27 - CGUs: 16, mean size: 9659.5, sizes: [11791, 11634, 11173, 10987, 10939, 10507, 9992, 9813, 9593, 9580, 9030, 8447, 7975, 7961, 7876, 7254] ``` The new CGU stats: ``` INTERNALIZE - unique items: 2774 (1216 root + 1558 inlined), unique size: 122065 (77219 root + 44846 inlined) - placed items: 3626 (1216 root + 2410 inlined), placed size: 147201 (77219 root + 69982 inlined) - placed/unique items ratio: 1.31, placed/unique size ratio: 1.21 - CGUs: 16, mean size: 9200.1, sizes: [11634, 10939, 10227, 9555, 9178, 9167, 8879, 8804, 8604, 8603 (x3), 8602 (x2), 8601, 8600] ``` The difference is in the number of inlined items. There are 1558 unique inlined items. With the old algorithm these were placed 2618 times, resulting in 1060 duplicates. With the new algorithm these were placed 2410 times, resulting in 852 duplicates. Also, the mean CGU size dropped from 9659.5 to 9200.1, and the CGU size distribution tightened, with the biggest one a little smaller and the smallest ones a little bigger.
2023-07-19Add a useful comment.Nicholas Nethercote-0/+2
2023-07-19Split the CGU merging loop.Nicholas Nethercote-20/+30
It has two conditions. This commit splits it in two, one per condition. The next commit will change the first loop.
2023-07-19Add `MonoItemData::inlined`.Nicholas Nethercote-17/+19
2023-07-17Auto merge of #113772 - nnethercote:streamline-size-estimates-2, r=wesleywiserbors-97/+85
Streamline size estimates (take 2) This was merged in #113684 but then [something happened](https://github.com/rust-lang/rust/pull/113684#issuecomment-1636811985): > There has been a bors issue that lead to the merge commit of this PR getting purged from master. > You'll have to make a new PR to reapply it. So this is exactly the same changes. `@bors` r=wesleywiser
2023-07-17Auto merge of #113336 - compiler-errors:new-solver-iat, r=lcnrbors-13/+154
Add support for inherent projections in new solver Not hard to support these, and it cuts out a really big chunk of failing UI tests with `--compare-mode=next-solver` r? `@lcnr` (feel free to reassign, anyone can review this)
2023-07-16Auto merge of #113769 - matthiaskrgr:rollup-p6i1rco, r=matthiaskrgrbors-17/+218
Rollup of 7 pull requests Successful merges: - #113042 (Add Platform Support documentation for MIPS Release 6 targets) - #113539 (fixed typo) - #113614 (platform-support.md: It's now verified that NetBSD/riscv64 can self-h…) - #113750 (Add missing italicization to `sort_unstable_by_key` complexity ) - #113755 (Normalize lazy type aliases when probing for ADTs) - #113756 (fix wrong link) - #113762 (Fix typo) r? `@ghost` `@rustbot` modify labels: rollup
2023-07-17Remove `instance_def_size_estimate` query.Nicholas Nethercote-28/+12
It doesn't seem worthwhile now that `MonoItem::size_estimate` is called much less often.
2023-07-17Ignore unreachable inlined items in `debug_dump`.Nicholas Nethercote-30/+18
They're quite rare, and ignoring them simplifies things quite a bit, and further reduces the number of calls to `MonoItem::size_estimate` to the number of placed items (one per root item, and one or more per reachable inlined item).
2023-07-17Store item size estimate in `MonoItemData`.Nicholas Nethercote-18/+22
This means we call `MonoItem::size_estimate` (which involves a query) less often: just once per mono item, and then once more per inline item placement. After that we can reuse the stored value as necessary. This means `CodegenUnit::compute_size_estimate` is cheaper.
2023-07-17Introduce `MonoItemData`.Nicholas Nethercote-27/+39
It replaces `(Linkage, Visibility)`, making the code nicer. Plus the next commit will add another field.
2023-07-17Rollup merge of #113762 - alexpovel:master, r=NilstriebMatthias Krüger-1/+1
Fix typo Typo in a docstring, noticed [here](https://doc.rust-lang.org/std/result/enum.Result.html#method.map_or).
2023-07-17Rollup merge of #113756 - catandcoder:master, r=workingjubileeMatthias Krüger-6/+6
fix wrong link
2023-07-17Rollup merge of #113755 - fmease:probe-adt-norm-lazy-ty-alias, r=oli-obkMatthias Krüger-1/+20
Normalize lazy type aliases when probing for ADTs Fixes #113736. r? ```@oli-obk```
2023-07-17Rollup merge of #113750 - nipzu:italicize-sort-complexity, r=workingjubileeMatthias Krüger-1/+1
Add missing italicization to `sort_unstable_by_key` complexity Other methods like `sort_by_key` already had `m` italicized.
2023-07-17Rollup merge of #113614 - he32:netbsd-riscv64-more, r=JohnTitorMatthias Krüger-1/+1
platform-support.md: It's now verified that NetBSD/riscv64 can self-h… …ost.
2023-07-17Rollup merge of #113539 - agnarrarendelle:master, r=workingjubileeMatthias Krüger-3/+3
fixed typo Hi, I have fixed a few typos in commands. Please review my pr.
2023-07-17Rollup merge of #113042 - Cyanoxygen:add-mipsr6-target-docs, r=JohnTitorMatthias Krüger-4/+186
Add Platform Support documentation for MIPS Release 6 targets This is a follow-up to our to-announce MCP, rust-lang/compiler-team#638, where we proposed to assign several maintainers for MIPS R6 targets and was told to explain that this set of targets are experimental in nature. This documentation describes Rust support for `mipsisa*r6*-unknown-linux-gnu*` targets (mainly `mipsisa64r6el-unknown-linux-gnuabi64`), including toolchain setup, building, and testing procedures.
2023-07-16Auto merge of #113742 - ↵bors-2/+38
compiler-errors:dont-short-circuit-intercrate-global-preds, r=lcnr Don't call `predicate_must_hold`-esque functions during fulfillment in intercrate Fixes #113415 Given that this only happens in `translate_substs`, I don't actually think that this is something that you can weaponize, but it's still sketchy regardless. r? `@lcnr`
2023-07-16Check GAT, IAT, and weak type where clauses during projectionMichael Goulet-16/+112
2023-07-16Add support for inherent projectionsMichael Goulet-3/+48
2023-07-16Auto merge of #113545 - cjgillot:query-entry, r=compiler-errorsbors-295/+310
Check entry type as part of item type checking. This code is currently executed inside the root `analysis` query. Instead, check it during `check_for_entry_fn(CRATE_DEF_ID)` to hopefully avoid some re-executions. `CRATE_DEF_ID` is chosen by considering that entry fn are typically at crate root, so the corresponding HIR should already be in the dependencies.
2023-07-16Fix typoAlex Povel-1/+1
2023-07-16Auto merge of #113749 - Kobzol:opt-dist-ci-group, r=clubby789bors-20/+53
Use log groups in `opt-dist` Some of the output was quite verbose in CI logs, this should help with that. r? bootstrap
2023-07-16Auto merge of #112239 - jieyouxu:targeted-no-method-suggestions, r=cjgillotbors-4/+259
Add `#[rustc_confusables]` attribute to allow targeted "no method" error suggestions on standard library types After this PR, the standard library developer can annotate methods on e.g. `BTreeSet::push` with `#[rustc_confusables("insert")]`. When the user mistypes `btreeset.push()`, `BTreeSet::insert` will be suggested if there are no other candidates to suggest. This PR lays the foundations for contributors to add `rustc_confusables` annotations to standard library types for targeted suggestions, as specified in #59450, or to address cases such as #108437. ### Example Assume `BTreeSet` is the standard library type: ``` // Standard library definition #![feature(rustc_attrs)] struct BTreeSet; impl BTreeSet { #[rustc_confusables("push")] fn insert(&self) {} } // User code fn main() { let x = BTreeSet {}; x.push(); } ``` A new suggestion (which has lower precedence than suggestions for misspellings and only is shown when there are no misspellings suggestions) will be added to hint the user maybe they intended to write `x.insert()` instead: ``` error[E0599]: no method named `push` found for struct `BTreeSet` in the current scope --> test.rs:12:7 | 3 | struct BTreeSet; | --------------- method `push` not found for this struct ... 12 | x.push(); | ^^^^ method not found in `BTreeSet` | help: you might have meant to use `insert` | 12 | x.insert(); | ~~~~~~ error: aborting due to previous error ```
2023-07-16Auto merge of #113557 - Amanieu:no-builtins-prelude, r=petrochenkovbors-344/+347
Hide `compiler_builtins` in the prelude This crate is a private implementation detail. We only need to insert it into the crate graph for linking and should not expose any of its public API. Fixes #113533
2023-07-16fix wrong linkcui fliter-6/+6
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-07-16Add infrastructure `#[rustc_confusables]` attribute to allow targeted许杰友 Jieyou Xu (Joe)-4/+259
"no method" errors on standard library types The standard library developer can annotate methods on e.g. `BTreeSet::push` with `#[rustc_confusables("insert")]`. When the user mistypes `btreeset.push()`, `BTreeSet::insert` will be suggested if there are no other candidates to suggest.
2023-07-16Auto merge of #113626 - Urgau:dedup-native-static-libs, r=petrochenkovbors-1/+16
De-duplicate consecutive libs when printing native-static-libs This PR adds a de-duplicate step just before printing the `native-static-libs`. This step de-duplicates all the consecutive libs based only on the relevant comparison elements (this exclude spans, ast elements, ...). Fixes https://github.com/rust-lang/rust/issues/113209
2023-07-16Normalize lazy type aliases when probing for ADTsLeón Orell Valerian Liehr-1/+20
2023-07-16Fix sort_unstable_by_key italicizationnipzu-1/+1
2023-07-16Use log groups in `opt-dist`Jakub Beránek-20/+53
Some of the output was quite verbose in CI logs, this should help with that.
2023-07-16Auto merge of #113745 - tshepang:patch-1, r=workingjubileebors-6/+0
collect.rs: remove "Basic usage" text where not useful
2023-07-16collect.rs: remove "Basic usage" text where not usefulTshepang Mbambo-6/+0
2023-07-16Auto merge of #113430 - Zalathar:hash, r=b-naberbors-17/+6
Remove `LLVMRustCoverageHashCString` Coverage has two FFI functions for computing the hash of a byte string. One takes a ptr/len pair (`LLVMRustCoverageHashByteArray`), and the other takes a NUL-terminated C string (`LLVMRustCoverageHashCString`). But on closer inspection, the C string version is unnecessary. The calling-side code converts a Rust `&str` into a `CString`, and the C++ code then immediately turns it back into a ptr/len string before actually hashing it. So we can just call the ptr/len version directly instead. --- This PR also fixes a bug in the C++ declaration of `LLVMRustCoverageHashByteArray`. It should be `size_t`, since that's what is declared and passed on the Rust side, and it's what `StrRef`'s constructor expects to receive on the callee side.
2023-07-16Don't call predicate_must_hold during fulfillment in intercrateMichael Goulet-2/+38
2023-07-16Auto merge of #113738 - jyn514:rollup-mjcya4c, r=jyn514bors-91/+81
Rollup of 3 pull requests Successful merges: - #113643 (bootstrap: Clean up try_run) - #113731 (Remove unused `bootstrap::util::CiEnv` enum) - #113737 (update mailmap for myself) r? `@ghost` `@rustbot` modify labels: rollup
2023-07-15Rollup merge of #113737 - jyn514:mailmap, r=jyn514jyn-1/+5
update mailmap for myself
2023-07-15Rollup merge of #113731 - jyn514:ci-env, r=ozkanonurjyn-10/+0
Remove unused `bootstrap::util::CiEnv` enum the right one is `build_helper::CiEnv`; this one wasn't even used.
2023-07-15Rollup merge of #113643 - jyn514:try-run, r=ozkanonurjyn-80/+76
bootstrap: Clean up try_run r? `@ozkanonur` since you reviewed `@GuillaumeGomez's` PR i recommend reviewing commit-by-commit
2023-07-15update mailmap for myselfjyn-1/+5
2023-07-15Auto merge of #113606 - jyn514:parallel-compiler-cleanup, r=cjgillotbors-12/+5
Don't require each rustc_interface tool to opt-in to parallel_compiler Previously, forgetting to call `interface::set_thread_safe_mode` would cause the following ICE: ``` thread 'rustc' panicked at 'uninitialized dyn_thread_safe mode!', /rustc/dfe0683138de0959b6ab6a039b54d9347f6a6355/compiler/rustc_data_structures/src/sync.rs:74:18 ``` This calls `set_thread_safe_mode` in `interface::run_compiler` to avoid requiring it in the caller. Fixes `tests/run-make-fulldeps/issue-19371` when parallel-compiler is enabled. r? `@SparrowLii` cc https://github.com/rust-lang/rust/issues/75760
2023-07-15Check entry type as part of item type checking.Camille GILLOT-295/+310
2023-07-15Auto merge of #113697 - ↵bors-6/+1
GuillaumeGomez:rm-unneeded-externallocation-handling, r=lqd Remove unneeded handling for `ExternalLocation::Unknown` in rustdoc render context Should fix perf regression introduced in https://github.com/rust-lang/rust/pull/113623. r? `@lqd`
2023-07-15Auto merge of #113732 - matthiaskrgr:rollup-nm5qy4i, r=matthiaskrgrbors-278/+449
Rollup of 6 pull requests Successful merges: - #113625 (Structurally normalize in selection) - #113644 (misc bootstrap cleanups) - #113663 (Implement "items do not inherit unsafety" note for THIR unsafeck) - #113683 (remove outdated `FIXME`s in bootstrap internals) - #113709 (rustdoc: use src consistently over source in CSS/JS) - #113724 (Migrate GUI colors test to original CSS color format) r? `@ghost` `@rustbot` modify labels: rollup
2023-07-15Rollup merge of #113724 - GuillaumeGomez:migrate-gui-test-color-21, r=notriddleMatthias Krüger-10/+10
Migrate GUI colors test to original CSS color format Follow-up of https://github.com/rust-lang/rust/pull/111459. r? `@notriddle`
2023-07-15Rollup merge of #113709 - notriddle:notriddle/src, r=GuillaumeGomezMatthias Krüger-155/+155
rustdoc: use src consistently over source in CSS/JS The two terms have been used, inconsistently, in closely related spots like the `src/` directory vs `source-files.js`, and with things like `src-sidebar-toggle` vs the `source-sidebar`. This PR changes most use of `source` to `src` instead (except the localStorage configuration variables, which would be very complicated to migrate). It also renames `.srclink` to `.src`. This is mostly aiming to cut out one of those many little peanut-butter bits of bloat, and is consistent with how other link classes are done (like how you have `a.mod` stylesheet rules, but there's also a `mod` class put on the body tag).
2023-07-15Rollup merge of #113683 - ozkanonur:polished, r=jyn514Matthias Krüger-13/+1
remove outdated `FIXME`s in bootstrap internals self-explanatory
2023-07-15Rollup merge of #113663 - syvb:non_inherited_unsafe_thir, r=cjgillotMatthias Krüger-26/+176
Implement "items do not inherit unsafety" note for THIR unsafeck Implements the "items do not inherit unsafety from separate enclosing items" note from the MIR unsafety checker in the THIR unsafety checker (`-Z thir-unsafeck`) to maintain parity between the two unsafety checkers. The logic to find the separate enclosing item is nearly the same as in the MIR unsafety checker.
2023-07-15Rollup merge of #113644 - jyn514:bootstrap-cleanups, r=albertlarsan68Matthias Krüger-68/+56
misc bootstrap cleanups - rename `detail_exit_macro` to `exit` - remove unnecessary `Builder::new_standalone` function - support `x suggest` with build-metrics