Commit graph

166435 commits

Author SHA1 Message Date
bors
f6092f224d Auto merge of #146892 - GuillaumeGomez:rollup-fa7lp0n, r=GuillaumeGomez
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#146795 (Enable `limit_rdylib_exports` on wasm targets)
 - rust-lang/rust#146828 (fix a crash in rustdoc merge finalize without input file)
 - rust-lang/rust#146848 (Add x86_64-unknown-motor (Motor OS) tier 3 target)
 - rust-lang/rust#146884 (Fix modification check of `rustdoc-json-types`)
 - rust-lang/rust#146887 (Remove unused #![feature(get_mut_unchecked)] in Rc and Arc examples)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-09-22 17:49:53 +00:00
Guillaume Gomez
4852e692cd
Rollup merge of #146884 - Kobzol:tidy-rustdoc-modified, r=GuillaumeGomez
Fix modification check of `rustdoc-json-types`

r? `@GuillaumeGomez`
2025-09-22 17:17:45 +02:00
Guillaume Gomez
090befc5e0
Rollup merge of #146848 - moturus:motor-os_tier-3, r=davidtwco
Add x86_64-unknown-motor (Motor OS) tier 3 target

Add the initial no-std Motor OS compiler target.

Motor OS has been developed for several years in the open: https://github.com/moturus/motor-os.

It has a more or less full implementation of Rust std library, as well as tokio/mio ports.

> A tier 3 target must have a designated developer or developers (the "target maintainers") on record to be CCed when issues arise regarding the target. (The mechanism to track and CC such developers may evolve over time.)

Ack. [U. Lasiotus](https://github.com/lasiotus) will maintain the target.

 > Targets must use naming consistent with any existing targets; for instance, a target for the same CPU or OS as an existing Rust target should use the same name for that CPU or OS. Targets should normally use the same names and naming conventions as used elsewhere in the broader ecosystem beyond Rust (such as in other toolchains), unless they have a very good reason to diverge. Changing the name of a target can be highly disruptive, especially once the target reaches a higher tier, so getting the name right is important even for a tier 3 target.

> Target names should not introduce undue confusion or ambiguity unless absolutely necessary to maintain ecosystem compatibility. For example, if the name of the target makes people extremely likely to form incorrect beliefs about what it targets, the name should be changed or augmented to disambiguate it.

> If possible, use only letters, numbers, dashes and underscores for the name. Periods (.) are known to cause issues in Cargo.

Ack. The new target is named `x86_64-unknown-motor`, as it represents Motor OS on x86_64.

> Tier 3 targets may have unusual requirements to build or use, but must not create legal issues or impose onerous legal terms for the Rust project or for Rust developers or users.

> The target must not introduce license incompatibilities.

> Anything added to the Rust repository must be under the standard Rust license (MIT OR Apache-2.0).

> The target must not cause the Rust tools or libraries built for any other host (even when supporting cross-compilation to the target) to depend on any new dependency less permissive than the Rust licensing policy. This applies whether the dependency is a Rust crate that would require adding new license exceptions (as specified by the tidy tool in the rust-lang/rust repository), or whether the dependency is a native library or binary. In other words, the introduction of the target must not cause a user installing or running a version of Rust or the Rust tools to be subject to any new license requirements.

Ack. Motor OS is dual-licensed under MIT and/or Apache-2.0.

> Compiling, linking, and emitting functional binaries, libraries, or other code for the target (whether hosted on the target itself or cross-compiling from another target) must not depend on proprietary (non-FOSS) libraries. Host tools built for the target itself may depend on the ordinary runtime libraries supplied by the platform and commonly used by other applications built for the target, but those libraries must not be required for code generation for the target; cross-compilation to the target must not require such libraries at all. For instance, rustc built for the target may depend on a common proprietary C runtime library or console output library, but must not depend on a proprietary code generation library or code optimization library. Rust's license permits such combinations, but the Rust project has no interest in maintaining such combinations within the scope of Rust itself, even at tier 3.

> "onerous" here is an intentionally subjective term. At a minimum, "onerous" legal/licensing terms include but are not limited to: non-disclosure requirements, non-compete requirements, contributor license agreements (CLAs) or equivalent, "non-commercial"/"research-only"/etc terms, requirements conditional on the employer or employment of any particular Rust developers, revocable terms, any requirements that create liability for the Rust project or its developers or users, or any requirements that adversely affect the livelihood or prospects of the Rust project or its developers or users.

> Neither this policy nor any decisions made regarding targets shall create any binding agreement or estoppel by any party. If any member of an approving Rust team serves as one of the maintainers of a target, or has any legal or employment requirement (explicit or implicit) that might affect their decisions regarding a target, they must recuse themselves from any approval decisions regarding the target's tier status, though they may otherwise participate in discussions.

> This requirement does not prevent part or all of this policy from being cited in an explicit contract or work agreement (e.g. to implement or maintain support for a target). This requirement exists to ensure that a developer or team responsible for reviewing and approving a target does not face any legal threats or obligations that would prevent them from freely exercising their judgment in such approval, even if such judgment involves subjective matters or goes beyond the letter of these requirements.

Ack.

> Tier 3 targets should attempt to implement as much of the standard libraries as possible and appropriate (core for most targets, alloc for targets that can support dynamic memory allocation, std for targets with an operating system or equivalent layer of system-provided functionality), but may leave some code unimplemented (either unavailable or stubbed out as appropriate), whether because the target makes it impossible to implement or challenging to implement. The authors of pull requests are not obligated to avoid calling any portions of the standard library on the basis of a tier 3 target not implementing those portions.

Motor OS has a functional implementation of the standard library: https://github.com/moturus/rust/tree/motor-os_stdlib, which will be the subject of a later PR.

> The target must provide documentation for the Rust community explaining how to build for the target, using cross-compilation if possible. If the target supports running binaries, or running tests (even if they do not pass), the documentation must explain how to run such binaries or tests for the target, using emulation if possible or dedicated hardware if necessary.

Building instructions for Motor OS: https://github.com/moturus/motor-os/blob/main/docs/build.md.

> Tier 3 targets must not impose burden on the authors of pull requests, or other developers in the community, to maintain the target. In particular, do not post comments (automated or manual) on a PR that derail or suggest a block on the PR based on a tier 3 target. Do not send automated messages or notifications (via any medium, including via `@)` to a PR author or others involved with a PR regarding a tier 3 target, unless they have opted into such messages.

Ack.

> Backlinks such as those generated by the issue/PR tracker when linking to an issue or PR are not considered a violation of this policy, within reason. However, such messages (even on a separate repository) must not generate notifications to anyone involved with a PR who has not requested such notifications.

> Patches adding or updating tier 3 targets must not break any existing tier 2 or tier 1 target, and must not knowingly break another tier 3 target without approval of either the compiler team or the maintainers of the other tier 3 target.

> In particular, this may come up when working on closely related targets, such as variations of the same architecture with different features. Avoid introducing unconditional uses of features that another variation of the target may not have; use conditional compilation or runtime detection, as appropriate, to let each target run code supported by that target.

Ack.

> Tier 3 targets must be able to produce assembly using at least one of rustc's supported backends from any host target. (Having support in a fork of the backend is not sufficient, it must be upstream.)

Motor OS uses the standard x86_64 rustc/llvm toolchain.

> If a tier 3 target stops meeting these requirements, or the target maintainers no longer have interest or time, or the target shows no signs of activity and has not built for some time, or removing the target would improve the quality of the Rust codebase, we may post a PR to remove it; any such PR will be CCed to the target maintainers (and potentially other people who have previously worked on the target), to check potential interest in improving the situation.

Ack.
2025-09-22 17:17:44 +02:00
Guillaume Gomez
de7065b7d8
Rollup merge of #146828 - el-ev:issue146646, r=GuillaumeGomez
fix a crash in rustdoc merge finalize without input file

- Closes rust-lang/rust#146646

`SerializedSearchIndex::union` calls `Symbol::intern`, requiring `SESSION_GLOBALS` to be set.
2025-09-22 17:17:43 +02:00
bors
ce4beebecb Auto merge of #146683 - clarfonthey:safe-intrinsics, r=RalfJung,Amanieu
Mark float intrinsics with no preconditions as safe

Note: for ease of reviewing, the list of safe intrinsics is sorted in the first commit, and then safe intrinsics are added in the second commit.

All *recently added* float intrinsics have been correctly marked as safe to call due to the fact that they have no preconditions. This adds the remaining float intrinsics which are safe to call to the safe intrinsic list, and removes the unsafe blocks around their calls.

---

Side note: this may want a try run before being added to the queue, since I'm not sure if there's any tier-2 code that uses these intrinsics that might not be tested on the usual PR flow. We've already uncovered a few places in subtrees that do this, and it's worth double-checking before clogging up the queue.
2025-09-22 14:35:46 +00:00
Jakub Beránek
870a98c7b3
Fix modification check of rustdoc-json-types 2025-09-22 14:14:48 +02:00
Stuart Cook
681da13a02
Rollup merge of #146838 - yotamofek:pr/rustdoc/wrappers, r=lolbinarycat
Introduce "wrapper" helpers to rustdoc

Add a few traits for streamlining places where we need to wrap certain `fmt::Display`s in stuff like parentheses or brackets.
Hopefully this makes the actual display logic slightly easier to read.

First two commits are small, unrelated cleanups.

I'll probably add some doc comments to the stuff in `display.rs`, maybe also play around with the API, but wanted to get feedback on this idea first.
2025-09-22 20:25:14 +10:00
Stuart Cook
46be365a60
Rollup merge of #146831 - taiki-e:powerpc-clobber, r=Amanieu
Support ctr and lr as clobber-only registers in PowerPC inline assembly

Follow-up to rust-lang/rust#131341.

CTR and LR are marked as volatile in all ABIs, but I skipped them in rust-lang/rust#131341 due to they are currently marked as reserved.
dd7fda5700/compiler/rustc_target/src/asm/powerpc.rs (L209-L212)

However, they are actually only unusable as input/output of inline assembly, and should be fine to support as clobber-only registers as discussed in [#t-compiler > ppc/ppc64 inline asm support](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/ppc.2Fppc64.20inline.20asm.20support/with/540413845).

r? ````@Amanieu```` or ````@workingjubilee````

cc ````@programmerjake````

````@rustbot```` label +O-PowerPC +A-inline-assembly
2025-09-22 20:25:14 +10:00
ltdk
055e05a338 Mark float intrinsics with no preconditions as safe 2025-09-21 20:37:51 -04:00
Yotam Ofek
20671600a2 Introduce "wrapper" helpers to rustdoc 2025-09-22 00:28:34 +03:00
Yotam Ofek
cdf96614cf Re-use some existing util fns 2025-09-21 23:54:57 +03:00
Yotam Ofek
c54a953402 Early return in visibility_print_with_space 2025-09-21 23:54:57 +03:00
Matthias Krüger
af315d3027
Rollup merge of #146606 - Enselic:test-test-args, r=Mark-Simulacrum
ci: x86_64-gnu-tools: Add `--test-args` regression test

See https://github.com/rust-lang/rust/pull/146601#issuecomment-3293179561

r? ``@Mark-Simulacrum``
2025-09-21 22:20:26 +02:00
Matthias Krüger
7148a4f543
Rollup merge of #143857 - Periodic1911:macro-export, r=jdonszelmann
Port #[macro_export] to the new attribute parsing infrastructure

Ports macro_export to the new attribute parsing infrastructure for https://github.com/rust-lang/rust/issues/131229#issuecomment-2971353197

r? ``@oli-obk``

cc ``@JonathanBrouwer`` ``@jdonszelmann``
2025-09-21 22:20:25 +02:00
U. Lasiotus
0138bbd495 Add x86_64-unknown-motor (Motor OS) tier 3 target
Add the initial no-std Motor OS compiler target.

Motor OS has been developed for several years in the open:
https://github.com/moturus/motor-os.

It has a more or less full implementation of Rust std library,
as well as tokio/mio ports.

Build instructions can be found here:
https://github.com/moturus/motor-os/blob/main/docs/build.md.

Signed-off-by: U. Lasiotus <lasiotus@motor-os.org>
2025-09-21 12:43:13 -07:00
Jonathan Brouwer
6abcadc235
Port #[macro_export] to the new attribute parsing infrastructure
Co-authored-by: Anne Stijns <anstijns@gmail.com>
2025-09-21 10:42:47 -04:00
Jakub Beránek
4c208f5c64
Implement output of colored messages with optional check context 2025-09-21 15:15:31 +02:00
Jakub Beránek
352fa3960a
Migrate the remaining tidy checks to diagnostics 2025-09-21 15:15:31 +02:00
Jakub Beránek
c36faff900
Add CheckId, migrate the alphabetical check to diagnostics 2025-09-21 15:13:01 +02:00
Jakub Beránek
b0010dd5ae
Add diagnostics context and migrate the style check to it 2025-09-21 15:13:01 +02:00
Taiki Endo
f4b876867d Support ctr and lr as clobber-only registers in PowerPC inline assembly 2025-09-21 13:48:22 +09:00
Iris Shi
b441b801fa
fix a crash in rustdoc merge finalize without input file 2025-09-21 11:46:42 +08:00
Matthias Krüger
f5725f0182
Rollup merge of #146774 - Kobzol:bootstrap-relative-path, r=jieyouxu
Allow running `x <cmd> <path>` from a different directory

Fixes: https://github.com/rust-lang/rust/issues/146772

r? ``@jieyouxu``
2025-09-20 17:55:05 +02:00
Matthias Krüger
8904ff135f
Rollup merge of #146762 - madsmtm:test-apple-sim, r=jieyouxu
Fix and provide instructions for running test suite on Apple simulators

The following now works:

```sh
./x test --host='' --target aarch64-apple-ios-sim --skip tests/debuginfo
./x test --host='' --target aarch64-apple-tvos-sim --skip tests/debuginfo
./x test --host='' --target aarch64-apple-watchos-sim --skip tests/debuginfo
./x test --host='' --target aarch64-apple-visionos-sim --skip tests/debuginfo
```

I have documented the setup I used [in the `rustc-dev-guide`](https://rustc-dev-guide.rust-lang.org/tests/running.html#testing-on-emulators), it's fairly standard use of `remote-test-server` (with a small fix to library load paths which I've made in the first commit).

I first tried the somewhat simpler `target.aarch64-apple-ios-sim.runner = "xcrun simctl spawn $UDID"`, but that doesn't work as required libraries etc. also need to be copied to the device.

The debuginfo tests fail, I think because the debug info in `.dSYM` isn't available. I am yet unsure exactly how to fix this, either we need to copy that directory to the target as well, or we need to configure `lldb` somehow to read it from the host.

I decided to not add this to our CI, since I suspect we wouldn't gain much from it? Running on the simulator still uses the host Darwin kernel, it's basically just configured to run in another mode with more restricted permissions and different system libraries.

r? jieyouxu
CC ``@simlay,`` you're a lot more familiar with `xcrun simctl` than I.
2025-09-20 17:55:04 +02:00
bors
9f2ef0f14d Auto merge of #146805 - lnicola:sync-from-ra, r=lnicola
`rust-analyzer` subtree update

Subtree update of `rust-analyzer` to 0c62c01aae.

Created using https://github.com/rust-lang/josh-sync.

r? `@ghost`
2025-09-20 11:17:44 +00:00
bors
b00998aaa5 Auto merge of #146771 - Kobzol:download-ci-llvm-default-value, r=jieyouxu
Simplify default value of `download-ci-llvm`

Just set it to true, rather than having different default values on CI and locally, and then only deny `true` on our own CI, not elsewhere.

Closes: https://github.com/rust-lang/rust/issues/146768

r? `@jieyouxu`
2025-09-20 08:04:38 +00:00
Laurențiu Nicola
4d8655e8d0 Bump rustc crates once more 2025-09-20 09:38:53 +03:00
Jakub Beránek
4b755141bc
Simplify default value of download-ci-llvm 2025-09-19 20:12:30 +02:00
Chayim Refael Friedman
300aee8239
Merge pull request #20701 from A4-Tacks/track-caller-assist-test
Add `#[track_caller]` for check_assist_by_label
2025-09-19 15:07:17 +00:00
Jakub Beránek
58814bce6c
Allow running x <cmd> <path> from a different directory 2025-09-19 16:21:34 +02:00
Shoyu Vanilla (Flint)
6ec196a748
Merge pull request #20697 from Oblarg/fix-negative-const-generic-literals
fix negative const generic integer literals
2025-09-19 14:13:54 +00:00
Oblarg
9ba9869b33 address review feedback 2025-09-19 10:03:14 -04:00
Shoyu Vanilla
bf5fe6e44c minor: Get rid of unused deps chalk-solve and chalk-recursive 2025-09-19 22:35:46 +09:00
Stuart Cook
5d404e05bc
Rollup merge of #146740 - RalfJung:miri, r=RalfJung
miri subtree update

Subtree update of `miri` to 5a142000d2.

Created using https://github.com/rust-lang/josh-sync.

r? ``@ghost``
2025-09-19 22:31:55 +10:00
Stuart Cook
a2c7008e15
Rollup merge of #146738 - beepster4096:widnows, r=jieyouxu
Fix tidy spellchecking on Windows

Tidy should now check for executable with the right extension for the platform when installing tools
2025-09-19 22:31:55 +10:00
Stuart Cook
743f70b6e8
Rollup merge of #146663 - erickt:win, r=wesleywiser
Allow windows resource compiler to be overridden

In rust-lang/rust#146018, it is now required to provide a resource compiler on windows when compiling rust. This allows toolchain builders to explicitly provide a path to an alternative, such as llvm-rc, instead of the one that's provided by the Windows SDK.

cc ```@lambdageek```
2025-09-19 22:31:53 +10:00
Stuart Cook
fe0b51939c
Rollup merge of #146484 - notriddle:stringdex-js-opt, r=GuillaumeGomez
rustdoc-search: JavaScript optimization based on Firefox Profiler output

Part of https://github.com/rust-lang/rust/issues/146048

Preview: https://notriddle.com/rustdoc-html-demo-12/stringdex-js-opt/std/index.html

These commits are based on some profiler readings, and should reduce CPU usage for name-based searching.

- The first commit improves warm searches by allocating less garbage when data is already loaded:

  Before: https://profiler.firefox.com/public/wvzd88m8r70p8frvz1z628tv3htwna0b9c0ef10/calltree/?globalTrackOrder=0w2&implementation=js&thread=3&v=11

  After: https://profiler.firefox.com/public/yfe9aq6ep3kacw3zmr7jqn6gv7ckfq86rg89568/calltree/?globalTrackOrder=0w2&implementation=js&thread=3&v=11

- The second commit improves cold searches by delaying load for special type names until type-based search runs

  Before: 5.86s (throttled to "Good 2G" in Dev Tools) <https://doc.rust-lang.org/nightly/std/index.html?search=>

  <img width="2524" height="919" alt="image" src="https://github.com/user-attachments/assets/8dbbbd46-b7ab-4e3c-9e8c-f1e41cfaa968" />

  After: 5.77s (throttled to "Good 2G" in Dev Tools) <https://notriddle.com/rustdoc-html-demo-12/stringdex-js-opt/std/index.html?search=>

  <img width="2524" height="912" alt="image" src="https://github.com/user-attachments/assets/6976a584-24f4-4d47-8118-7a81b22d411e" />

  For comparison's sake, the same test takes 12.17s on stable <https://doc.rust-lang.org/1.89.0/std/index.html?search=>

    <img width="2525" height="916" alt="image" src="https://github.com/user-attachments/assets/eb6df2e8-6632-4bef-a6d0-5179c6288fd0" />
2025-09-19 22:31:50 +10:00
Mads Marquart
b30c1b53f3 Document how to test with iOS/tvOS/watchOS/visionOS simulator 2025-09-19 13:55:02 +02:00
Mads Marquart
be01d87ba2 Allow running remote-test-server on Apple simulators 2025-09-19 10:52:53 +02:00
Ralf Jung
1db74d4845 fix miri bootstrap build 2025-09-19 09:02:03 +02:00
A4-Tacks
f69da33049
Add #[track_caller] for check_assist_by_label 2025-09-19 13:39:45 +08:00
Laurențiu Nicola
6870e24fdb Set WithCachedTypeInfo::stable_hash when in-tree 2025-09-19 08:08:23 +03:00
Oblarg
47d6936c7d fix negative const generic integer literals 2025-09-18 18:55:13 -04:00
Ralf Jung
11ffdb54f6
Merge pull request #4592 from RalfJung/sqrt
implement sqrt for f16 and f128
2025-09-18 20:47:26 +00:00
beepster4096
45e5c765c6 fix tidy spellchecking on windows 2025-09-18 13:17:39 -07:00
Ralf Jung
77f2d86554 share sqrt implemention across float types 2025-09-18 22:17:29 +02:00
Ralf Jung
f19b560fa9 implement sqrt for f16 and f128 2025-09-18 22:02:46 +02:00
Ralf Jung
045e5e3586
Merge pull request #4583 from Patrick-6/miri-genmc-estimation
Add GenMC estimation mode.
2025-09-18 19:40:26 +00:00
Shoyu Vanilla
01cd04f78d fix: Fix one more thing in in-rust-tree 2025-09-19 04:20:24 +09:00
Ralf Jung
00bfe9ce6e tweak genmc error report note 2025-09-18 20:41:06 +02:00