Commit graph

291091 commits

Author SHA1 Message Date
Rageking8
bd9c30762a
Fix incorrect use of "recommend" over "recommended" 2025-06-04 16:30:02 +08:00
许杰友 Jieyou Xu (Joe)
4d0724c48d
Merge pull request #2450 from jieyouxu/pr_message 2025-06-03 21:13:05 +08:00
许杰友 Jieyou Xu (Joe)
033b829e0a
Merge pull request #2451 from jieyouxu/rustc-pull 2025-06-03 20:19:44 +08:00
Jieyou Xu
b65ceb28e0 Merge from rustc 2025-06-03 20:17:50 +08:00
Jieyou Xu
bf9c9d2f6e Preparing for merge from rustc 2025-06-03 20:16:00 +08:00
Jieyou Xu
ffb93c6a60
triagebot: configure PR welcome message for no auto/explicit reviewer 2025-06-03 20:05:19 +08:00
bors
c68032fd4c Auto merge of #141944 - matthiaskrgr:rollup-e7xhp6w, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - rust-lang/rust#140715 (Clarify &mut-methods' docs on sync::OnceLock)
 - rust-lang/rust#141677 (Async drop - type instead of async drop fn, fixes rust-lang/rust#140484)
 - rust-lang/rust#141741 (Overhaul `UsePath`)
 - rust-lang/rust#141873 (Fixed a typo in `ManuallyDrop`'s doc)
 - rust-lang/rust#141876 (Don't declare variables in `ExprKind::Let` in invalid positions)
 - rust-lang/rust#141886 (Add missing 2015 edition directives)
 - rust-lang/rust#141889 (Add missing `dyn` keywords to tests that do not test for them)
 - rust-lang/rust#141891 (Fix borrowck mentioning a name from an external macro we (deliberately) don't save)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-06-03 06:34:44 +00:00
Matthias Krüger
f3622ead6e
Rollup merge of #141891 - jdonszelmann:fix-141764, r=jieyouxu
Fix borrowck mentioning a name from an external macro we (deliberately) don't save

Most of the info is already in the title 🤷

Closes rust-lang/rust#141764
2025-06-03 07:03:46 +02:00
Matthias Krüger
d7fcb09da7
Rollup merge of #141889 - ferrocene:lw/missing-dyn-kw, r=petrochenkov
Add missing `dyn` keywords to tests that do not test for them

This ensures that these tests can be run on editions other than 2015
2025-06-03 07:03:45 +02:00
Matthias Krüger
f61645325e
Rollup merge of #141886 - ferrocene:lw/2015-edition-directives, r=compiler-errors
Add missing 2015 edition directives

These tests specifically test 2015 edition behavior, so ensure that they can only be run with this edition
2025-06-03 07:03:45 +02:00
Matthias Krüger
69ebe39cea
Rollup merge of #141876 - compiler-errors:missing-let-ty, r=SparrowLii
Don't declare variables in `ExprKind::Let` in invalid positions

Handle `let` expressions in invalid positions specially during resolve in order to avoid making destructuring-assignment expressions that reference (invalid) variables that have not yet been delcared yet.

See further explanation in test and comment in the source.

Fixes rust-lang/rust#141844
2025-06-03 07:03:44 +02:00
Matthias Krüger
6a5459e186
Rollup merge of #141873 - neeko-cat:patch-1, r=tgross35
Fixed a typo in `ManuallyDrop`'s doc

I noticed a typo in `ManuallyDrop`'s documentation (someone wrote "iff" instead of "if"). I fixed it in this PR.
2025-06-03 07:03:44 +02:00
Matthias Krüger
8db6881620
Rollup merge of #141741 - nnethercote:overhaul-UsePath, r=petrochenkov
Overhaul `UsePath`

It currently uses `SmallVec<[Res; 3]>` which is really weird. Details in the individual commits.

r? `@petrochenkov`
2025-06-03 07:03:43 +02:00
Matthias Krüger
aed1171c66
Rollup merge of #141677 - azhogin:azhogin/async-drop-unexpected-type-instead-of-drop-fn-fix, r=oli-obk
Async drop - type instead of async drop fn, fixes #140484

Fixes: rust-lang/rust#140484
Fixes: rust-lang/rust#140500

Fixes ICE, when type is provided in AsyncDrop trait instead of `async fn drop()`.
Fixes ICE, when async drop fn has wrong signature.
2025-06-03 07:03:43 +02:00
Matthias Krüger
55f7571a7e
Rollup merge of #140715 - lukaslueg:oncecellsyncdocs, r=tgross35
Clarify &mut-methods' docs on sync::OnceLock

Three small changes to the docs of `sync::OnceLock`:

* The docs for `OnceLock::take()` used to [say](https://doc.rust-lang.org/std/sync/struct.OnceLock.html#method.take) "**Safety** is guaranteed by requiring a mutable reference." (emphasis mine). While technically correct, imho its not necessary to even mention safety - as opposed to unsafety - here: Safety never comes up wrt `OnceLock`, as there is (currently) no way to interact with a `OnceLock` in an unsafe way; there are no unsafe methods on `OnceLock`, so there is "safety" guarantee required anywhere. What we simply meant to say is "**Synchronization** is guaranteed...".
* I've add that phrase to the other methods of `OnceLock` which take a `&mut self`, to highlight the fact that having a `&mut OnceLock` guarantees that synchronization with other threads is not required. This is the same as with [`Mutex::get_mut()`](https://doc.rust-lang.org/std/sync/struct.Mutex.html#method.get_mut), [`Cell::get_mut()`](https://doc.rust-lang.org/std/cell/struct.Cell.html#method.get_mut), and others.
* In that spirit, the half-sentence "or being initialized" was removed from `get_mut()`, as there is no way that the `OnceLock` is being initialized while we are holding `&mut` to it. Probably a copy&paste from `.get()`
2025-06-03 07:03:42 +02:00
bors
b17dba4518 Auto merge of #141210 - RalfJung:miri-std-doctests, r=saethlin
tools-aux ci runner: also cross-test doctests in Miri

Miri now supports running doctests across different targets. Let's use that to run the std doctests on aarch64-apple-darwin, i686-pc-windows-msvc.

try-job: x86_64-gnu-aux
2025-06-03 03:14:19 +00:00
bors
99426c570e Auto merge of #141750 - Noratrieb:gold-rush, r=bjorn3
Warn when gold was used as the linker

gold has been deprecated recently and is known to behave incorrectly around Rust programs, including miscompiling `#[used(linker)]`. Tell people to switch to a different linker instead.

closes rust-lang/rust#141748

r? bjorn3
2025-06-02 23:56:54 +00:00
Nicholas Nethercote
8747ccbcdf Overhaul UsePath.
`UsePath` contains a `SmallVec<[Res; 3]>`. This holds up to three `Res`
results, one per namespace (type, value, or macro). `lower_import_res`
takes a `PerNS<Option<Res<NodeId>>>` result and lowers it into the
`SmallVec`. This is pretty weird. The input `PerNS` makes it clear which
`Res` belongs to which namespace, but the `SmallVec` throws that
information away.

And code that operates on the `SmallVec` tends to use iteration (or even
just grabbing the first entry!) without knowing which namespace the
`Res` belongs to. Even weirder! Also, `SmallVec` is an overly flexible
type to use here, because it can contain any number of elements (even
though it's optimized for 3 in this case).

This commit changes `UsePath` so it also contains a
`PerNS<Option<Res<HirId>>>`. This type preserves more information and is
more self-documenting. The commit also changes a lot of the use sites to
access the result for a particular namespace. E.g. if you're looking up
a trait, it will be in the `Res` for the type namespace if it's present;
it's silly to look in the `Res` for the value namespace or macro
namespace. Overall I find the new code much easier to understand.

However, some use sites still iterate. These now use `present_items`
because that filters out the `None` results.

Also, `redundant_pub_crate.rs` gets a bigger change. A
`UseKind:ListStem` item gets no `Res` results, which means the old `all`
call in `is_not_macro_export` would succeed (because `all` succeeds on
an empty iterator) and the `ListStem` would be ignored. This is what we
want, but was more by luck than design. The new code detects `ListStem`
explicitly. The commit generalizes the name of that function
accordingly.

Finally, the commit also removes the `use_path` arena, because
`PerNS<Option<Res>>` impls `Copy` (unlike `SmallVec`) and it can be
allocated in the arena shared by all `Copy` types.
2025-06-03 08:23:21 +10:00
bors
5d707b07e4 Auto merge of #141912 - Kobzol:rollup-wurlnsx, r=Kobzol
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#141767 (ci: use free runner for aarch64-gnu-llvm-19-1 PR job)
 - rust-lang/rust#141858 (Fix typo in `StructuralPartialEq` docs)
 - rust-lang/rust#141865 (Optionally don't steal the THIR)
 - rust-lang/rust#141874 (add f16_epsilon and f128_epsilon diagnostic items)
 - rust-lang/rust#141904 (test-float-parse: apply `cfg(not(bootstrap))`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-06-02 19:35:39 +00:00
bors
449c801783 Auto merge of #141906 - chenyukang:rollup-k6v59ty, r=chenyukang
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#141884 (allow macro_use as first segment)
 - rust-lang/rust#141885 ([RTE-484] Update SGX maintainers)
 - rust-lang/rust#141892 (Fix false positive lint error from no_implicit_prelude attr)
 - rust-lang/rust#141894 (rustc-dev-guide subtree update)
 - rust-lang/rust#141895 (tshepang has a new email)
 - rust-lang/rust#141897 (Fix citool tests when executed locally)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-06-02 16:15:30 +00:00
Tshepang Mbambo
10f2bcc957
Merge pull request #2443 from smanilov/patch-21
Simplify long sentence
2025-06-02 17:30:02 +02:00
Stan Manilov
e74c2b5225 Simplify long sentence 2025-06-02 17:52:34 +03:00
León Orell Valerian Liehr
9649a9c0c5
Merge pull request #2446 from fmease/fix-warning-blocks
Fix some warning blocks that contain Markdown
2025-06-02 16:27:47 +02:00
León Orell Valerian Liehr
0718d8f29f
Fix some warning blocks that contain Markdown
Contents inside of an HTML element only get interpreted as Markdown
(as opposed to HTML) if its separated from the HTML tags with line breaks.
2025-06-02 16:21:59 +02:00
Tshepang Mbambo
7fe7fdd71c
Merge pull request #2445 from smanilov/patch-23
Add title and toc to Async chapter
2025-06-02 16:18:44 +02:00
Tshepang Mbambo
f8e21d09fa
Merge pull request #2444 from smanilov/patch-22
Trivial: dedup word
2025-06-02 16:17:39 +02:00
Stan Manilov
63ecc0ed08
Add title and toc to Async chapter
This is standard for other chapters.
2025-06-02 17:16:29 +03:00
Stan Manilov
3b85b2f550
Trivial: dedup word 2025-06-02 17:02:34 +03:00
Jakub Beránek
44ba243252
Rollup merge of #141904 - jieyouxu:test-float-parse, r=Mark-Simulacrum
test-float-parse: apply `cfg(not(bootstrap))`

Prior to stage 0 redesign, `test-float-parse` ran against in-tree std but now it runs against beta std. `f16::FromStr` is only present in in-tree std and not yet beta std, so apply `cfg(not(bootstrap))` gating to unbrick `./x check --stage=0`.

Fixes rust-lang/rust#141900.

`./x check --stage=0` in CI is intended for follow-up.

r? `@Mark-Simulacrum` (or bootstrap/libs)
cc `@tgross35`
2025-06-02 15:19:20 +02:00
Jakub Beránek
b2743c7fb1
Rollup merge of #141874 - usamoi:eps, r=tgross35
add f16_epsilon and f128_epsilon diagnostic items

cc https://github.com/rust-lang/rust/issues/116909
r? ``@tgross35``
2025-06-02 15:19:19 +02:00
Jakub Beránek
f8e756b0eb
Rollup merge of #141865 - Nadrieril:dont-steal-thir, r=oli-obk
Optionally don't steal the THIR

The THIR being stolen is a recurrent pain for authors of rustc drivers. This makes it optional, so that the `thir_body` query can still be used after analysis of the crate has completed.
2025-06-02 15:19:19 +02:00
Jakub Beránek
aeb72a0669
Rollup merge of #141858 - zacryol:spe-docs-typo, r=aDotInTheVoid
Fix typo in `StructuralPartialEq` docs

`equialent` => `equivalent`
2025-06-02 15:19:18 +02:00
Jakub Beránek
2cb5b0deb9
Rollup merge of #141767 - marcoieni:free-pr-job, r=Kobzol
ci: use free runner for aarch64-gnu-llvm-19-1 PR job
2025-06-02 15:19:17 +02:00
Yukang
8f240de112
Rollup merge of #141897 - Kobzol:fix-citool-tests, r=marcoieni
Fix citool tests when executed locally

They couldn't be executed locally before due to some additional environment reads.

I also investigated the annoying rebuilds that we see on CI all the time, and they are caused by `ring`'s build script. It should be fixed in the next ring release (https://github.com/briansmith/ring/issues/2525), so we can just wait for that and then update `ring`.

r? `@marcoieni`
2025-06-02 20:57:44 +08:00
Yukang
ad00cbe860
Rollup merge of #141895 - tshepang:new-address, r=jieyouxu
tshepang has a new email
2025-06-02 20:57:43 +08:00
Yukang
a501cc7a19
Rollup merge of #141894 - tshepang:rdg-push, r=jieyouxu
rustc-dev-guide subtree update

r? `@ghost`
2025-06-02 20:57:42 +08:00
Yukang
1931272796
Rollup merge of #141892 - chenyukang:yukang-fix-141785-extern-crate, r=petrochenkov
Fix false positive lint error from no_implicit_prelude attr

Fixes rust-lang/rust#141785

r? `@petrochenkov`
2025-06-02 20:57:42 +08:00
Yukang
05ee4a3825
Rollup merge of #141885 - raoulstrackx:raoul/rte-484-update_sgx_maintainers, r=Noratrieb
[RTE-484] Update SGX maintainers

`@mzohreva` is no longer with Fortanix. We need to change the SGX maintainers accordingly.
2025-06-02 20:57:41 +08:00
Yukang
8d9fc03773
Rollup merge of #141884 - bvanjoi:issue-140255, r=petrochenkov
allow macro_use as first segment

Fixes rust-lang/rust#140255

This issue may raise a question: It's reasonable an external crate name or import target be legally named `macro_use`?
2025-06-02 20:57:41 +08:00
bors
2398bd60ef Auto merge of #141814 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update

r? `@Manishearth`
2025-06-02 12:56:24 +00:00
Jieyou Xu
8788b6a4ad
test-float-parse: apply cfg(not(bootstrap))
Prior to stage 0 redesign, `test-float-parse` ran against in-tree std
but now it runs against beta std. `f16::FromStr` were only present in
in-tree std and not yet beta std, so apply `cfg(not(bootstrap))` gating
to unbrick `./x check --stage=0`.
2025-06-02 20:45:14 +08:00
Jana Dönszelmann
8b5b6d053a
add fixme to improve error matching 2025-06-02 14:22:14 +02:00
Jakub Beránek
28cf702292
Fix citool tests when executed ocally
They couldn't be executed locally before due to some additional environment reads.
2025-06-02 13:34:29 +02:00
nora
d6cc62c8c5
Merge pull request #2440 from rust-lang/tshepang-patch-1
distracting indirection
2025-06-02 12:55:31 +02:00
Tshepang Mbambo
23285efeab
distracting indirection 2025-06-02 12:34:19 +02:00
Tshepang Mbambo
d243d370fb
Merge pull request #2439 from rust-lang/tshepang-offline-love
use a relative path, so that this also works offline
2025-06-02 12:31:25 +02:00
Tshepang Mbambo
a62b7c8300 use a relative path, so that this also works offline 2025-06-02 12:30:08 +02:00
Tshepang Mbambo
69e358393a tshepang has a new email 2025-06-02 12:13:08 +02:00
Tshepang Mbambo
c197636ca8
Merge pull request #2386 from Lysxia/fix-link
Fix link to GatherBorrows
2025-06-02 12:08:03 +02:00
Tshepang Mbambo
0e379a6082
Merge pull request #2435 from smanilov/patch-19
Add opaque type attributes
2025-06-02 11:55:19 +02:00