Skip to content

Rollup of 9 pull requests #140520

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

Merged
merged 34 commits into from
Apr 30, 2025
Merged

Rollup of 9 pull requests #140520

merged 34 commits into from
Apr 30, 2025

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

m-ou-se and others added 30 commits April 10, 2025 11:49
While LLVM is rather permissive in this regards, some other codegen
backends demand that once you declare a function for definition you
actually define contents of the function, which doesn't happen for naked
functions as we actually generate assembly for them.
This allows it to be reused by codegen backends that don't use cg_ssa
like cg_clif.
The previous implementation was inconsistent about transitions that
apply for an init byte. For example, when answering a query, an init
byte could use corresponding init transition. Init byte could also use
uninit transition, but only when the corresponding init transition was
absent. This behaviour was incompatible with DFA union construction.

Define an uninit transition to match an uninit byte only and update
implementation accordingly. To describe that `Tree::uninit` is valid
for any value, build an automaton that accepts any byte value.

Additionally, represent byte ranges uniformly as a pair of integers to
avoid special case for uninit byte.
It's no longer necessary after the removal of nonterminal tokens in rust-lang#124141.
add suggestion on how to add a panic breakpoint

Co-authored-by: Pat Pannuto <pat.pannuto@gmail.com>
delete no_mangle from ui/panic-handler/panic-handler-wrong-location test

issue an error for the usage of #[no_mangle] on internal language items

delete the comments

add newline

rephrase note

Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com>
update error not to leak implementation details

delete no_mangle_span

Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com>
delete commented code
This commit does the following:
 - Replaces use of rustc_type_ir by rustc_middle
 - Removes the rustc_type_ir dependency
 - The DelayedSet type is exposed by rustc_middle so everything can be
   accessed through rustc_middle in a coherent manner.
…esleywiser

Share the naked asm impl between cg_ssa and cg_clif

This was introduced in rust-lang#128004.
…ratt

Don't allow flattened format_args in const.

Fixes rust-lang#139136

Fixes rust-lang#139621

We allow `format_args!("a")` in const, but don't allow any format_args with arguments in const, such as `format_args!("{}", arg)`.

However, we accidentally allow `format_args!("hello {}", "world")` in const, as it gets flattened to `format_args!("hello world")`.

This also applies to panic in const.

This wasn't supposed to happen. I added protection against this in the format args flattening code, ~~but I accidentally marked a function as const that shouldn't have been const~~ but this was removed in rust-lang#135139.

This is a breaking change. The crater found no breakage, however.

This breaks things like:

```rust
const _: () = if false { panic!("a {}", "a") };
```

and

```rust
const F: std::fmt::Arguments<'static> = format_args!("a {}", "a");
```
…enkov

Check bare function idents for non snake-case name

This PR adds the check required to lint on bare function idents for non snake-case name.

Reported at rust-lang#140089.
cc `@theemathas`
…_language_items, r=bjorn3

Issue an error when using `no_mangle` on language items

This pull requests adds the code to issue an error or a warning when using `no_mangle` on language items. This should detail why the `undefined symbol` error is issued for the code described in rust-lang#139923.

The pull request adds two ui tests, one testing the error and the other one the warning.

I would love some feedback here, as I am not sure that the error and warning are issues using the right API.
ast: Remove token visiting from AST visitor

It's no longer necessary after the removal of nonterminal tokens in rust-lang#124141.

r? `@nnethercote`
…=oli-obk

Misc tweaks to HIR typeck (mostly w.r.t. checking calls)

Just some cleanups.

r? oli-obk
…renn

transmutability: ensure_sufficient_stack when answering query

Based on rust-lang#140380.

Fixes rust-lang#118860. The compile time was addressed earlier, this merely addresses stack overflow part of the issue.

r? `@jswrenn` `@joshlf`
…lcnr

Replace use of rustc_type_ir by rustc_middle

cc rust-lang#138449

I want to help on this issue. I have replaced all the rustc_type_ir uses by the equivalent type in rustc_middle.
DelayedSet is also re-exposed by rustc_middle.
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) 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 Apr 30, 2025
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Apr 30, 2025

📌 Commit 1e440ae 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 Apr 30, 2025
@bors
Copy link
Collaborator

bors commented Apr 30, 2025

⌛ Testing commit 1e440ae with merge 251cda5...

@bors
Copy link
Collaborator

bors commented Apr 30, 2025

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing 251cda5 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 30, 2025
@bors bors merged commit 251cda5 into rust-lang:master Apr 30, 2025
7 checks passed
@rustbot rustbot added this to the 1.88.0 milestone Apr 30, 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 7188f45 (parent) -> 251cda5 (this PR)

Test differences

Show 38 test diffs

Stage 1

  • parser::mut_visit::tests::ident_transformation: pass -> [missing] (J1)
  • parser::mut_visit::tests::ident_transformation_in_defs: pass -> [missing] (J1)
  • [ui] tests/ui/codegen/no-mangle-on-internal-lang-items.rs: [missing] -> pass (J2)
  • [ui] tests/ui/codegen/no-mangle-on-panic-handler.rs: [missing] -> pass (J2)
  • [ui] tests/ui/transmutability/unions/extension.rs: [missing] -> pass (J2)
  • [ui] tests/ui/transmutability/unions/init_as_uninit.rs: [missing] -> pass (J2)

Stage 2

  • [ui] tests/ui/codegen/no-mangle-on-internal-lang-items.rs: [missing] -> pass (J0)
  • [ui] tests/ui/codegen/no-mangle-on-panic-handler.rs: [missing] -> pass (J0)
  • [ui] tests/ui/transmutability/unions/extension.rs: [missing] -> pass (J0)
  • [ui] tests/ui/transmutability/unions/init_as_uninit.rs: [missing] -> pass (J0)

Additionally, 28 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 251cda5e1f0057eb04fd9fc1653f2f1e010e8f97 --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: 6621.2s -> 8938.2s (35.0%)
  2. x86_64-apple-1: 10742.5s -> 7723.7s (-28.1%)
  3. x86_64-msvc-ext3: 6990.8s -> 7926.0s (13.4%)
  4. dist-s390x-linux: 6226.5s -> 5511.0s (-11.5%)
  5. dist-aarch64-apple: 5615.2s -> 4990.5s (-11.1%)
  6. x86_64-msvc-ext1: 7293.7s -> 7975.2s (9.3%)
  7. x86_64-apple-2: 5498.7s -> 5072.7s (-7.7%)
  8. dist-i686-msvc: 6691.3s -> 7130.5s (6.6%)
  9. x86_64-gnu-llvm-20-2: 6324.0s -> 5956.4s (-5.8%)
  10. dist-aarch64-msvc: 8657.6s -> 9076.7s (4.8%)
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

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#134232 Share the naked asm impl between cg_ssa and cg_clif c59d69926b23a722d41c0dd1d0c0c303298c51aa (link)
#139624 Don't allow flattened format_args in const. 113148386ef90763e5573e12ef9707ac2d13fc64 (link)
#140090 Check bare function idents for non snake-case name d124476a2f6940e664dc8264d49ee81c66feebb4 (link)
#140203 Issue an error when using no_mangle on language items ec8b790959148cee6180a92bdb19ce1be583c3cc (link)
#140450 ast: Remove token visiting from AST visitor 40c9ff97d0da4a653da0a1099362fab1dde838ef (link)
#140498 Misc tweaks to HIR typeck (mostly w.r.t. checking calls) 31bfdde0ebee612789d02c7114da3b55758e5ddb (link)
#140504 transmutability: ensure_sufficient_stack when answering que… 9ffea5b2f883c7c6731b9206c41cf44ab6d62edf (link)
#140506 unstable-book: fix capitalization 7c503db659fc1355ca3f6e264b1561a5b1fed191 (link)
#140516 Replace use of rustc_type_ir by rustc_middle 39357736f1fb5e1881a27f0ce25fa688d97cd8b3 (link)

previous master: 7188f45311

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 (251cda5): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

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

Max RSS (memory usage)

Results (primary 0.3%, secondary 3.6%)

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.9% [0.4%, 3.9%] 20
Regressions ❌
(secondary)
3.6% [3.3%, 3.9%] 2
Improvements ✅
(primary)
-1.4% [-2.9%, -0.4%] 8
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.3% [-2.9%, 3.9%] 28

Cycles

Results (primary -1.0%, secondary -2.6%)

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.6% [0.4%, 0.7%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.1% [-3.0%, -0.5%] 29
Improvements ✅
(secondary)
-2.6% [-2.7%, -2.4%] 2
All ❌✅ (primary) -1.0% [-3.0%, 0.7%] 31

Binary size

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

Bootstrap: 770.688s -> 769.968s (-0.09%)
Artifact size: 365.58 MiB -> 365.58 MiB (-0.00%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) 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. 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.