Commit graph

155070 commits

Author SHA1 Message Date
许杰友 Jieyou Xu (Joe)
3980cc6521
Rollup merge of #134815 - 9names:sort_platform_md_targets, r=jieyouxu
Sort triples by name in platform_support.md

When looking for riscv32emc support, I missed it at first because it was at the end of the tier3 target list [here](https://doc.rust-lang.org/rustc/platform-support.html#tier-3). These lists are *mostly* dictionary sorted so I assumed it should be near the riscv32i* targets.

This PR puts all targets back in dictionary order. There were only a few outside of tier3.

I ended up writing a small program to sort them because I did not trust myself to do it manually, but I stopped short of fully automating it.
I have manually reviewed the output to confirm it still has the same number of entries, and that the changed values do follow the ordering I would expect.

For folks who would prefer to review code than manual textual changes, the sorting program (including inputs) is [here.](https://github.com/9names/platform_sort_arch/blob/main/src/main.rs)
2024-12-27 20:44:14 +08:00
许杰友 Jieyou Xu (Joe)
d419cc7c6a
Rollup merge of #134806 - notriddle:notriddle/parent-path-is-better, r=GuillaumeGomez
rustdoc: use shorter paths as preferred canonical paths

This is a solution to [the `std::sync::poison` linking problem](https://github.com/rust-lang/rust/pull/134692#issuecomment-2560373308), and, in general, makes intra-doc links shorter and clearer.

> Done. This helped with the search, but not with the things like `MutexGuard`'s doc's reference to `Mutex::lock` being converted to the absolute (unstable) `std::sync::poison::Mutex` path.

cc `@tgross35`

r? `@GuillaumeGomez`
2024-12-27 20:44:13 +08:00
Zalathar
835fbcbcab Remove the -test suffix from normalize directives 2024-12-27 19:58:16 +11:00
Zalathar
5ba0dd4ef6 Don't use parse_cfg_name_directive for normalize directives
This is a little more verbose, but also more explicit, and avoids invoking the
full condition engine when only the pointer-width conditions are used.
2024-12-27 19:58:14 +11:00
9names
2855098a51 Sort triples by name in platform_support.md 2024-12-27 17:51:11 +11:00
Michael Howell
16a4ad7d7b rustdoc: use shorter paths as preferred canonical paths
This is a solution to the `std::sync::poison` linking problem,
and, in general, makes intra-doc links shorter and clearer.
2024-12-26 15:46:36 -07:00
bors
917bfa7847 Auto merge of #134795 - GuillaumeGomez:rollup-9x8n7pi, r=GuillaumeGomez
Rollup of 4 pull requests

Successful merges:

 - #134656 (Migrate `incr-add-rust-src-component` to rmake)
 - #134664 (Account for removal of multiline span in suggestion)
 - #134772 (Improve/cleanup rustdoc code)
 - #134781 (Add more `begin_panic` normalizations to panic backtrace tests)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-12-26 21:04:12 +00:00
Guillaume Gomez
3e02ddb234
Rollup merge of #134772 - GuillaumeGomez:improve-rustdoc, r=notriddle
Improve/cleanup rustdoc code

Ran clippy on rustdoc, always beneficial. :)

r? `@notriddle`
2024-12-26 19:30:29 +01:00
Guillaume Gomez
c016cd8670
Rollup merge of #134656 - jieyouxu:migrate-incr-add-rust-src-component, r=wesleywiser
Migrate `incr-add-rust-src-component` to rmake

This PR partially supersedes #128562, and ports the Makefile-based `tests/run-make/incr-add-rust-src-component` to use rmake.rs infra.

Part of #121876.

This run-make test is a regression test for https://github.com/rust-lang/rust/issues/70924. It (tries to) checks that if we add the `rust-src` component in between two incremental compiles, that the compiler doesn't ICE on the second invocation.

- Original issue:https://github.com/rust-lang/rust/issues/70924
- Fix PR: https://github.com/rust-lang/rust/pull/72767
- PR adding this regression test: https://github.com/rust-lang/rust/pull/72952

However, the Makefile version of this used `$SYSROOT/lib/rustlib/src/rust/src/libstd/lib.rs`, but that actually got moved around and reorganized over the years. As of Dec 2024, the `rust-src` component is more like (specific for our purposes):

```
$SYSROOT/lib/rustlib/src/rust/
    library/std/src/lib.rs
    src/
```

However, this run-make test is ancient and it exercises incr-comp system logic. I'm not sure if this test would actually catch the original regression.

This PR was co-authored with `@Oneirical.`

r? incremental

try-job: i686-msvc
try-job: x86_64-mingw-1
try-job: x86_64-msvc
try-job: aarch64-apple
2024-12-26 19:30:28 +01:00
bors
19e75f4fb3 Auto merge of #134788 - flip1995:clippy-subtree-update, r=matthiaskrgr
Clippy subtree update

r? `@Manishearth`
2024-12-26 18:19:55 +00:00
Philipp Krones
8a7d8ece32
Merge commit '609cd310be' into clippy-subtree-update 2024-12-26 15:15:54 +01:00
bors
e2848a05a9 Auto merge of #134784 - RalfJung:miri-sync, r=RalfJung
Miri subtree update

r? `@ghost`
2024-12-26 13:02:16 +00:00
Guillaume Gomez
bdc8df4cb5 Improve rustdoc code 2024-12-25 22:22:23 +01:00
bors
7c002ff9a7 Auto merge of #134703 - poliorcetics:ab/push-ovsylkzsoxku, r=GuillaumeGomez
nits: Cleanup of `librustdoc::clean::Cfg::simplify_with`

r? `@GuillaumeGomez`
2024-12-25 16:56:32 +00:00
Ralf Jung
35f10b1e03 we generally make later flags overwrite earlier flags, so remove some logic guarding just against that 2024-12-25 10:50:48 +01:00
Ralf Jung
b109091cfd remove some flags that have been hard errors for a while 2024-12-25 10:50:48 +01:00
Ralf Jung
2de456151a show an error on some invalid flag combinations: TB + permissive provenance; strict provenance + native calls 2024-12-25 10:50:48 +01:00
bors
a0a5c42346 Auto merge of #134738 - clubby789:forbid-output-ui, r=jieyouxu
compiletest: Support `forbid-output` in UI tests

The `forbid-output` directive is currently only run in incremental tests (although no incremental tests use it). There are some UI tests 'using' it, but it's doing nothing 😄 Let's fix this

Will also PR the dev guide to note this.

dev-guide PR: https://github.com/rust-lang/rustc-dev-guide/pull/2171
2024-12-25 08:46:20 +00:00
bors
68b9e4f5f5 Auto merge of #134748 - DianQK:rollup-3y5fzcx, r=DianQK
Rollup of 3 pull requests

Successful merges:

 - #134525 (Arbitrary self types v2: unstable doc updates.)
 - #134735 (Consider arm to diverge if guard diverges)
 - #134741 (Actually print all the relevant parts of a coroutine in verbose mode)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-12-25 06:07:04 +00:00
DianQK
3eba722d49
Rollup merge of #134525 - adetaylor:unstable-book-changes, r=wesleywiser
Arbitrary self types v2: unstable doc updates.

Document these two feature flags.

Part of #44874 .
2024-12-25 12:23:06 +08:00
bors
41f2f5c0b7 Auto merge of #134747 - weihanglo:update-cargo, r=weihanglo
Update cargo

6 commits in 652623b779c88fe44afede28bf7f1c9c07812511..c86f4b3a1b153218e6e50861214b0b4b4e695f23
2024-12-20 15:44:42 +0000 to 2024-12-24 17:49:48 +0000
- fix(package): check dirtiness of path fields in manifest (rust-lang/cargo#14966)
- test: make path arguments more generic and flexible (rust-lang/cargo#14979)
- Moved manifest metadata tracking from fingerprint to dep info (rust-lang/cargo#14973)
- fix: assure possibly blocking non-files (like FIFOs) won't be picked up for publishing. (rust-lang/cargo#14977)
- simplify SourceID Hash (rust-lang/cargo#14800)
- upgrade `gix` to the latest release 0.69. (rust-lang/cargo#14975)
2024-12-25 03:29:11 +00:00
Weihang Lo
57e413c47d
Update cargo 2024-12-24 22:16:30 -05:00
bors
e33c428c8c Auto merge of #134729 - oliveredget:typo, r=jieyouxu
chore: fix typos

Fix some typos, thank you very much.
2024-12-25 00:40:23 +00:00
clubby789
5a8ecc9518 compiletest: Support forbid-output in UI tests 2024-12-25 00:06:07 +00:00
bors
d53b0ff6b5 Auto merge of #134724 - onur-ozkan:type-improvements, r=jieyouxu
improve type mutation for certain structures

self-explanatory
2024-12-24 16:40:11 +00:00
oliveredget
be1d5dd494
chore: fix typos 2024-12-24 23:37:30 +08:00
onur-ozkan
6b2fd4f234 improve type mutation for certain structures
self-explanatory

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-12-24 13:42:46 +00:00
bors
f3343420c8 Auto merge of #134625 - compiler-errors:unsafe-binders-ty, r=oli-obk
Begin to implement type system layer of unsafe binders

Mostly TODOs, but there's a lot of match arms that are basically just noops so I wanted to split these out before I put up the MIR lowering/projection part of this logic.

r? oli-obk

Tracking:

- https://github.com/rust-lang/rust/issues/130516
2024-12-24 00:51:51 +00:00
Alexis (Poliorcetics) Bourget
8cf09c77c8
nit: cleanups in Cfg::simplify_with 2024-12-24 00:10:15 +01:00
bors
bdc6b3de48 Auto merge of #134405 - rmehri01:x-completions, r=onur-ozkan
Generate shell completions for x as well

It would be nice to be have shell completions for both `./x` and `x` (installed with `cargo install --path src/tools/x`) instead of just `x.py`. This pr generates the corresponding completions for each shell in a similar way to `x.py` but under `x.<shell>` instead.
2024-12-23 19:31:58 +00:00
bors
addbd001ec Auto merge of #134687 - matthiaskrgr:rollup-m32tkax, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #134363 (Use `#[derive(Default)]` instead of manual `impl` when possible)
 - #134517 (Add tests for coverage attribute on trait functions)
 - #134528 (opt-dist: propagate channel info to bootstrap)
 - #134669 (Document the `--dev` flag for `src/ci/docker/run.sh`)
 - #134680 (Clean up a few rmake tests  )

r? `@ghost`
`@rustbot` modify labels: rollup
2024-12-23 16:40:02 +00:00
Ralf Jung
fdfd064c62 use std::sync::Once instead of hand-rolling a bad version of it 2024-12-23 16:24:24 +01:00
Ralf Jung
411658566d many-seeds: add flag to keep going even after we found a failing seed 2024-12-23 14:50:26 +01:00
Ralf Jung
0f49f0ffdf stop using process-wide state, now that we are running multiple interpreters in the same thread 2024-12-23 14:50:26 +01:00
Matthias Krüger
a62f245fb7
Rollup merge of #134669 - clubby789:dev-ci-mode, r=jieyouxu
Document the `--dev` flag for `src/ci/docker/run.sh`

This flag is very helpful for debugging CI issues locally, but it's not documented anywhere and I wasn't aware of it until `@jieyouxu` pointed it out. Add a note to the CI Docker readme to make this more discoverable
2024-12-23 14:44:21 +01:00
Matthias Krüger
cfb7a56676
Rollup merge of #134528 - jieyouxu:fix-rustc-bootstrap-test, r=Kobzol
opt-dist: propagate channel info to bootstrap

Fixes #133503.

Previously, `tests/ui/bootstrap/rustc_bootstap.rs` [sic] failed during [beta bump](https://github.com/rust-lang/rust/pull/133447#issuecomment-2501298794) in opt-dist tests. This is because:

- `opt-dist` tried to run `./x test` against beta-channel dist `rustc` through `bootstrap`.
- The dist build produced during the beta bump produces a `rustc` which correctly thinks that it is a beta compiler based on `src/ci/channel` info.
- `opt-dist` tries to run `./x test` on the beta `rustc` from the dist build, but without specifying channel through a synthetic `config.toml`, so `bootstrap` tells `compiletest` that we're on the `nightly` channel (by default).
- Now there's a channel mismatch: `compiletest` believes the `rustc` under test is a *nightly* rustc, but the `rustc` under test actually considers itself a *beta* rustc. This means that `//@ only-nightly` will be satisfied yet the test will fail as the *beta* rustc is not a *nightly* rustc.

This PR:

- Fixes the test failure during beta bump (i.e. #133503) by having `opt-dist` faithfully report the channel of the dist `rustc` being tested (i.e. "beta" in a beta bump PR). This will properly make the test be ignored during beta bump as the `rustc` under test is not a *nightly* rustc.
- Fixes the test name `rustc_bootstap.rs` -> `rustc_bootstrap.rs`. No more stapping.
- Slightly adjusts the doc comment in the test to make it more clear.

I ran a try-job against the beta branch (explicitly running the opt-dist tests by modifying the job definition) with these changes in #134131, and it appears that the try-job was [successful](https://github.com/rust-lang/rust/pull/134131#issuecomment-2555492215). The two commits in this PR are cherry-picked from #134131, with the test commit slightly modified (to also adjust the test comments).

r? `@Kobzol` (or compiler or bootstrap or infra I guess?)
2024-12-23 14:44:21 +01:00
Ralf Jung
d04b972f72 remove --many-seeds from ./miri run 2024-12-23 13:58:35 +01:00
Ralf Jung
0bd76e1840 remove many-seeds mode from cargo-miri 2024-12-23 13:58:35 +01:00
Ralf Jung
d80f319121 add -Zmiri-many-seeds flag to the driver itself 2024-12-23 13:58:35 +01:00
许杰友 Jieyou Xu (Joe)
7ee520491e tests: migrate incr-add-rust-src-component to rmake.rs
The Makefile version seems to contain a bug. Over the years, the
directory structure of the `rust-src` component changed as the source
tree directory structure changed. `libstd` is no longer a thing directly
under `root/lib/rustlib/src/rust/src/`, it is moved to
`root/lib/rustlib/src/rust/library/std`.

Co-authored-by: Oneirical <manchot@videotron.ca>
2024-12-23 20:23:57 +08:00
bors
904d8f6b39 Auto merge of #134681 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer`

r? `@ghost`
2024-12-23 12:18:14 +00:00
clubby789
d124ec68b3 Link to dev guide on Docker testing 2024-12-23 09:35:14 +00:00
Laurențiu Nicola
0180d2d16f Bump rustc crates 2024-12-23 11:33:26 +02:00
Laurențiu Nicola
9420a0b11a Merge from rust-lang/rust 2024-12-23 11:27:07 +02:00
Laurențiu Nicola
214134902f Preparing for merge from rust-lang/rust 2024-12-23 11:26:54 +02:00
Trevor Gross
8fc4ba2ac1
Rollup merge of #134672 - Zalathar:revert-coverage-attr, r=wesleywiser
Revert stabilization of the `#[coverage(..)]` attribute

Due to a process mixup, the PR to stabilize the `#[coverage(..)]` attribute (#130766) was merged while there are still outstanding concerns. The default action in that situation is to revert, and the feature is not sufficiently urgent or uncontroversial to justify special treatment, so this PR reverts that stabilization.

---

- A key point that came up in offline discussions is that unlike most user-facing features, this one never had a proper RFC, so parts of the normal stabilization process that implicitly rely on an RFC break down in this case.
- As the implementor and de-facto owner of the feature in its current form, I would like to think that I made good choices in designing and implementing it, but I don't feel comfortable proceeding to stabilization without further scrutiny.
- There hasn't been a clear opportunity for T-compiler to weigh in or express concerns prior to stabilization.
- The stabilization PR cites a T-lang FCP that occurred in the tracking issue, but due to the messy design and implementation history (and lack of a clear RFC), it's unclear what that FCP approval actually represents in this case.
  - At the very least, we should not proceed without a clear statement from T-lang or the relevant members about the team's stance on this feature, especially in light of the other concerns listed here.
- The existing user-facing documentation doesn't clearly reflect which parts of the feature are stable commitments, and which parts are subject to change. And there doesn't appear to be a clear consensus anywhere about where that line is actually drawn, or whether the chosen boundary is acceptable to the relevant teams and individuals.
  - For example, the [stabilization report comment](https://github.com/rust-lang/rust/issues/84605#issuecomment-2166514660) mentions that some aspects are subject to change, but that text isn't consistent with my earlier comments, and there doesn't appear to have been any explicit discussion or approval process.
  - [The current reference text](4dfaa4f/src/attributes/coverage-instrumentation.md) doesn't mention this distinction at all, and instead simply describes the current implementation behaviour.
- When the implementation was changed to its current form, the associated user-facing error messages were not updated, so they still refer to the attribute only being allowed on functions and closures.
  - On its own, this might have been reasonable to fix-forward in the absence of other concerns, but the fact that it never came up earlier highlights the breakdown in process that has occurred here.

---

Apologies to everyone who was excited for this stabilization to land, but unfortunately it simply isn't ready yet.
2024-12-23 02:07:32 -05:00
Trevor Gross
c9c90dc4b5
Rollup merge of #134668 - compiler-errors:default-struct-value-fmt, r=ytmimi
Make sure we don't lose default struct value when formatting struct

The reason why https://github.com/rust-lang/rustfmt/issues/6424 broke when https://github.com/rust-lang/rust/pull/129514 landed is because the parser now *successfully* parses default struct values. That means that where we used to fail in `rewrite_macro_inner`:

e108481f74/src/tools/rustfmt/src/macros.rs (L263-L267)

... we now succeed, and we now proceed to format the inner struct as a macro arg. Since formatting was never implemented for default struct values, this means that we’ll always rewrite the struct to exclude the default value.

This PR makes it so that we simply don’t rewrite struct fields if they have a default value.

r? `@ytmimi`
2024-12-23 02:07:32 -05:00
Trevor Gross
fde85a8e5f
Rollup merge of #134659 - jieyouxu:recursive-remove, r=ChrisDenton
test-infra: improve compiletest and run-make-support symlink handling

I was trying to implement #134656 to port `tests/run-make/incr-add-rust-src-component.rs`, but found some blockers related to symlink handling, so in this PR I tried to resolve them by improving symlink handling in compiletest and run-make-support (particularly for native windows msvc environment).

Key changes:

- I needed to copy symlinks (duplicate a symlink pointing to the same file), so I pulled out the copy symlink logic and re-exposed it as `run_make_support::rfs::copy_symlink`. This helper correctly accounts for the Windows symlink-to-file vs symlink-to-dir distinction (hereafter "Windows symlinks") when copying symlinks.
- `recursive_remove`:
    - I needed a way to remove symlinks themselves (no symlink traversal). `std::fs::remove_dir_all` handles them, but only if the root path is a directory. So I wrapped `std::fs::remove_dir_all` to also handle when the root path is a non-directory entity (e.g. file or symlink). Again, this properly accounts for Windows symlinks.
    - I wanted to use this for both compiletest and run-make-support, so I put the implementation and accompanying tests in `build_helper`.
    - In this sense, it's a reland of #129302 with proper test coverage.
    - It's a thin wrapper around `std::fs::remove_dir_all` (`remove_dir_all` correctly handles read-only entries on Windows). The helper has additional permission-setting logic for when the root path is a non-dir entry on Windows to handle read-only non-dir entry.

Fixes #126334.
2024-12-23 02:07:31 -05:00
Trevor Gross
3acf9c93a4
Rollup merge of #129220 - asomers:target-maintainer, r=tgross35
Add platform docs for FreeBSD.
2024-12-23 02:07:31 -05:00
Zalathar
87c2f9a5be Revert "Auto merge of #130766 - clarfonthey:stable-coverage-attribute, r=wesleywiser"
This reverts commit 1d35638dc3, reversing
changes made to f23a80a4c2.
2024-12-23 12:30:37 +11:00