Skip to content

Rollup of 7 pull requests #141396

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 30 commits into from
May 23, 2025
Merged

Rollup of 7 pull requests #141396

merged 30 commits into from
May 23, 2025

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

chenyukang and others added 30 commits February 22, 2025 11:45
Co-authored-by: Esteban Kuber <estebank@users.noreply.github.com>
Co-authored-by: Esteban Kuber <estebank@users.noreply.github.com>
`non_local_bounds` would only find non local bounds that strictly bound a given region,
but it's possible that a local region is equated to 'static when showing a type referencing
a locally bound lifetime, such as `dyn Any + 'a` in the tests added, is well-formed. In
this case we should return 'static.
Name them more consistently, descriptively and appropriately.
Move large error reporting methods into the dedicated error module to
make the happy paths in HIR ty lowering more legible.
IMPORTANT: This leads to a tiny diagnostic regression that will be fixed in the next commit!
Most notably, this preserves the `(..)` of ambiguous RTN paths.
…mpiler-errors

Add ignore value suggestion in closure body

Fixes rust-lang#128561

r? `@estebank`
…ecks, r=lcnr

Finalize repeat expr inference behaviour with inferred repeat counts

I believe this should be the last change of how repeat exprs are handled before it's finished for `generic_arg_infer`. Assuming we don't wind up deciding to replace this all with a new predicate kind :)

 This PR has three actual changes:
 - Always defer the checks to end of typeck even when generic arg infer is not enabled (needs an FCP)
 - Properly handle element exprs that are constants when the repeat count is inferred
 - "Isolate" each repeat expr check so that inference constraints from `Copy` goals dont affect other repeat expr checks resulting in weird order-dependent inference

The commit history and tests should be relatively helpful for understanding this PR's impl.

r? compiler-errors
…ompiler-errors

Handle regions equivalent to 'static in non_local_bounds

`non_local_bounds` would only find non local bounds that strictly bound a given region, but it's possible that a local region is equated to 'static when showing a type referencing a locally bound lifetime, such as `dyn Any + 'a` in the tests added, is well-formed. In this case we should return 'static.

closes rust-lang#122704
closes rust-lang#139004
…r=compiler-errors

HIR ty lowering: Clean up & refactor the lowering of type-relative paths

While rebasing rust-lang#126651 I realized that HIR ty lowering could benefit from some *spring cleaning* now that it's been extended to handle RTN and mGCA paths.

More seriously, similar to my merged PR rust-lang#118668 which unified the handling of all *associated item constraints* (assoc ty, const (ACE) & fn (RTN)), this PR (commit rust-lang@695fcf5) partially[^1] deduplicates the resolution code for all *type-relative paths* (assoc ty, const (mGCA) & fn (RTN)).

**Why**? DRY'ing that part of the code means PR rust-lang#126651 will automatically support RTN paths like `Ty::AssocTy::assoc_fn(..)` and it also implies shared diagnostic code and thus better diagnostics for RTN.

---

The other commits represent cleanups, renamings, moves. More notably, I've renamed path lowering methods to be a lot more descriptive, so ones lowering `QPath(Resolved)` paths now have `_resolved_` in their name and ones lowering `QPath(TypeRelative)` paths now have `_type_relative_` in their name. This should make it stupidly obvious what their purpose is.

---

Best reviewed commit by commit. The changes are close to trivial but the diff might make it look hairier.
r? compiler-errors

[^1]: Sadly, I couldn't unify as much compared to the other PR without introducing unnecessary `unreachable!()`s or rendering the code otherwise illegible with flags and micro helper traits.
…_as_ux_unnecessary_transmutes, r=compiler-errors

use uX::from instead of _ as uX in non - const contexts

changes `transmute(bool) -> integer` to `integer::from` as opposed to `bool as integer`.
rust-lang#136083 (comment)

`@rustbot` label L-unnecessary_transmutes
rustc_on_unimplemented cleanups

Addresses some of the fixmes from rust-lang#139091 and rust-lang#140307.

- switch from `_Self` to `Self` in library
- properly validate that arguments in the `on` filter and the format strings are actually valid

See rust-lang/rustc-dev-guide#2357 for the relevant documentation.
… r=oli-obk

Querify `coroutine_hidden_types`

This is necessary if we ever want to add implied bounds that would be used for higher-ranked coroutine auto trait goals (e.g. future implements `Send`).

Modest perf regression in `hyper` full build which (afaict?) is the only async stress test, so definitely worth it IMO.

r? oli-obk
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) rollup A PR which is a rollup labels May 22, 2025
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented May 22, 2025

📌 Commit 8c25082 has been approved by matthiaskrgr

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 22, 2025
@bors
Copy link
Collaborator

bors commented May 22, 2025

⌛ Testing commit 8c25082 with merge 912981a...

@bors
Copy link
Collaborator

bors commented May 23, 2025

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing 912981a to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 23, 2025
@bors bors merged commit 912981a into rust-lang:master May 23, 2025
7 checks passed
@rustbot rustbot added this to the 1.89.0 milestone May 23, 2025
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#135562 Add ignore value suggestion in closure body 10d74e6d1252486eb228cafd8c580b80e99d779b (link)
#139635 Finalize repeat expr inference behaviour with inferred repe… 330a86077c1bb6485c54e7e8abf84b55e6b13873 (link)
#139668 Handle regions equivalent to 'static in non_local_bounds ab89094d3594e32b2380f4037b23b8d2b10ce701 (link)
#140218 HIR ty lowering: Clean up & refactor the lowering of type-r… 320ae9cfd5f5c048d2e16ebcd990f38b6dd45065 (link)
#140435 use uX::from instead of _ as uX in non - const contexts 11a83eea63a3d5004b3287934e987c5be84fb997 (link)
#141130 rustc_on_unimplemented cleanups 26adcde806a283110399443c39acbc66ca5d3be2 (link)
#141286 Querify coroutine_hidden_types 2a3e471bac676ea68e3eb40fa8fa4ed76912d70a (link)

previous master: 2eef47813f

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

Copy link

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 2eef478 (parent) -> 912981a (this PR)

Test differences

Show 232 test diffs

Stage 1

  • [crashes] tests/crashes/122704.rs: pass -> [missing] (J0)
  • [ui] tests/ui/borrowck/unconstrained-closure-lifetime-generic.rs: [missing] -> pass (J0)
  • [ui] tests/ui/borrowck/unconstrained-closure-lifetime-trait-object.rs: [missing] -> pass (J0)
  • [ui] tests/ui/repeat-expr/copy-check-const-element-uninferred-count.rs: [missing] -> pass (J0)
  • [ui] tests/ui/repeat-expr/copy-check-inference-side-effects.rs: [missing] -> pass (J0)
  • [ui] tests/ui/repeat-expr/copy-inference-side-effects-are-lazy.rs: [missing] -> pass (J0)
  • [ui] tests/ui/repeat-expr/copy-inference-side-effects-are-lazy.rs#current: pass -> [missing] (J0)
  • [ui] tests/ui/repeat-expr/copy-inference-side-effects-are-lazy.rs#gai: pass -> [missing] (J0)
  • [ui] tests/ui/typeck/closure-ty-mismatch-issue-128561.rs: [missing] -> pass (J0)
  • error_reporting::traits::on_unimplemented_format::errors::verify_trait_selection_ignored_diagnostic_option_8: pass -> [missing] (J1)
  • errors::verify_trait_selection_rustc_on_unimplemented_empty_on_clause_10: pass -> [missing] (J1)
  • errors::verify_trait_selection_rustc_on_unimplemented_empty_on_clause_9: [missing] -> pass (J1)
  • errors::verify_trait_selection_rustc_on_unimplemented_expected_identifier_12: [missing] -> pass (J1)
  • errors::verify_trait_selection_rustc_on_unimplemented_expected_identifier_13: pass -> [missing] (J1)
  • errors::verify_trait_selection_rustc_on_unimplemented_expected_one_predicate_in_not_10: [missing] -> pass (J1)
  • errors::verify_trait_selection_rustc_on_unimplemented_expected_one_predicate_in_not_11: pass -> [missing] (J1)
  • errors::verify_trait_selection_rustc_on_unimplemented_invalid_flag_14: [missing] -> pass (J1)
  • errors::verify_trait_selection_rustc_on_unimplemented_invalid_flag_15: pass -> [missing] (J1)
  • errors::verify_trait_selection_rustc_on_unimplemented_invalid_name_15: [missing] -> pass (J1)
  • errors::verify_trait_selection_rustc_on_unimplemented_invalid_predicate_13: [missing] -> pass (J1)
  • errors::verify_trait_selection_rustc_on_unimplemented_invalid_predicate_14: pass -> [missing] (J1)
  • errors::verify_trait_selection_rustc_on_unimplemented_unsupported_literal_in_on_11: [missing] -> pass (J1)
  • errors::verify_trait_selection_rustc_on_unimplemented_unsupported_literal_in_on_12: pass -> [missing] (J1)
  • errors::verify_trait_selection_unable_to_construct_constant_value_8: [missing] -> pass (J1)
  • errors::verify_trait_selection_unable_to_construct_constant_value_9: pass -> [missing] (J1)
  • transitive_relation::tests::minimal_scc_representative_1: [missing] -> pass (J1)
  • transitive_relation::tests::minimal_scc_representative_2: [missing] -> pass (J1)

Stage 2

  • [ui] tests/ui/borrowck/unconstrained-closure-lifetime-generic.rs: [missing] -> pass (J2)
  • [ui] tests/ui/borrowck/unconstrained-closure-lifetime-trait-object.rs: [missing] -> pass (J2)
  • [ui] tests/ui/repeat-expr/copy-check-const-element-uninferred-count.rs: [missing] -> pass (J2)
  • [ui] tests/ui/repeat-expr/copy-check-inference-side-effects.rs: [missing] -> pass (J2)
  • [ui] tests/ui/repeat-expr/copy-inference-side-effects-are-lazy.rs: [missing] -> pass (J2)
  • [ui] tests/ui/repeat-expr/copy-inference-side-effects-are-lazy.rs#current: pass -> [missing] (J2)
  • [ui] tests/ui/repeat-expr/copy-inference-side-effects-are-lazy.rs#gai: pass -> [missing] (J2)
  • [ui] tests/ui/typeck/closure-ty-mismatch-issue-128561.rs: [missing] -> pass (J2)
  • [crashes] tests/crashes/122704.rs: pass -> [missing] (J3)

Additionally, 196 doctest diffs were found. These are ignored, as they are noisy.

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 912981a9eab199a6429d3c65a58f1b80487620ea --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. dist-apple-various: 7895.0s -> 6436.2s (-18.5%)
  2. x86_64-apple-1: 8445.5s -> 7181.0s (-15.0%)
  3. dist-x86_64-apple: 9759.0s -> 8690.3s (-11.0%)
  4. dist-various-2: 3161.4s -> 3494.3s (10.5%)
  5. aarch64-apple: 4513.8s -> 4210.7s (-6.7%)
  6. x86_64-gnu-aux: 6075.5s -> 6405.6s (5.4%)
  7. dist-i586-gnu-i586-i686-musl: 5494.2s -> 5229.2s (-4.8%)
  8. x86_64-gnu: 6888.9s -> 6558.3s (-4.8%)
  9. dist-ohos-armv7: 4446.4s -> 4235.6s (-4.7%)
  10. x86_64-msvc-1: 8457.1s -> 8117.5s (-4.0%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (912981a): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

This 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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.2% [0.1%, 0.2%] 2
Improvements ✅
(primary)
-0.2% [-0.2%, -0.2%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.2% [-0.2%, -0.2%] 1

Max RSS (memory usage)

Results (primary 1.7%, secondary 0.2%)

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.

mean range count
Regressions ❌
(primary)
1.7% [0.7%, 2.7%] 2
Regressions ❌
(secondary)
3.4% [3.4%, 3.4%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.9% [-2.9%, -2.9%] 1
All ❌✅ (primary) 1.7% [0.7%, 2.7%] 2

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 776.347s -> 777.508s (0.15%)
Artifact size: 365.46 MiB -> 365.50 MiB (0.01%)

@rustbot rustbot added the perf-regression Performance regression. label May 23, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.