-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rollup of 7 pull requests #138630
Rollup of 7 pull requests #138630
Conversation
This clarifies the explanation of why this is not allowed and also what to do instead. Fixes 62071 PS There was suggestion of adding a link to the book. I did not yet do that, but if desired that could be added.
This allows the code to be simplified a little bit.
So that we can also observe them for try builds, before merging a PR.
…ation of the post merge report
It determines if a function should have any `inline` attributes checked. For `ItemKind::Fn` it returns true or false depending on the details of the function; for anything other item kind it returns *true*. This latter case should instead be *false*. (In the nearby and similar functions `is_relevant_impl` and `is_relevant_trait` the non-function cases return false.) The effect of this is that non-functions are no longer checked. But rustc already disallows `inline` on any non-function items. So if anything its a tiny performance win, because that was useless anyway.
This commit fixes an internal compiler error (ICE) that occurs when rustdoc attempts to process macros with a remapped filename. The issue arose during macro expansion when the `--remap-path-prefix` option was used. Instead of passing remapped filenames through, which would trigger the "attempted to remap an already remapped filename" panic, we now extract the original local path from remapped filenames before processing them. A test case has been added to verify this behavior. Fixes rust-lang#138520 Signed-off-by: Charalampos Mitrodimas <charmitro@posteo.net>
`hir::Item` has an `ident` field. - It's always non-empty for these item kinds: `ExternCrate`, `Static`, `Const`, `Fn`, `Macro`, `Mod`, `TyAlias`, `Enum`, `Struct`, `Union`, Trait`, TraitAalis`. - It's always empty for these item kinds: `ForeignMod`, `GlobalAsm`, `Impl`. - For `Use`, it is non-empty for `UseKind::Single` and empty for `UseKind::{Glob,ListStem}`. All of this is quite non-obvious; the only documentation is a single comment saying "The name might be a dummy name in case of anonymous items". Some sites that handle items check for an empty ident, some don't. This is a very C-like way of doing things, but this is Rust, we have sum types, we can do this properly and never forget to check for the exceptional case and never YOLO possibly empty identifiers (or possibly dummy spans) around and hope that things will work out. The commit is large but it's mostly obvious plumbing work. Some notable things. - A similar transformation makes sense for `ast::Item`, but this is already a big change. That can be done later. - Lots of assertions are added to item lowering to ensure that identifiers are empty/non-empty as expected. These will be removable when `ast::Item` is done later. - `ItemKind::Use` doesn't get an `Ident`, but `UseKind::Single` does. - `lower_use_tree` is significantly simpler. No more confusing `&mut Ident` to deal with. - `ItemKind::ident` is a new method, it returns an `Option<Ident>`. It's used with `unwrap` in a few places; sometimes it's hard to tell exactly which item kinds might occur. None of these unwraps fail on the test suite. It's conceivable that some might fail on alternative input. We can deal with those if/when they happen. - In `trait_path` the `find_map`/`if let` is replaced with a loop, and things end up much clearer that way. - `named_span` no longer checks for an empty name; instead the call site now checks for a missing identifier if necessary. - `maybe_inline_local` doesn't need the `glob` argument, it can be computed in-function from the `renamed` argument. - `arbitrary_source_item_ordering::check_mod` had a big `if` statement that was just getting the ident from the item kinds that had one. It could be mostly replaced by a single call to the new `ItemKind::ident` method. - `ItemKind` grows from 56 to 64 bytes, but `Item` stays the same size, and that's what matters, because `ItemKind` only occurs within `Item`.
…=fmease Move `hir::Item::ident` into `hir::ItemKind`. `hir::Item` has an `ident` field. - It's always non-empty for these item kinds: `ExternCrate`, `Static`, `Const`, `Fn`, `Macro`, `Mod`, `TyAlias`, `Enum`, `Struct`, `Union`, Trait`, TraitAalis`. - It's always empty for these item kinds: `ForeignMod`, `GlobalAsm`, `Impl`. - For `Use`, it is non-empty for `UseKind::Single` and empty for `UseKind::{Glob,ListStem}`. All of this is quite non-obvious; the only documentation is a single comment saying "The name might be a dummy name in case of anonymous items". Some sites that handle items check for an empty ident, some don't. This is a very C-like way of doing things, but this is Rust, we have sum types, we can do this properly and never forget to check for the exceptional case and never YOLO possibly empty identifiers (or possibly dummy spans) around and hope that things will work out. This is step towards `kw::Empty` elimination (rust-lang#137978). r? `@fmease`
Clarify "owned data" in E0515.md This clarifies the explanation of why this is not allowed and also what to do instead. Fixes rust-lang#62071 PS There was suggestion of adding a link to the book. I did not yet do that, but if desired that could be added.
…oieni Store test diffs in job summaries and improve analysis formatting This PR stores the test diffs that we already have in the post-merge workflow also into individual job summaries. This makes it easier to compare test (and later also other) diffs per job, which will be especially useful for try jobs, so that we can actually see the test diffs *before* we merge a given PR. As a drive-by, I also made a bunch of cleanups in `citool` and in the formatting of the summary and post-merge analyses. These changes are split into self-contained commits. The analysis can be tested locally with the following command: ```bash $ curl https://ci-artifacts.rust-lang.org/rustc-builds/<current-sha>/metrics-<job-name>.json > metrics.json $ cargo run --manifest-path src/ci/citool/Cargo.toml postprocess-metrics metrics.json --job-name <job-name> --parent <parent-sha> > out.md ``` For example, for [this PR](rust-lang#138523): ```bash $ curl https://ci-artifacts.rust-lang.org/rustc-builds/282865097d138c7f0f7a7566db5b761312dd145c/metrics-aarch64-gnu.json > metrics.json $ cargo run --manifest-path src/ci/citool/Cargo.toml postprocess-metrics metrics.json --job-name aarch64-gnu --parent d9e5539 > out.md ``` Best reviewed commit by commit. r? `@marcoieni` try-job: aarch64-gnu try-job: dist-x86_64-linux
…ieni Only use `DIST_TRY_BUILD` for try jobs that were not selected explicitly Some CI jobs (x64 Linux, ARM64 Linux and x64 MSVC) use the `opt-dist` tool to build an optimized toolchain using PGO and BOLT. When performing a default try build for x64 Linux, in most cases we want to run perf. on that artifact. To reduce the latency of this common use-case, `opt-dist` skips building several components not needed for perf., and it also skips running post-optimization tests, when it detects that the job is executed as a try job (not a merge/auto job). This is useful, but it also means that if you *want* to run the tests, you had to go to `jobs.yml` and manually comment this environment variable, create a WIP commit, do a try build, and then remove the WIP commit, which is annoying (in the similar way that modifying what gets run in try builds was annoying before we had the `try-job` annotations). I thought that we could introduce some additional PR description marker like `try-job-run-tests`, but it's hard to discover that such things exist. Instead, I think that there's a much simpler heuristic for determining whether `DIST_TRY_BUILD` should be used (that I implemented in this PR): - If you do just ``@bors` try`, without any custom try jobs selected, `DIST_TRY_BUILD` will be activated, to finish the build as fast as possible. - If you specify any custom try jobs, you are most likely doing experiments and you want to see if tests pass and everything builds as it should. The `DIST_TRY_BUILD` variable will thus *not* be set in this case. In this way, if you want to run dist tests, you can just add the `try-job: dist-x86_64-linux` line to the PR description, and you don't need to create any WIP commits. r? `@marcoieni`
…e, r=GuillaumeGomez,Urgau Fix ICE: attempted to remap an already remapped filename This commit fixes an internal compiler error (ICE) that occurs when rustdoc attempts to process macros with a remapped filename. The issue arose during macro expansion when the `--remap-path-prefix` option was used. Instead of passing remapped filenames through, which would trigger the "attempted to remap an already remapped filename" panic, we now extract the original local path from remapped filenames before processing them. A test case has been added to verify this behavior. Fixes rust-lang#138520
rustc_target: Add target feature constraints for LoongArch Part of rust-lang#116344 r? `@RalfJung`
…fs, r=lcnr Flatten `if`s in `rustc_codegen_ssa` Best viewed [while ignoring whitespace](https://github.com/rust-lang/rust/pull/138619/files?diff=unified&w=1)
The job Click to see the possible cause of the failure (guessed by this bot)
For more information how to resolve CI failures of this job, visit this link. |
💔 Test failed - checks-actions |
@bors retry |
@bors treeclosed=100 fuchsia problems |
☀️ Test successful - checks-actions |
📌 Perf builds for each rolled up PR:
previous master: 493c38ba37 In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
This is an experimental post-merge analysis report. You can ignore it. Post-merge reportWhat is this?This is an experimental post-merge analysis report that shows differences in Comparing 493c38b (parent) -> 259fdb5 (this PR) Test differencesShow 14 test diffs
Additionally, 12 doctest diffs were found. These are ignored, as they are noisy. Job group index
|
Finished benchmarking commit (259fdb5): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary 1.1%, secondary 2.3%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeResults (primary -0.1%, secondary -0.1%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 775.508s -> 776.409s (0.12%) |
Remove double nesting in post-merge workflow See [this](rust-lang#138630 (comment)) :) Can be tested with: ```bash #!/bin/bash PARENT_COMMIT=493c38ba371929579fe136df26eccd9516347c7a SHA=259fdb521200c9abba547302fc2c826479ef26b2 printf "<details>\n<summary>What is this?</summary>\n" >> output.log printf "This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.\n" >> output.log printf "</details>\n\n" >> output.log cargo run --release post-merge-report ${PARENT_COMMIT} ${SHA} >> output.log ``` I think that it's better to leave the notice in CI, to avoid generating it in citool, which can also be executed locally. r? `@marcoieni`
Rollup merge of rust-lang#138656 - Kobzol:post-merge-unnest, r=marcoieni Remove double nesting in post-merge workflow See [this](rust-lang#138630 (comment)) :) Can be tested with: ```bash #!/bin/bash PARENT_COMMIT=493c38ba371929579fe136df26eccd9516347c7a SHA=259fdb521200c9abba547302fc2c826479ef26b2 printf "<details>\n<summary>What is this?</summary>\n" >> output.log printf "This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.\n" >> output.log printf "</details>\n\n" >> output.log cargo run --release post-merge-report ${PARENT_COMMIT} ${SHA} >> output.log ``` I think that it's better to leave the notice in CI, to avoid generating it in citool, which can also be executed locally. r? `@marcoieni`
Remove double nesting in post-merge workflow See [this](rust-lang/rust#138630 (comment)) :) Can be tested with: ```bash #!/bin/bash PARENT_COMMIT=493c38ba371929579fe136df26eccd9516347c7a SHA=259fdb521200c9abba547302fc2c826479ef26b2 printf "<details>\n<summary>What is this?</summary>\n" >> output.log printf "This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.\n" >> output.log printf "</details>\n\n" >> output.log cargo run --release post-merge-report ${PARENT_COMMIT} ${SHA} >> output.log ``` I think that it's better to leave the notice in CI, to avoid generating it in citool, which can also be executed locally. r? `@marcoieni`
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#138384 (Move `hir::Item::ident` into `hir::ItemKind`.) - rust-lang#138508 (Clarify "owned data" in E0515.md) - rust-lang#138531 (Store test diffs in job summaries and improve analysis formatting) - rust-lang#138533 (Only use `DIST_TRY_BUILD` for try jobs that were not selected explicitly) - rust-lang#138556 (Fix ICE: attempted to remap an already remapped filename) - rust-lang#138608 (rustc_target: Add target feature constraints for LoongArch) - rust-lang#138619 (Flatten `if`s in `rustc_codegen_ssa`) r? `@ghost` `@rustbot` modify labels: rollup
Successful merges:
hir::Item::ident
intohir::ItemKind
. #138384 (Movehir::Item::ident
intohir::ItemKind
.)DIST_TRY_BUILD
for try jobs that were not selected explicitly #138533 (Only useDIST_TRY_BUILD
for try jobs that were not selected explicitly)if
s inrustc_codegen_ssa
#138619 (Flattenif
s inrustc_codegen_ssa
)r? @ghost
@rustbot modify labels: rollup
Create a similar rollup