Commit graph

157745 commits

Author SHA1 Message Date
bors
6c8347b958 Auto merge of #135063 - pietroalbini:pa-bump-version, r=pietroalbini
Bump version to 1.86.0

Part of the release process.

r? `@ghost`
2025-01-03 14:14:58 +00:00
Pietro Albini
22002dbf04
bump version 2025-01-03 10:36:06 +01:00
Matthias Krüger
8439ae7422
Rollup merge of #131729 - Urgau:check-cfg-test-userspace, r=petrochenkov
Make the `test` cfg a userspace check-cfg

This PR implements MCP https://github.com/rust-lang/compiler-team/issues/785, which makes the `test` cfg a "userspace" check-cfg, i.e. no longer included in the well known cfg list.

Things to do:

- [x] Accept the MCP (https://github.com/rust-lang/compiler-team/issues/785#issuecomment-2424121886)
- [x] Mark `test` in Cargo (https://github.com/rust-lang/cargo/pull/14963)

`@rustbot` labels +S-waiting-on-MCP +F-check_cfg
r? `@petrochenkov`
2025-01-03 07:57:24 +01:00
bors
ab3924b298 Auto merge of #122565 - Zoxc:atomic-panic-msg, r=the8472
Try to write the panic message with a single `write_all` call

This writes the panic message to a buffer before writing to stderr. This allows it to be printed with a single `write_all` call, preventing it from being interleaved with other outputs. It also adds newlines before and after the message ensuring that only the panic message will have its own lines.

Before:
```
thread 'thread 'thread 'thread 'thread '<unnamed>thread 'thread 'thread 'thread '<unnamed><unnamed>thread '<unnamed>' panicked at ' panicked at <unnamed><unnamed><unnamed><unnamed><unnamed>' panicked at <unnamed>' panicked at src\heap.rssrc\heap.rs'
panicked at ' panicked at ' panicked at ' panicked at ' panicked at src\heap.rs' panicked at src\heap.rs::src\heap.rssrc\heap.rssrc\heap.rssrc\heap.rssrc\heap.rs:src\heap.rs:455455:::::455:455::455455455455455:455:99:::::9:9:
:
999:
999:
assertion failed: size <= (*queue).block_size:
:
assertion failed: size <= (*queue).block_size:
assertion failed: size <= (*queue).block_size:
:
:
assertion failed: size <= (*queue).block_sizeassertion failed: size <= (*queue).block_sizeassertion failed: size <= (*queue).block_size

assertion failed: size <= (*queue).block_size
assertion failed: size <= (*queue).block_sizeassertion failed: size <= (*queue).block_sizeerror: process didn't exit successfully: `target\debug\direct_test.exe` (exit code: 0xc0000409, STATUS_STACK_BUFFER_OVERRUN)
```
After:
```

thread '<unnamed>' panicked at src\heap.rs:455:9:
assertion failed: size <= (*queue).block_size

thread '<unnamed>' panicked at src\heap.rs:455:9:
assertion failed: size <= (*queue).block_size

thread '<unnamed>' panicked at src\heap.rs:455:9:
assertion failed: size <= (*queue).block_size

error: process didn't exit successfully: `target\debug\direct_test.exe` (exit code: 0xc0000409, STATUS_STACK_BUFFER_OVERRUN)
```

---

try-jobs: x86_64-gnu-llvm-18
2025-01-02 22:06:09 +00:00
bors
4363f9b6f6 Auto merge of #135040 - matthiaskrgr:rollup-34vsa8n, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #135016 (Ping me for rustc-dev-guide subtree changes on this repo)
 - #135027 (Remove range-metadata amdgpu workaround)
 - #135029 (Update mailmap)
 - #135033 (try to dedup me in the mailmap)
 - #135035 (Fix formatting command)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-02 19:02:41 +00:00
Matthias Krüger
666794e5c7
Rollup merge of #135035 - Noratrieb:fixfmt, r=jieyouxu
Fix formatting command

The formatting command previously had two issues:
- if rustfmt failed, it would print the command invocation. this is unnecessarily noisy
- there was a race condition that lead to orphan rustfmts that would print their output after bootstrap exited

We fix this by
- removing the printing, it's not really useful
- threading failure through properly instead of just yoloing exit(1)
2025-01-02 18:27:22 +01:00
Noratrieb
8b73fc5e27 Fix formatting command
The formatting command previously had two issues:
- if rustfmt failed, it would print the command invocation. this is
  unnecessarily noisy
- there was a race condition that lead to orphan rustfmts that would
  print their output after bootstrap exited

We fix this by
- removing the printing, it's not really useful
- threading failure through properly instead of just yoloing exit(1)
2025-01-02 17:26:46 +01:00
bors
1b2745d72a Auto merge of #135014 - Zalathar:tool-build-step, r=jieyouxu
bootstrap: Overhaul and simplify the `tool_extended!` macro

Similar to #134950, but for the macro that declares build steps for some tools.

The main changes are:
- Removing some functionality that isn't needed by any of the tools currently using the macro
- Moving some code out of the macro and into ordinary helper functions
- Switching to one macro invocation per tool, and struct-like syntax so that rustfmt will format them

There should be no functional change.
2025-01-02 16:18:28 +00:00
Urgau
c73d81ec33 Temporarily make the test cfg a well known bootstrap cfg 2025-01-02 16:49:55 +01:00
Urgau
e8a4792b3e Make the test cfg a "userspace" check-cfg 2025-01-02 16:49:55 +01:00
许杰友 Jieyou Xu (Joe)
552c1f5f45 bootstrap: temporarily flip compile::Rustc vs compile::Assemble
The PathSet prefix matching unfortunately also has implications for `./x
build compiler`, because the path filter `"compiler"` gets consumed by
`compile::Rustc` step first after PathSet prefix matching, whereas
before PathSet prefix matching, the later-registered `compile::Assemble`
step would've consumed the `"compiler"` path filter.

This merely papers over the issue with PathSet prefix handling to
unblock contributors for using `./x build compiler`.
2025-01-02 21:00:14 +08:00
Zalathar
5a32a35ab7 Move most of Step::should_run out of tool_extended! 2025-01-02 18:43:34 +11:00
Zalathar
08d70f57e2 Use struct-like syntax in tool_extended!
Using struct-like syntax allows rustfmt to format macro invocations, instead of
giving up and ignoring them.

Using a separate macro invocation per tool makes the macro slightly simpler,
and isolates syntax errors to individual invocations.
2025-01-02 18:43:34 +11:00
Zalathar
725fccda2b Move most of Step::run out of tool_extended! 2025-01-02 18:43:33 +11:00
Zalathar
bba24a2ffe Don't pass (self, builder) identifiers to tool_extended! 2025-01-02 17:47:13 +11:00
Zalathar
b84c54ac87 Remove two unused parameters from tool_extended! 2025-01-02 17:47:13 +11:00
Zalathar
e76c484d6d Remove the unused extra_features field from tool_extended!
This field was introduced in #48097 to support the "clippy" feature of RLS.
2025-01-02 17:47:13 +11:00
bors
c528b8c678 Auto merge of #134907 - Kobzol:rustc-dev-guide-josh, r=ehuss
Turn rustc-dev-guide into a Josh subtree

Discussed on [Zulip](https://rust-lang.zulipchat.com/#narrow/channel/196385-t-compiler.2Fwg-rustc-dev-guide/topic/a.20move.20to.20main.20repo.20.28rust-lang.2Frust.29).

Accompanying rustc-dev-guide PR: https://github.com/rust-lang/rustc-dev-guide/pull/2183

I didn't create a bootstrap step for rustc-dev-guide yet, because the rustc-dev-guide version that we currently use in this repo doesn't have linkcheck enabled and that fails tests.

The subtree starts with commit [ad93c5f1c49f2aeb45f7a4954017b1e607df9f5e](ad93c5f1c4).

What I did:
```
export DIR=src/doc/rustc-dev-guide

# Remove submodule
git submodule status ${DIR}
git submodule deinit ${DIR}
git rm -r --cached ${DIR}
rm -rf ${DIR}
# Remove rustc-dev-guide from .gitmodules
git commit -m"Removed `${DIR}` submodule"

# Import history with josh
git fetch https://github.com/rust-lang/rustc-dev-guide ad93c5f1c49f2aeb45f7a4954017b1e607df9f5e
josh-filter ':prefix=src/doc/rustc-dev-guide' FETCH_HEAD
git merge --allow-unrelated FILTERED_HEAD

# A few follow-up cleanup commits
```

r? ehuss
2025-01-02 03:05:42 +00:00
Matthias Krüger
92f56fc150
Rollup merge of #134973 - ericlehong:fix-typo, r=GuillaumeGomez
Fix typos

This PR fixes typos errors in comments and docs.

Thank you very much.
2025-01-01 22:04:16 +01:00
Matthias Krüger
afdb6270ef
Rollup merge of #134967 - onur-ozkan:auto-submodule-handler, r=jieyouxu
handle submodules automatically on `doc` steps

Helps to make `doc` macros less complicated.
2025-01-01 22:04:15 +01:00
bors
372442fe5f Auto merge of #134964 - Kobzol:tidy-full-check, r=onur-ozkan
Run Python formatting check in tidy on CI

I don't think that there's a reason why we should ignore Python formatting on CI, when we already check Python lints and C++ formatting.

r? `@onur-ozkan`
2025-01-01 16:08:17 +00:00
Jakub Beránek
47e2baa1c9 Remove mention of rustc-dev-guide from toolstate 2025-01-01 17:06:58 +01:00
Jakub Beránek
5c0c0f41f4 Remove obsolete RustcGuide bootstrap step
It was not working for a long time.
2025-01-01 17:06:27 +01:00
Jakub Beránek
59d5328e0a Fix source code path in comment 2025-01-01 17:06:27 +01:00
Jakub Beránek
8decc04e75 Add rustc-dev-guide as a josh subtree 2025-01-01 17:06:11 +01:00
Jakub Beránek
ccee38a930 Removed rustc-dev-guide as a submodule 2025-01-01 17:05:53 +01:00
John Kåre Alsaker
4bf85c25ec Try to write the panic message with a single write_all call 2025-01-01 15:58:29 +01:00
bors
bc3e3015b6 Auto merge of #134992 - Zalathar:rollup-pldy5w6, r=Zalathar
Rollup of 6 pull requests

Successful merges:

 - #131439 (Remove allowing static_mut_refs lint)
 - #133292 (E0277: suggest dereferencing function arguments in more cases)
 - #134877 (add suggestion for wrongly ordered format parameters)
 - #134945 (Some small nits to the borrowck suggestions for mutating a map through index)
 - #134950 (bootstrap: Overhaul and simplify the `tool_check_step!` macro)
 - #134979 (Provide structured suggestion for `impl Default` of type where all fields have defaults)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-01 08:10:15 +00:00
Stuart Cook
cf7d7f5096
Rollup merge of #134950 - Zalathar:tool-check-step, r=jieyouxu
bootstrap: Overhaul and simplify the `tool_check_step!` macro

Main changes:

- Pull most of `run` out of the macro and into a regular helper function
- Reduce the number of redundant/unnecessary macro arguments
- Switch to struct-like syntax so that optional arguments are clearer, and so that rustfmt is happy

~~The one “functional” change is that the `-check.stamp` files now get their name from the final path segment, instead of the struct name; in practice this means that they now contain more hyphens in some cases. As far as I'm aware, the exact filename doesn't matter so this should be fine.~~ (that change has been removed from this PR)
2025-01-01 16:35:31 +11:00
bors
a8953d83cf Auto merge of #134926 - rustbot:docs-update, r=ehuss
Update books

## rust-lang/book

13 commits in ad2011d3bcad9f152d034faf7635c22506839d58..04d06dfe541607e6419f3d028c3f9b245f3be4d9
2024-12-20 22:44:11 UTC to 2024-12-16 18:18:21 UTC

- Update section name (rust-lang/book#4175)
- Update text to reflect the change from '&str' to 'char' in example (rust-lang/book#4173)
- Update figure number in text and file name (rust-lang/book#4172)
- Fix chapter number (rust-lang/book#4171)
- Delete unused reference (rust-lang/book#4170)
- Remove orphaned half-sentence (rust-lang/book#4169)
- Fix chapter number (rust-lang/book#4168)
- A better phrasing for generic methods. (rust-lang/book#3428)
- Fix minor grammatical error (rust-lang/book#4098)
- Update appendix-06-translation.md to add another Chinese translation. (rust-lang/book#3608)
- Change Korean translation repo to newer (rust-lang/book#3625)
- Clarify/improve readability in Ch. 02 discussion of `Result` variants (rust-lang/book#4167)
- Ch. 20: conclude §01 with a reference to the Rustonomicon (rust-lang/book#4166)

## rust-lang/nomicon

1 commits in 97e84a38c94bf9362b11284c20b2cb4adaa1e868..7ef05b9777c94836bc92f50f23e6e00981521a89
2024-12-30 10:38:10 UTC to 2024-12-30 10:38:10 UTC

- Fix URL fragment to MutexGuard's negative impl of Send (rust-lang/nomicon#472)

## rust-lang/reference

3 commits in 9f41bc11342d46544ae0732caf14ec0bcaf27376..acd6794e712d5e2ef6f5c84fb95688d32a69b816
2024-12-18 23:04:30 +0000 to 2024-12-30 22:12:57 +0000

- Revert "`coverage` attribute" (rust-lang/reference#1706)
- Document Rust 2024 match ergonomics reservations (rust-lang/reference#1702)
- Add documentation for `#[diagnostic::do_not_recommend]` (rust-lang/reference#1663)

## rust-lang/edition-guide

5 commits in bc4ce51e1d4dacb9350a92e95f6159a42de2f8c6..d56e0f3a0656b7702ca466d4b191e16c28262b82
2024-12-18 05:34:59 +0000 to 2024-12-31 20:04:52 +0000

- 2024: Document rustfmt overflow_delimited_expr (rust-lang/edition-guide#352)
- 2024: Document rustfmt fixes (rust-lang/edition-guide#351)
- Update the transitioning steps (rust-lang/edition-guide#350)
- Revert "2024: Assignment operator RHS indentation" (rust-lang/edition-guide#343)
- Revert "2024: Add chapter on single-line `where` clauses" (rust-lang/edition-guide#344)

## rust-lang/rust-by-example

1 commits in 76406337f4131253443aea0ed7e7f451b464117c..093397535b48ae13ec76bc526b7e6eb8c096a85c
2024-12-18 17:29:56 UTC to 2024-12-18 17:29:56 UTC

- Mention that you're not allowed to partially move Drop types (rust-lang/rust-by-example#1902)

## rust-lang/rustc-dev-guide

18 commits in 7f7ba48f04abc2ad25e52f30b5e2bffa286b019f..ad93c5f1c49f2aeb45f7a4954017b1e607df9f5e
2024-12-30 09:22:22 UTC to 2024-12-17 17:00:38 UTC

- Opt into, rather than out of, linkcheck (rust-lang/rustc-dev-guide#2180)
- Remove stale implementation details of coverage instrumentation (rust-lang/rustc-dev-guide#2179)
- Remove properly tracked config file from .gitignore & add support for skipping of link-checking (rust-lang/rustc-dev-guide#2023)
- Add a couple of linkcheck exceptions: (rust-lang/rustc-dev-guide#2120)
- Add missing link for [Node] (rust-lang/rustc-dev-guide#2177)
- Fix 403 received for HEAD request (rust-lang/rustc-dev-guide#2176)
- Start using mdbook-linkcheck2 (rust-lang/rustc-dev-guide#2103)
- Document `x test --no-capture` (rust-lang/rustc-dev-guide#2174)
- Remove the `-test` suffix from normalize directives (rust-lang/rustc-dev-guide#2172)
- Rework the driver docs (rust-lang/rustc-dev-guide#2162)
- Document `forbid-output` for UI tests (rust-lang/rustc-dev-guide#2171)
- completions: Zsh is now supported (rust-lang/rustc-dev-guide#2173)
- region-outlives propagation (rust-lang/rustc-dev-guide#2169)
- compiletest: Document the `--debugger` flag (rust-lang/rustc-dev-guide#2170)
- document the public ci dashboard (rust-lang/rustc-dev-guide#2167)
- Fix trivial typo of "query-fied" (rust-lang/rustc-dev-guide#2165)
- Fix some typos (rust-lang/rustc-dev-guide#2166)
- Add suggestion for `--keep-stage 0` (rust-lang/rustc-dev-guide#2164)
2025-01-01 05:25:45 +00:00
bors
2085bce154 Auto merge of #134988 - tgross35:rollup-s59bx7c, r=tgross35
Rollup of 8 pull requests

Successful merges:

 - #132474 (Add more mailmap entries)
 - #133486 (borrowck diagnostics: make `add_move_error_suggestions` use the HIR rather than `SourceMap`)
 - #134861 (Add GUI test for item info elements color)
 - #134968 (Print how to rebless Python formatting in tidy)
 - #134971 (chore: fix typos)
 - #134972 (add .mailmap entry for myself)
 - #134974 (Revert #119515 single line where clause style guide)
 - #134975 (Revert style guide rhs break)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-01 01:34:29 +00:00
Trevor Gross
9472d32842
Rollup merge of #134975 - ehuss:revert-style-guide-rhs-break, r=compiler-errors
Revert style guide rhs break

This reverts https://github.com/rust-lang/rust/pull/132369 and https://github.com/rust-lang/rust/pull/119838. The style-guide change for indentation of rhs was not implemented in time for the 2024 style edition.
See tracking issue https://github.com/rust-lang/rust/issues/132380.

cc #134974 for the other style guide change in 2024.

r? ``@compiler-errors``
2024-12-31 18:42:26 -05:00
Trevor Gross
fee79a2900
Rollup merge of #134974 - ehuss:revert-single-line-where, r=compiler-errors
Revert #119515 single line where clause style guide

This did not get implemented for the style edition in 2024, so this PR removes it from the documentation.
See tracking issue https://github.com/rust-lang/rust/issues/132381.

This can be added back in the next edition if it gets implemented. I'm a little unclear on what the style team intends for how future changes are documented. For example, the current style-guide documented behavior that rustfmt does not support. I'm not sure who the audience for this document is, or how this is intended to stay in sync with rustfmt. For example, if I read this and assume this is how it is supposed to work, and then rustfmt breaks that, it seems like that is confusing. Similarly, if I'm staying on an older edition, this documentation would be incorrect for my crate.

Perhaps changes like this could be "teed-up" in a PR, but not merged until the edition is stabilized (similar to how the reference works)? And include notes for parts that are edition-specific (so if I am using an older edition, I can see that something is different). In general, I'm a little confused on how this is intended to work.

Reverts:

- https://github.com/rust-lang/rust/pull/119515
2024-12-31 18:42:25 -05:00
Trevor Gross
53b99dee15
Rollup merge of #134968 - Kobzol:tidy-bless-log, r=Noratrieb
Print how to rebless Python formatting in tidy

Suggested [here](https://github.com/rust-lang/rust/pull/134964#discussion_r1900124882).

r? ``@Noratrieb``
2024-12-31 18:42:24 -05:00
Weihang Lo
acb38ec197
Update cargo 2024-12-31 17:05:16 -05:00
Eric Huss
40b2cd9dde Update reference, edition-guide 2024-12-31 12:29:50 -08:00
Eric Huss
7a46c7b112 Revert "Rollup merge of #119838 - joshtriplett:style-guide-binop-indent, r=compiler-errors"
This reverts commit 36287830a2, reversing
changes made to 31026b7fe3.
2024-12-31 08:50:28 -08:00
Eric Huss
a6ba04ae6a Revert "Rollup merge of #132369 - joshtriplett:style-guide-binop-heuristic-assignment-only, r=calebcartwright"
This reverts commit 348d28052b, reversing
changes made to 526c67f37b.
2024-12-31 08:50:04 -08:00
Eric Huss
b4a092662c Revert "Rollup merge of #119515 - joshtriplett:style-guide-gat-where-clause-same-line, r=compiler-errors"
This reverts commit 4d1cce9de5, reversing
changes made to 030a12ce2b.
2024-12-31 07:57:06 -08:00
Jakub Beránek
ca8b12eb54 Print how to rebless Python formatting in tidy 2024-12-31 15:45:21 +01:00
Max Heller
17d512ab59 Use id attribute for <a> tags instead of deprecated name attribute (#2184) 2024-12-31 22:02:50 +08:00
onur-ozkan
6eb9ebf1d6 add test coverage for helpers::is_path_in_submodule
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-12-31 16:34:21 +03:00
Matthias Krüger
d08d132524
Rollup merge of #134918 - ChrisDenton:issue-70093, r=jieyouxu
Windows: Enable issue 70093 link tests

Tracking issue for `-Z link-native-libraries`: #134948
Tracking issue for `-Z link-directives`: #134947

`-Zlink-native-libraries=no` and `-Zlink-directives=no` *should* work on Windows, at least for msvc. The fly in ointment is that `default-linker-libraries` doesn't. On unixy platforms rustc calls another compiler which in turn calls the linker along with the default libraries. On MSVC rustc calls the linker directly therefore it would need to be the one to implement `default-linker-libraries`. Except it doesn't so we workaround that in the test by using `-C link-arg` to talk to the linker.
2024-12-31 14:30:43 +01:00
Matthias Krüger
3e888820bd
Rollup merge of #134610 - tbu-:pr_doc_target_fmt, r=Noratrieb
Format `build.toml` consistently in platform support docs

Also fix compiler team name in target tier docs.
2024-12-31 14:30:42 +01:00
onur-ozkan
b1b576da4d handle submodules automatically on doc steps
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-12-31 16:24:58 +03:00
Jakub Beránek
787c2a2c6a Reformat Python file 2024-12-31 13:14:04 +01:00
Jakub Beránek
bbb5ca7c79 Enable Python formatting checks in tidy on CI 2024-12-31 13:13:15 +01:00
Zalathar
66fd5340ea Use struct-like syntax in tool_check_step!
This tricks rustfmt into formatting the macro arguments as expressions, instead
of giving up and ignoring them.
2024-12-31 22:26:14 +11:00
Zalathar
774e83cea1 Make tool_check_step! always assume SourceType::InTree
All of the tools that use this macro are currently in-tree, so support for
specifying a `SourceType` was not meaningfully used. It can potentially be
re-added in the future if needed.
2024-12-31 22:12:59 +11:00
Zalathar
c59ccae739 Infer tool-check-step display name from the last path component 2024-12-31 22:12:59 +11:00