Skip to content

Rollup of 8 pull requests#159336

Merged
rust-bors[bot] merged 29 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-A47hpCX
Jul 15, 2026
Merged

Rollup of 8 pull requests#159336
rust-bors[bot] merged 29 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-A47hpCX

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Contributor

Successful merges:

Failed merges:

r? @ghost

Create a similar rollup

theemathas and others added 29 commits June 23, 2026 17:45
This better matches how the argument is actually used.
See `rustc_hir::intravisit::{walk_expr,walk_pat_expr}`.
Fixes rust-lang#158295

The `overflowing_literal` lint is, I believe, supposed to consider the
literal and not the surrounding context when deciding whether to lint.
This is in contrast to the `arithmetic_overflow` lint, which only
considers code that executes at run time, which excludes the negation
inside a literal.

According to [the reference](https://doc.rust-lang.org/1.96.0/reference/expressions/operator-expr.html#r-expr.operator.int-overflow.unary-neg),
a negation in front of an integer does not result in an overflow.
I think of this as: a negation, and only one negation, in front of
an integer, is "part of" the integer. Therefore,
the `overflowing_literal` lint should consider that when linting.
It should not consider the second or third negation.

Therefore, this commit changes `overflowing_literals` so that it only
lints on `128_i8` when there is no preceding negation at all. This is
in contrast to the previous behavior, which lints on `128_i8` preceded
by an even number of negations.
The `semicolon_in_expressions_from_macros` lint previously suppressed
warnings about non-local macros. This masks a lint that will
subsequently become a hard error.

Stop suppressing it, dropping the `is_local` flag and check.

Fix the test for this case to now expect the error. Drop a separate test
that depended on the lack of error (and that specifically notes it
should be dropped once the lint becomes a hard error).
Signed-off-by: Amirhossein Akhlaghpour <m9.akhlaghpoor@gmail.com>
The macro is used in expressions, but the arm for eliminating a trailing
comma introduces a semicolon.
Co-authored-by: Cameron Steffen <cam.steffen94@gmail.com>
this used an async closure with the default 2015 edition, so it never
did anything useful. fix it to the original test case posted in the
issue.
Document the built-in `cold` and `track_caller` attributes in the standard
library using the `#[doc(attribute = "...")]` mechanism, following the
existing `must_use` and `inline` attribute documentation.
There needs to be spaces around the dash, otherwise it doesn't work as a
range (which matters now that LLVM trunk is 24).
Rename ModDefId to ModId and use more

Addresses some FIXMEs.

The `ModDefId` was used pretty sparingly, and honestly I wondered if it should exist at all. After making these changes, I think the type is worth it. Most notably it is now used in `Visibility::Restricted`.

I first renamed `ModDefId` to `ModId` since I think the former is over-specific, and also this is more in line with `BodyId` or `OwnerId`.

I'll wait for initial feedback before fixing rustdoc/clippy.
semicolon_in_expressions_from_macros: Lint on non-local macros too

The `semicolon_in_expressions_from_macros` lint previously suppressed
warnings about non-local macros. This masks a lint that will
subsequently become a hard error.

Stop suppressing it, dropping the `is_local` flag and check.

Fix the test for this case to now expect the error. Drop a separate test
that depended on the lack of error (and that specifically notes it
should be dropped once the lint becomes a hard error).
…kang

Implement `bool::toggle`

This implements `bool::toggle` as originally proposed and accepted in rust-lang/libs-team#820.
Tracking issue: rust-lang#159298
Fix `overflowing_literals` lint with repeated negation

Fixes rust-lang#158295

This PR consists of: two commits with non-functional cleanups, a commit that adds a test, and a commit that actually changes the behavior. The following description concerns the changed behavior. See the test changed in the fourth commit for code demonstrating the change in behavior.

---

The `overflowing_literal` lint is, I believe, supposed to consider the literal and not the surrounding context when deciding whether to lint. This is in contrast to the `arithmetic_overflow` lint, which only considers code that executes at run time, which excludes the negation inside a literal.

According to [the reference](https://doc.rust-lang.org/1.96.0/reference/expressions/operator-expr.html#r-expr.operator.int-overflow.unary-neg), a negation in front of an integer does not result in an overflow. I think of this as: a negation, and only one negation, in front of an integer, is "part of" the integer. Therefore, the `overflowing_literal` lint should consider that when linting. It should not consider the second or third negation.

Therefore, this PR changes `overflowing_literals` so that it only lints on `128_i8` when there is no preceding negation at all. This is in contrast to the previous behavior, which lints on `128_i8` preceded by an even number of negations.
…-attributes, r=GuillaumeGomez

Add documentation for the `cold` and `track_caller` attributes

Adds `cold` and `track_caller`, the two code generation attributes left from my claim on the tracking issue.

Both stay guide-level, with one runnable example each. For `track_caller` I used a small assert-style helper, since the attribute mainly affects which line a panic points at. `inline` is already up in rust-lang#158348.

Part of rust-lang#157604

r? @GuillaumeGomez

Tested with `./x test library/std --doc --test-args attribute_docs`.
…h-unreachable, r=mejrs

Add codegen test for remainder match

Closes rust-lang#93514
…thercote

fix some edition annotations in UI tests

- 155202 used an async closure with the default 2015 edition, so it never
tested anything useful
- tait-normalize is already known to crash with edition 2021 (rust-lang#119786)
- use-self-at-end legitimately has different behavior in 2021 edition
…mati865

Fix ignore-llvm-version directive in codegen-llvm/array-equality.rs

There needs to be spaces around the dash, otherwise it doesn't work as a range (which matters now that LLVM trunk is 24).
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Jul 15, 2026
@rust-bors rust-bors Bot 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 Jul 15, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jul 15, 2026
Rollup of 8 pull requests


try-job: dist-various-1
try-job: test-various
try-job: x86_64-gnu-aux
try-job: x86_64-gnu-llvm-21-3
try-job: x86_64-msvc-1
try-job: aarch64-apple
try-job: x86_64-mingw-1
try-job: i686-msvc-*
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jul 15, 2026
…uwer

Rollup of 8 pull requests

Successful merges:

 - #159197 (Rename ModDefId to ModId and use more)
 - #159222 (semicolon_in_expressions_from_macros: Lint on non-local macros too)
 - #159296 (Implement `bool::toggle`)
 - #158302 (Fix `overflowing_literals` lint with repeated negation)
 - #158484 (Add documentation for the `cold` and `track_caller` attributes)
 - #159239 (Add codegen test for remainder match)
 - #159330 (fix some edition annotations in UI tests)
 - #159331 (Fix ignore-llvm-version directive in codegen-llvm/array-equality.rs)

Failed merges:

 - #158962 (Add `proc_macro` attribute documentation)
@JonathanBrouwer

Copy link
Copy Markdown
Contributor Author

@bors yield

@rust-bors

rust-bors Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Auto build was cancelled. Cancelled workflows:

The next pull request likely to be tested is #159336.

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jul 15, 2026
…uwer

Rollup of 8 pull requests

Successful merges:

 - #159197 (Rename ModDefId to ModId and use more)
 - #159222 (semicolon_in_expressions_from_macros: Lint on non-local macros too)
 - #159296 (Implement `bool::toggle`)
 - #158302 (Fix `overflowing_literals` lint with repeated negation)
 - #158484 (Add documentation for the `cold` and `track_caller` attributes)
 - #159239 (Add codegen test for remainder match)
 - #159330 (fix some edition annotations in UI tests)
 - #159331 (Fix ignore-llvm-version directive in codegen-llvm/array-equality.rs)

Failed merges:

 - #158962 (Add `proc_macro` attribute documentation)
@JonathanBrouwer

Copy link
Copy Markdown
Contributor Author

@bors yield

@rust-bors

rust-bors Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Auto build was cancelled. Cancelled workflows:

The next pull request likely to be tested is #159314.

@rust-bors

This comment has been minimized.

@rust-bors

rust-bors Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 378875b (378875b1930a6fd35edb2990b40219c8e440f4d3)
Base parent: df1ae0f (df1ae0f7dd168513de2d89beb2cb7a95d4fdc118)

@rust-bors rust-bors Bot added merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 15, 2026
@rust-bors

rust-bors Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: JonathanBrouwer
Duration: 3h 56m 13s
Pushing 2118366 to main...

@rust-timer

Copy link
Copy Markdown
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#159197 Rename ModDefId to ModId and use more e61d787b9d268cdea27600983a2b40c33ac41511 (link)
#159222 semicolon_in_expressions_from_macros: Lint on non-local mac… 1d2ade17b31bdbf8a236b6c497ab5fd8c37c17ec (link)
#159296 Implement bool::toggle e4013155d8537f47c2eaef57a212326e6c937f9c (link)
#158302 Fix overflowing_literals lint with repeated negation 7657e59795dde348bcd0408743d0da1d77e9b748 (link)
#158484 Add documentation for the cold and track_caller attribu… bfdd45b6dd594658a5b7827ed88f632c928f42dd (link)
#159239 Add codegen test for remainder match 3f7cc2c1eb36da7732f9ee7dbd4533d3d2c8592d (link)
#159330 fix some edition annotations in UI tests ad5dd71687daec4f923d5d5f0d2a09d9af5e909d (link)
#159331 Fix ignore-llvm-version directive in codegen-llvm/array-equ… 7c3308915b1a306d2140f533d423ca4511adb554 (link)

previous master: df1ae0f7dd

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

@github-actions

Copy link
Copy Markdown
Contributor
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 df1ae0f (parent) -> 2118366 (this PR)

Test differences

Show 102 test diffs

Stage 1

  • [ui (polonius)] tests/ui/lint/lint-type-overflow3.rs: [missing] -> pass (J1)
  • [ui (polonius)] tests/ui/macros/semicolon-in-exprs.rs: pass -> [missing] (J1)
  • [ui (polonius)] tests/ui/use/use-self-at-end.rs#e2021: [missing] -> pass (J1)
  • [ui] tests/ui/lint/lint-type-overflow3.rs: [missing] -> pass (J3)
  • [ui] tests/ui/macros/semicolon-in-exprs.rs: pass -> [missing] (J3)
  • [ui] tests/ui/use/use-self-at-end.rs#e2021: [missing] -> pass (J3)
  • [codegen] tests/codegen-llvm/issues/rem-match-unreachable.rs: [missing] -> ignore (only executed when the pointer width is 64bit) (J4)
  • [codegen] tests/codegen-llvm/issues/rem-match-unreachable.rs: [missing] -> pass (J5)

Stage 2

  • [codegen] tests/codegen-llvm/issues/rem-match-unreachable.rs: [missing] -> ignore (only executed when the pointer width is 64bit) (J0)
  • [ui] tests/ui/lint/lint-type-overflow3.rs: [missing] -> pass (J2)
  • [ui] tests/ui/macros/semicolon-in-exprs.rs: pass -> [missing] (J2)
  • [ui] tests/ui/use/use-self-at-end.rs#e2021: [missing] -> pass (J2)
  • [codegen] tests/codegen-llvm/issues/rem-match-unreachable.rs: [missing] -> pass (J6)

Additionally, 89 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 2118366bbfe2e57ec0e8417ea270833e9f013640 --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. i686-gnu-nopt-1: 1h 28m -> 2h 17m (+55.7%)
  2. aarch64-apple: 2h 32m -> 3h 43m (+46.9%)
  3. x86_64-gnu-aux: 2h 41m -> 1h 45m (-34.6%)
  4. i686-gnu-nopt-2: 2h 13m -> 1h 30m (-32.3%)
  5. armhf-gnu: 1h 12m -> 1h 33m (+27.8%)
  6. dist-armv7-linux: 1h 12m -> 1h 32m (+27.3%)
  7. dist-aarch64-apple: 1h 47m -> 2h 15m (+25.7%)
  8. dist-loongarch64-linux: 1h 47m -> 1h 21m (-24.5%)
  9. x86_64-msvc-ext2: 1h 49m -> 1h 24m (-22.8%)
  10. dist-various-1: 1h 1m -> 1h 14m (+20.6%)
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
Copy Markdown
Collaborator

Finished benchmarking commit (2118366): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This perf run didn't have relevant results for this metric.

Max RSS (memory usage)

Results (secondary 1.9%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

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

Cycles

Results (primary 2.2%, secondary 2.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

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

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 487.651s -> 490.55s (0.59%)
Artifact size: 389.37 MiB -> 390.05 MiB (0.18%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-rustdoc-json Area: Rustdoc JSON backend merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup T-clippy Relevant to the Clippy team. 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.