Commit Graph

271678 Commits

Author SHA1 Message Date
bors
dff3e7ccd4 Auto merge of #133500 - GuillaumeGomez:rollup-4vcthwo, r=GuillaumeGomez
Rollup of 13 pull requests

Successful merges:

 - #133411 (the emscripten OS no longer exists on non-wasm targets)
 - #133419 (Added a doc test for std::path::strip_prefix)
 - #133430 (Tweak parameter mismatch explanation to not say `{unknown}`)
 - #133443 (Remove dead code stemming from the old effects desugaring (II))
 - #133450 (remove "onur-ozkan" from  users_on_vacation)
 - #133454 (Update test expectations to accept LLVM 'initializes' attribute)
 - #133462 (Use ReadCache for archive reading in bootstrap)
 - #133464 (std:🧵 avoid leading whitespace in some panic messages)
 - #133467 (tests: Add recursive associated type bound regression tests)
 - #133470 (Cleanup: delete `//@ pretty-expanded` directive)
 - #133473 (tests: Add regression test for recursive enum with Cow and Clone)
 - #133481 (Disable `avr-rjmp-offset` on Windows for now)
 - #133495 (add test for alias-bound shadowing, rename folder)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-11-26 16:22:03 +00:00
Guillaume Gomez
0dba9830e8
Rollup merge of #133495 - lcnr:env-shadowing-tests, r=compiler-errors
add test for alias-bound shadowing, rename folder

r? `@BoxyUwU` `@compiler-errors`
2024-11-26 15:32:20 +01:00
Guillaume Gomez
5518c62629
Rollup merge of #133481 - jieyouxu:avr-jmp-linker, r=saethlin
Disable `avr-rjmp-offset` on Windows for now

The linker has been randomly crashing on `x86_64-mingw` that's causing spurious failures (#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)
2024-11-26 15:32:20 +01:00
Guillaume Gomez
52fcafe872
Rollup merge of #133473 - Enselic:cow, r=nnethercote
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 #100347
2024-11-26 15:32:19 +01:00
Guillaume Gomez
0d9a57d979
Rollup merge of #133470 - jieyouxu:ugly, r=compiler-errors
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 #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 #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 #23616` linking to [There are very few tests for `-Z unpretty` expansion #23616][issue-23616]. But this was arguably backwards and somewhat misleading, as noted in [#23616](https://github.com/rust-lang/rust/issues/23616#issuecomment-484999901):

    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]: https://github.com/rust-lang/rust/pull/23598
[issue-23616]: https://github.com/rust-lang/rust/issues/23616

### Follow-ups

- [x] Yeet this directive from rustc-dev-guide docs. https://github.com/rust-lang/rustc-dev-guide/pull/2147

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

r? compiler
2024-11-26 15:32:18 +01:00
Guillaume Gomez
c8c225f22f
Rollup merge of #133467 - Enselic:recurse-tests, r=lcnr
tests: Add recursive associated type bound regression tests

Add regression tests for https://github.com/rust-lang/rust/issues/129541 as requested in https://github.com/rust-lang/rust/issues/129541#issuecomment-2498514488.

Closes #129541

r? ``@lcnr``
2024-11-26 15:32:18 +01:00
Guillaume Gomez
a06532e639
Rollup merge of #133464 - RalfJung:whitespace-panic, r=joboet
std:🧵 avoid leading whitespace in some panic messages

This:
```
        panic!(
            "use of std:🧵: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``
2024-11-26 15:32:17 +01:00
Guillaume Gomez
7e3422fab2
Rollup merge of #133462 - mustartt:aix-improve-bootstrap-loading, r=jieyouxu
Use ReadCache for archive reading in bootstrap

Address expensive archive reading in bootstrap. This fixes https://github.com/rust-lang/rust/issues/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
2024-11-26 15:32:16 +01:00
Guillaume Gomez
64c0eff655
Rollup merge of #133454 - zmodem:initializes_fix, r=nikic
Update test expectations to accept LLVM 'initializes' attribute

The test was checking for two `ptr` arguments by matching commas (or non-commas), however after
https://github.com/llvm/llvm-project/pull/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)
2024-11-26 15:32:16 +01:00
Guillaume Gomez
85394cb111
Rollup merge of #133450 - onur-ozkan:update-triagebot, r=onur-ozkan
remove "onur-ozkan" from  users_on_vacation

![image](https://github.com/user-attachments/assets/08e268cd-85cf-48d1-9d56-ae0858785469)
2024-11-26 15:32:15 +01:00
Guillaume Gomez
03f56d36ae
Rollup merge of #133443 - fmease:rm-dead-eff-code-ii, r=compiler-errors
Remove dead code stemming from the old effects desugaring (II)

Follow-up to #132374.
r? project-const-traits
2024-11-26 15:32:15 +01:00
Guillaume Gomez
af6e2a588a
Rollup merge of #133430 - compiler-errors:param-mismatch, r=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
2024-11-26 15:32:14 +01:00
Guillaume Gomez
ddb6904ee4
Rollup merge of #133419 - CromFr:add-path-strip_prefix-test-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 :)
2024-11-26 15:32:13 +01:00
Guillaume Gomez
620cdfc6dc
Rollup merge of #133411 - RalfJung:emscripten-is-on-wasm, r=workingjubilee
the emscripten OS no longer exists on non-wasm targets

https://github.com/rust-lang/rust/pull/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```
2024-11-26 15:32:12 +01:00
lcnr
7dae9ac852 add test for alias-bound shadowing, rename folder 2024-11-26 13:49:23 +01:00
lcnr
fa66288a32 update crashes 2024-11-26 12:23:53 +01:00
Camille GILLOT
982cde9801 Remove extra tests. 2024-11-26 10:46:02 +00:00
Camille GILLOT
d013c18a6f Pacify tidy. 2024-11-26 10:45:59 +00:00
Camille GILLOT
7fa021ad86 Remove -Zfuel. 2024-11-26 10:45:21 +00:00
lcnr
d25ecfd5d6 do not constrain infer vars in find_best_leaf_obligation 2024-11-26 11:45:01 +01:00
bors
f2abf827c1 Auto merge of #132894 - frank-king:feature/where-refactor, r=cjgillot
Refactor `where` predicates, and reserve for attributes support

Refactor `WherePredicate` to `WherePredicateKind`, and reserve for attributes support in `where` predicates.

This is a part of #115590 and is split from #132388.

r? petrochenkov
2024-11-26 04:12:33 +00:00
bors
6d22ff1215 Auto merge of #133465 - ehuss:update-cargo, r=ehuss
Update cargo and books

10 commits in 66221abdeca2002d318fde6efff516aab091df0e..4c39aaff66862cc0da52fe529aa1990bb8bb9a22
2024-11-19 21:30:02 +0000 to 2024-11-25 16:36:17 +0000
- feat: Stabilize Edition 2024 (rust-lang/cargo#14828)
- Improve error handling when PathSource is relative (rust-lang/cargo#14854)
- test: address test output nondeterminism  (rust-lang/cargo#14855)
- chore: move supports-unicode to workspace deps (rust-lang/cargo#14853)
- Check build target supports std when building with -Zbuild-std=std (rust-lang/cargo#14183)
- fix(publish): Allow dry-run of a non-bumped workspace  (rust-lang/cargo#14847)
- test: Switch from 'exec_with_output' to 'run' (rust-lang/cargo#14848)
- test(rustflags): Verify -Cmetadata directly, not through -Cextra-filename (rust-lang/cargo#14846)
- chore: remove bors mentions (rust-lang/cargo#14845)
- Clarify how `cargo::metadata` env var is selected (rust-lang/cargo#14842)

## nomicon

1 commits in eac89a3cbe6c4714e5029ae8b5a1c556fd4e8c42..0674321898cd454764ab69702819d39a919afd68
2024-11-16 14:05:28 +0000 to 2024-11-19 12:35:48 +0000
- races: Clarify a “mostly” that might be misread (rust-lang-nursery/nomicon#468)

## reference

12 commits in 41ccb0e6478305401dad92e8fd3d04a4304edb4c..5c86c739ec71b8bc839310ff47fa94e94635bba9
2024-11-15 21:45:16 +0000 to 2024-11-25 17:23:35 +0000
- Document `gen` keyword as reserved in Rust 2024 (rust-lang-nursery/reference#1501)
- 2024: Update `expr` macro fragment specifier (rust-lang-nursery/reference#1639)
- Add rust_2024 prelude (rust-lang-nursery/reference#1552)
- 2024: Add reserved syntax (rust-lang-nursery/reference#1652)
- Add Lifetime Capture Rules 2024 (rust-lang-nursery/reference#1601)
- Add a section dedicated to Edition 2024 changes to temporary scopes (rust-lang-nursery/reference#1592)
- 2024: Add unsafe attribute differences (rust-lang-nursery/reference#1579)
- 2024: Add updates for unsafe extern blocks (rust-lang-nursery/reference#1565)
- Fix rule for lazy boolean temporary drop scope (rust-lang-nursery/reference#1681)
- Raw lifetimes (rust-lang-nursery/reference#1603)
- Fix some missing emdashes (rust-lang-nursery/reference#1676)
- Added an additional example of lifetime elision (rust-lang-nursery/reference#1678)

## rustc-dev-guide

6 commits in b679e71c2d66c6fe13e06b99ac61773b866213f0..787b4166ccc67bd8f72a6e3ef6685ce9ce82909a
2024-11-18 16:18:15 +0800 to 2024-11-22 11:17:57 +0000
- Remove constants section as it is outdated
- Flatten generic parameter defs section
- Add instructions to test error code docs (rust-lang/rustc-dev-guide#2145)
- Reorganize the "Source Code Representation" chapters (rust-lang/rustc-dev-guide#2142)
- Make `Diag` a clickable link in Suggestion section (rust-lang/rustc-dev-guide#2140)
- update for rustc_intrinsic_const_stable_indirect (rust-lang/rustc-dev-guide#2138)

## edition-guide

6 commits in 915f9b319c2823f310430ecdecd86264a7870d7e..f48b0e842a3911c63240e955d042089e9e0894c7
2024-11-06 07:23:07 +0000 to 2024-11-25 16:20:27 +0000
- Update for 2024 stabilization (rust-lang-nursery/edition-guide#338)
- Enable triagebot merge-conflicts and shortcuts (rust-lang-nursery/edition-guide#336)
- Organize the 2024 chapters into sub-chapters by category (rust-lang-nursery/edition-guide#334)
- Fix broken Cargo Book link in cargo-resolver.md (rust-lang-nursery/edition-guide#335)
- Edition 2024 guide for temporary lifetime changes (rust-lang-nursery/edition-guide#318)
- 2024: rustfmt sorting (rust-lang-nursery/edition-guide#332)
2024-11-26 01:15:45 +00:00
Nicholas Nethercote
a602cb666a Make some modules non-pub.
- drop_flag_effects: `pub` items within are all re-exported in `lib.rs`.
- un_derefer: doesn't contain any `pub` items.
2024-11-26 12:05:57 +11:00
Nicholas Nethercote
e3ef2ff05f Streamline a BitSet creation. 2024-11-26 12:05:57 +11:00
Nicholas Nethercote
3d12160dfc Move always_storage_live_locals.
It's very closely related to `MaybeStorageLive` and `MaybeStorageDead`.
It's weird that it's currently in a different module.
2024-11-26 12:05:57 +11:00
Nicholas Nethercote
71789427a3 Improve MaybeStorageLive::initialize_start_block.
We can union the two sets the easy way. This removes the need for the
domain size check, because `union` does that same check itself.
2024-11-26 12:05:44 +11:00
Nicholas Nethercote
be7c6a3b43 Make it possible for ResultsCursor to borrow a Results.
`ResultsCursor` currently owns its `Results`. But sometimes the
`Results` is needed again afterwards. So there is
`ResultsCursor::into_results` for extracting the `Results`, which leads
to some awkwardness.

This commit adds `ResultsHandle`, a `Cow`-like type that can either
borrow or own a a `Results`. `ResultsCursor` now uses it. This is good
because some `ResultsCursor`s really want to own their `Results`, while
others just want to borrow it.

We end with with a few more lines of code, but get some nice cleanups.
- `ResultsCursor::into_results` and `Formatter::into_results` are
  removed.
- `write_graphviz_results` now just borrows a `Results`, instead of the
  awkward "take ownership of a `Results` and then return it unchanged"
  pattern.

This reinstates the cursor flexibility that was lost in #118230 -- which
removed the old `ResultsRefCursor` and `ResultsCloneCursor` types -- but
in a much simpler way. Hooray!
2024-11-26 11:23:40 +11:00
Nicholas Nethercote
1914dbe694 Tweak MaybeBorrowedLocals::transfer_function usage.
In `MaybeRequiresStorage::apply_before_statement_effect`, call
`transfer_function` directly, as is already done in
`MaybeRequiresStorage::apply_before_terminator_effect`. This makes it clear
that the operation doesn't rely on the `MaybeBorrowedLocals` results.
2024-11-26 11:23:40 +11:00
Nicholas Nethercote
dae019dc9d Remove self param for MaybeBorrowedLocals::transfer_function.
It is unnecessary.
2024-11-26 11:23:40 +11:00
Nicholas Nethercote
7e704afc2d Add some useful comments.
Describing some things that took me a long time to understand.
2024-11-26 11:23:36 +11:00
Nicholas Nethercote
0066acf753 Merge apply_effects_in_block and join_state_into_successors_of.
They are always called in succession, so it's simpler if they are merged
into a single function.
2024-11-26 11:19:59 +11:00
Jieyou Xu
3a42fd2bdc tests: disable avr-rjmp-offset on Windows for now
The linker has been randomly crashing on `x86_64-mingw` that's causing
spurious failures. Disable this test on Windows for now.
2024-11-26 07:56:32 +08:00
Ralf Jung
906f66fb4c comment out the old tests instead of adjusting them 2024-11-25 20:39:45 +01:00
Martin Nordholts
259020c932 tests: Add regression test for recursive enum with Cow and Clone 2024-11-25 20:30:28 +01:00
Camille GILLOT
917dd82628 Do not unify dereferences in GVN. 2024-11-25 20:19:08 +01:00
Camille GILLOT
2cc0ee65d9 Add test. 2024-11-25 20:19:08 +01:00
lcnr
58936c1d2a fix gce typing_mode mismatch 2024-11-25 19:58:12 +01:00
许杰友 Jieyou Xu (Joe)
95ff642797 tests: remove //@ pretty-expanded usages
Done with

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

and

```
sd '//@pretty-expanded.*\n' '' tests/ui/**/*.rs
```
2024-11-26 02:50:48 +08:00
Jieyou Xu
f62753f84f compiletest: remove pretty-expanded directive and infra
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 #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 #23616` linking to [There are very few tests for `-Z unpretty`
expansion #23616][issue-23616]. But this was arguably backwards and
somewhat misleading, as noted in
<https://github.com/rust-lang/rust/issues/23616#issuecomment-484999901>:

    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]: https://github.com/rust-lang/rust/pull/23598
[issue-23616]: https://github.com/rust-lang/rust/issues/23616
2024-11-26 02:50:48 +08:00
Martin Nordholts
b77d8fa129 tests: Add recursive associated type bound regression tests 2024-11-25 19:27:38 +01:00
Eric Huss
addb040d2c Update books 2024-11-25 09:57:36 -08:00
Michael Goulet
bcfc8ab319 Remove span hack that doesnt do anything 2024-11-25 17:38:40 +00:00
Michael Goulet
4a896e7e3e No need to store original_span in ClauseWithSupertraitSpan 2024-11-25 17:38:40 +00:00
Michael Goulet
d3867174c0 Simplify object_region_bounds 2024-11-25 17:38:28 +00:00
Ralf Jung
8bc8adb8dc std:🧵 avoid leading whitespace in some panic messages 2024-11-25 18:31:49 +01:00
Eric Huss
47ddcb9fff Update cargo 2024-11-25 09:31:37 -08:00
Michael Goulet
bd44b632a8 Constify Drop and Destruct 2024-11-25 17:27:41 +00:00
Guillaume Gomez
c8399255f3 Add regression test for prelude types 2024-11-25 17:25:25 +01:00
Guillaume Gomez
d0a45cfeaa Fix Result and Option not getting a jump to def link generated 2024-11-25 17:25:25 +01:00
Henry Jiang
9f1cfec299 use ReadCache for archive loading 2024-11-25 11:15:50 -05:00