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 13 pull requests #133500

Merged
merged 27 commits into from
Nov 26, 2024
Merged

Rollup of 13 pull requests #133500

merged 27 commits into from
Nov 26, 2024

Conversation

GuillaumeGomez
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

RalfJung and others added 27 commits November 24, 2024 09:16
The test was checking for two `ptr` arguments by matching commas (or
non-commas), however after
llvm/llvm-project#117104 LLVM adds an
`initializes((0, 16))` attribute, which includes a comma.

So instead, we make the test check for two LLVM values, i.e. something
prefixed by %.

(See also https://crbug.com/380707238)
Foreword
========

Let us begin the journey to rediscover what the `//@ pretty-expanded`
directive does, brave traveller --

    "My good friend, [..] when I wrote that passage, God and I knew what
    it meant. It is possible that God knows it still; but as for me, I
    have totally forgotten."

                                 -- Johann Paul Friedrich Richter, 1826

We must retrace the steps of those before us, for history shall guide us
in the present and inform us of the future.

The Past
========

Originally there was some effort to introduce more test coverage for `-Z
unpretty=expanded` (in 2015 this was called `--pretty=expanded`). In
[Make it an error to not declare used features rust-lang#23598][pr-23598], there
was a flip from `//@ no-pretty-expanded` (opt-out of `-Z
unpretty=expanded` test) to `//@ pretty-expanded` (opt-in to `-Z
unpretty=expanded` test). This was needed because back then the
dedicated `tests/pretty` ("pretty") test suite did not existed, and the
pretty tests were grouped together under `run-pass` tests (I believe
`ui` test suite didn't exist back then either). Unfortunately, in this
process the replacement `//@ pretty-expanded` directives contained a
`FIXME rust-lang#23616` linking to [There are very few tests for `-Z unpretty`
expansion rust-lang#23616][issue-23616]. But this was arguably backwards and
somewhat misleading, as noted in
<rust-lang#23616 (comment)>:

    The attribute is off by default and things just work if you don't
    test it, people have not been adding the `pretty-expanded`
    annotation to new tests even if it would work.

Which basically renders this useless.

The Present
===========

As of Nov 2024, we have a dedicated `pretty` test suite, and some time
over the years the split between `run-pass` into `ui` and `pretty` test
suites caused all of the `//@ pretty-expanded` in `ui` tests to do
absolutely nothing -- the compiletest logic for `pretty-expanded` only
triggered in the *pretty* test suite, but none of the pretty tests use
it. Oops.

The Future
==========

Nobody remembers this, nobody uses this, it's misleading in ui tests.
Let's get rid of this directive altogether.

[pr-23598]: rust-lang#23598
[issue-23616]: rust-lang#23616
Done with

```bash
sd '//@ pretty-expanded.*\n' '' tests/ui/**/*.rs
```

and

```
sd '//@pretty-expanded.*\n' '' tests/ui/**/*.rs
```
The linker has been randomly crashing on `x86_64-mingw` that's causing
spurious failures. Disable this test on Windows for now.
…workingjubilee

the emscripten OS no longer exists on non-wasm targets

rust-lang#117338 removed our asmjs targets, which AFAIK means that emscripten only exists on wasm targets. However at least one place in the code still checked "is wasm or is emscripten". Let's fix that.

Cc ```@workingjubilee```
…example, r=Amanieu

Added a doc test for std::path::strip_prefix

I was about 90% sure `Path::new("/test/haha/foo.txt").strip_prefix("/te")` would return an Err, but I couldn't find an example to confirm this behaviour.

This should be an easy merge :)
…WaffleLapkin

Tweak parameter mismatch explanation to not say `{unknown}`

* Tweak parameter mismatch explanation not to call parameters with no identifier `{unknown}`
* Say "both" when there are two parameters
* Backtick a type parameter name for consistency
…iler-errors

Remove dead code stemming from the old effects desugaring (II)

Follow-up to rust-lang#132374.
r? project-const-traits
Update test expectations to accept LLVM 'initializes' attribute

The test was checking for two `ptr` arguments by matching commas (or non-commas), however after
llvm/llvm-project#117104 LLVM adds an `initializes((0, 16))` attribute, which includes a comma.

So instead, we make the test check for two LLVM values, i.e. something prefixed by %.

(See also https://crbug.com/380707238)
…ding, r=jieyouxu

Use ReadCache for archive reading in bootstrap

Address expensive archive reading in bootstrap. This fixes rust-lang#133268

Enable the `std` feature of `object` to use `ReadCache` instead of reading the entire archive file into memory to check for headers. This takes minimal extra time to compile compared to introducing other expensive dependencies to `bootstrap`.

r? jieyouxu
std::thread: avoid leading whitespace in some panic messages

This:
```
        panic!(
            "use of std::thread::current() is not possible after the thread's
         local data has been destroyed"
        )
```
will print a newline followed by a bunch of spaces, since the entire string literal is interpreted literally.

I think the intention was to print the message without the newline and the spaces, so let's add some `\` to make that happen.

r? ``@joboet``
tests: Add recursive associated type bound regression tests

Add regression tests for rust-lang#129541 as requested in rust-lang#129541 (comment).

Closes rust-lang#129541

r? ``@lcnr``
Cleanup: delete `//@ pretty-expanded` directive

This PR removes the `//@ pretty-expanded` directive support in compiletest and removes its usage inside ui tests because it does not actually do anything, and its existence is itself misleading. This PR is split into two commits:

1. The first commit just drops `pretty-expanded` directive support in compiletest.
2. The second commit is created by `sd '//@ pretty-expanded.*\n' '' tests/ui/**/*.rs`[^1], reblessing, and slightly adjusting some leading whitespace in a few tests.

We can tell this is fully removed because compiletest doesn't complain about unknown directive when running the `ui` test suite.

cc rust-lang#23616

### History

Originally, there was some effort to introduce more test coverage for `-Z unpretty=expanded` (in 2015 this was called `--pretty=expanded`). In [Make it an error to not declare used features rust-lang#23598][pr-23598], there was a flip from `//@ no-pretty-expanded` (opt-out of `-Z
unpretty=expanded` test) to `//@ pretty-expanded` (opt-in to `-Z unpretty=expanded` test). This was needed because back then the dedicated `tests/pretty` ("pretty") test suite did not existed, and the pretty tests were grouped together under `run-pass` tests (I believe the `ui` test suite didn't exist back then either). Unfortunately, in this process the replacement `//@ pretty-expanded` directives contained a `FIXME rust-lang#23616` linking to [There are very few tests for `-Z unpretty` expansion rust-lang#23616][issue-23616]. But this was arguably backwards and somewhat misleading, as noted in [rust-lang#23616](rust-lang#23616 (comment)):

    The attribute is off by default and things just work if you don't
    test it, people have not been adding the `pretty-expanded`
    annotation to new tests even if it would work.

Which basically renders this useless.

### Current status

As of Nov 2024, we have a dedicated `pretty` test suite, and some time over the years the split between `run-pass` into `ui` and `pretty` test suites caused all the `//@ pretty-expanded` in `ui` tests to do absolutely nothing: the compiletest logic for `pretty-expanded` only triggers in the *pretty* test suite, but none of the pretty tests use it. Oops.

Nobody remembers this, nobody uses this, it's misleading in ui tests. Let's get rid of this directive altogether.

[pr-23598]: rust-lang#23598
[issue-23616]: rust-lang#23616

### Follow-ups

- [x] Yeet this directive from rustc-dev-guide docs. rust-lang/rustc-dev-guide#2147

[^1]: https://github.com/chmln/sd

r? compiler
tests: Add regression test for recursive enum with Cow and Clone

I could not find any existing test. `git grep "(Cow<'[^>]\+\["` gave no hits before this tests.

Closes rust-lang#100347
Disable `avr-rjmp-offset` on Windows for now

The linker has been randomly crashing on `x86_64-mingw` that's causing spurious failures (rust-lang#133480). Disable this test on Windows for now.

cc `@jfrimmel` (nothing actionable, just FYI because linker gonna linker)
cc `@ehuss` (who noticed this)

r? compiler (or anyone really)
…er-errors

add test for alias-bound shadowing, rename folder

r? `@BoxyUwU` `@compiler-errors`
@rustbot rustbot added A-compiletest Area: The compiletest test runner A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-run-make Area: port run-make Makefiles to rmake.rs labels Nov 26, 2024
@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) rollup A PR which is a rollup labels Nov 26, 2024
@GuillaumeGomez
Copy link
Member Author

@bors r+ p=10 rollup=never

@bors
Copy link
Contributor

bors commented Nov 26, 2024

📌 Commit 0dba983 has been approved by GuillaumeGomez

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 Nov 26, 2024
@bors
Copy link
Contributor

bors commented Nov 26, 2024

⌛ Testing commit 0dba983 with merge dff3e7c...

@bors
Copy link
Contributor

bors commented Nov 26, 2024

☀️ Test successful - checks-actions
Approved by: GuillaumeGomez
Pushing dff3e7c to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 26, 2024
@bors bors merged commit dff3e7c into rust-lang:master Nov 26, 2024
7 checks passed
@rustbot rustbot added this to the 1.85.0 milestone Nov 26, 2024
@GuillaumeGomez GuillaumeGomez deleted the rollup-4vcthwo branch November 26, 2024 19:15
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#133411 the emscripten OS no longer exists on non-wasm targets f10d602e76b349b2c17e40d76121bd9b2506c56a (link)
#133419 Added a doc test for std::path::strip_prefix 225744b0f9e6eb335b321d8c4fe8a1a13b2a18a9 (link)
#133430 Tweak parameter mismatch explanation to not say {unknown} 96a52ee542844df80585b723405c6060e5515485 (link)
#133443 Remove dead code stemming from the old effects desugaring (… e81d924f6de51b752b9d25d20b595f01ddbf3f0c (link)
#133450 remove "onur-ozkan" from users_on_vacation 8c196c73fbbd146aa2b2eb21d8e830b1260e4bf0 (link)
#133454 Update test expectations to accept LLVM 'initializes' attri… 54ca17c4a75ead88c607bf6e89086b9a913c6bbe (link)
#133462 Use ReadCache for archive reading in bootstrap 9149c4d7a2bfc41cf0482e565d46af68bd713eee (link)
#133464 std::thread: avoid leading whitespace in some panic messages 4f6349965e0ec92996fb7a5004f7f781f2fc6699 (link)
#133467 tests: Add recursive associated type bound regression tests 3b8a6884ab8774396300f510a73531ae01fbe0d8 (link)
#133470 Cleanup: delete //@ pretty-expanded directive dc911b3d3c6c41388205ef08f1ad8c14bf96bfb8 (link)
#133473 tests: Add regression test for recursive enum with Cow and … 43f5ef9f87f12287de41010042de36fc7b1342b4 (link)
#133481 Disable avr-rjmp-offset on Windows for now 06a30e12d66beb025162d61acdb0dc37817ded83 (link)
#133495 add test for alias-bound shadowing, rename folder a9c10329001ac4fc70b839df612417edaa4fdb1f (link)

previous master: f2abf827c1

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 (dff3e7c): 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 -1.2%, secondary 0.4%)

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

Cycles

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

Binary size

Results (primary -0.0%, secondary -0.0%)

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

Bootstrap: 795.777s -> 797.491s (0.22%)
Artifact size: 336.33 MiB -> 336.34 MiB (0.00%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compiletest Area: The compiletest test runner A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc 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-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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. 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.