Skip to content
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 8 pull requests #138933

Merged
merged 27 commits into from
Mar 25, 2025
Merged

Rollup of 8 pull requests #138933

merged 27 commits into from
Mar 25, 2025

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

Zoxc and others added 27 commits March 21, 2025 07:37
This commit adds the 5f00::/16 range defined by RFC9602 to those ranges which Ipv6Addr::is_global recognises as a non-global IP. This range is used for Segment Routing (SRv6) SIDs.
This fixes two problems with the autofixes for the `unused_imports`
lint:

- `use std::collections::{HashMap, self as coll};` would suggest, when
  `HashMap` is unused, the incorrect `use std::collections::self as coll;`
  which does not compile.

- `use std::borrow::{self, Cow};` would suggest, when `self` is unused,
  `use std::borrow::{Cow};`, which contains unnecessary brackets.
This error was untested.
This is exactly the kind of case `Ident::dummy()` is for.
Instead of `kw::Empty`. It makes it clearer that this is a name that is
searched for and might not be found.
This way, `None` represents "crate root without a name" instead of
`kw::Empty`. This changes makes it impossible to forget to handle the
exceptional case.
For the the symbols that might not be present, instead of `kw::Empty`.
…odules`.

The existing code produces `Some(kw::Empty)` for these invalid forms:

- a non-name-value, e.g. `#[rustc_allowed_through_unstable_modules]`

- a non-string arg, e.g. `#[rustc_allowed_through_unstable_modules = 3]`

The new code avoids the `kw::Empty` and is a little shorter. It will
produce `None` in those cases, which means E0789 won't be produced if
the `stable` attribute is missing for these invalid forms. This doesn't
matter, because these invalid forms will trigger an "malformed
`rustc_allowed_through_unstable_modules` attribute" anyway.
…uviper

Recognise new IPv6 non-global range from IETF RFC 9602

This PR adds the `5f00::/16` range defined by [IETF RFC 9602](https://datatracker.ietf.org/doc/rfc9602/) to those ranges which `Ipv6Addr::is_global` recognises as a non-global IP. This range is used for Segment Routing (SRv6) SIDs.

See also: https://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml
Unstable tracking issue: rust-lang#27709
cg_llvm: Reduce the visibility of types, modules and using declarations in `rustc_codegen_llvm`.

Final part of rust-lang#135502

Reduces the visibility of types, modules and using declarations in the `rustc_codegen_llvm` to private or `pub(crate)` where possible, and marks unused fields and enum entries with `#[expect(dead_code)]`.

r? Zalathar
…r-errors

privacy: Visit types and traits in impls in type privacy lints

With one exception to avoid false positives.

Fixes the same issue as rust-lang#134176.
…arrowLii

Abort in deadlock handler if we fail to get a query map

Resolving query cycles requires the complete active query map, or it may miss query cycles. We did not check that the map is completely constructed before. If there is some error collecting the map, something has gone wrong already. This adds a check to abort/panic if we fail to construct the complete map.

This can help differentiate errors from the `deadlock detected` case if constructing query map has errors in practice.

An `Option` is not used for `collect_active_jobs` as the panic handler can still make use of a partial map.
coverage: Separate span-extraction from unexpansion

Historically, coverage instrumentation has relied on eagerly “unexpanding” MIR spans back to ancestor spans that have the same context as the function body, and lie within that body. Doing so makes several subsequent operations more straightforward.

In order to support expansion regions, we need to stop doing that, and handle layers of macro-expansion more explicitly. This PR takes a step in that direction, by deferring some of the unexpansion steps, and concentrating them in one place (`spans::extract_refined_covspans`).

Unexpansion still takes place as before, but these changes will make it easier to experiment with expansion-aware coverage instrumentation.
…=jieyouxu

Fix autofix for `self` and `self as …` in `unused_imports` lint

This fixes two problems with the autofixes for the `unused_imports` lint:

- `use std::collections::{HashMap, self as coll};` would suggest, when `HashMap` is unused, the incorrect `use std::collections::self as coll;` which does not compile.
- `use std::borrow::{self, Cow};` would suggest, when `self` is unused, `use std::borrow::{Cow};`, which contains unnecessary brackets.

The first problem was reported in rust-lang/rust-clippy#14450, the second found while fixing the first one.

Fix rust-lang#133750
(thanks to `@richardsamuels` for spotting the duplicate)
…piler-errors

Reduce `kw::Empty` usage, part 3

Remove some more `kw::Empty` uses, in support of rust-lang#137978.

r? `@davidtwco`
…piler-errors

Visitors track whether an assoc item is in a trait impl or an inherent impl

`AssocCtxt::Impl` now contains an `of_trait` field. This allows ast lowering and nameres to not have to track whether we're in a trait impl or an inherent impl.
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 25, 2025
@rustbot rustbot added 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. rollup A PR which is a rollup labels Mar 25, 2025
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Mar 25, 2025

📌 Commit 1107fc7 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 Mar 25, 2025
@bors
Copy link
Collaborator

bors commented Mar 25, 2025

⌛ Testing commit 1107fc7 with merge 43f0014...

@bors
Copy link
Collaborator

bors commented Mar 25, 2025

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing 43f0014 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Mar 25, 2025
@bors bors merged commit 43f0014 into rust-lang:master Mar 25, 2025
7 checks passed
@rustbot rustbot added this to the 1.87.0 milestone Mar 25, 2025
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 40507bd (parent) -> 43f0014 (this PR)

Test differences

Show 80 test diffs
  • [ui] tests/ui/attributes/crate-name-empty.rs (stage 1): [missing] -> pass (J0)
  • [ui] tests/ui/lint/unused/lint-unused-imports-self-single.rs (stage 1): [missing] -> pass (J0)
  • [ui] tests/ui/attributes/crate-name-empty.rs (stage 2): [missing] -> pass (J1)
  • [ui] tests/ui/lint/unused/lint-unused-imports-self-single.rs (stage 2): [missing] -> pass (J1)

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

Job group index

  • J0: x86_64-gnu-llvm-18-3, x86_64-gnu-llvm-19-3
  • J1: aarch64-apple, aarch64-gnu, arm-android, armhf-gnu, dist-i586-gnu-i586-i686-musl, i686-gnu-1, i686-gnu-nopt-1, i686-msvc-1, test-various, x86_64-apple-2, x86_64-gnu, x86_64-gnu-llvm-18-1, x86_64-gnu-llvm-18-2, x86_64-gnu-llvm-19-1, x86_64-gnu-llvm-19-2, x86_64-gnu-nopt, x86_64-gnu-stable, x86_64-mingw-1, x86_64-msvc-1

@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#135745 Recognise new IPv6 non-global range from IETF RFC 9602 c231c38bcf52d8ba32f86e7a9bdb40c7a882759f (link)
#137247 cg_llvm: Reduce the visibility of types, modules and using … 2cf5148f88dc790d65d72bb5cd032e64c2e36cb1 (link)
#138317 privacy: Visit types and traits in impls in type privacy li… 6dffbd48e4651c81624df11c69d5aa53ba1f1e92 (link)
#138581 Abort in deadlock handler if we fail to get a query map 14f2403188c5b1ff53f8efa0a0eacd78166426f9 (link)
#138776 coverage: Separate span-extraction from unexpansion 36dd27674324a9af3a069b557d28bdaa5ad10f16 (link)
#138886 Fix autofix for self and self as … in `unused_imports… 013ec394c426e829b019a1f213ac695150a0586a (link)
#138924 Reduce kw::Empty usage, part 3 d733fd95c4d9f358af0489ab2d71f02683a7583e (link)
#138929 Visitors track whether an assoc item is in a trait impl or … 8673ec9ab87241c14a1be0c93689e0293543cbdb (link)

previous master: 40507bded5

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

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (43f0014): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

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
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.2% [-0.2%, -0.2%] 1
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 2.2%, 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.

mean range count
Regressions ❌
(primary)
2.2% [2.2%, 2.2%] 1
Regressions ❌
(secondary)
2.3% [2.3%, 2.3%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.2% [2.2%, 2.2%] 1

Cycles

Results (primary -2.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.

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

Binary size

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

Bootstrap: 778.257s -> 777.618s (-0.08%)
Artifact size: 365.84 MiB -> 365.81 MiB (-0.01%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) merged-by-bors This PR was explicitly merged by bors. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.