306566 Commits

Author SHA1 Message Date
Iris Shi
9ae7aef06d
prevent line number from being copied in chrome 2025-09-23 13:26:19 +08:00
bit-aloo
aaa82aea05
move config check logic from get_toml to parse_inner 2025-09-23 09:02:30 +05:30
Ben Kimock
4c1595a93b Skip the panic-immediate-abort-works test when cross-compiling 2025-09-22 21:13:38 -04:00
Josh Stone
389a502ade Fix a dangling reference in rustc_thread_pool 2025-09-22 14:04:04 -07:00
cyrgani
60f60127e7 add regression test for issue 146537 2025-09-22 22:02:24 +02:00
binarycat
82c4018619 fix ICE in rustdoc::invalid_html_tags 2025-09-22 14:57:36 -05:00
Peter Lyons Kehl
819f8b05b9 Mutex/RwLock/ReentrantLock::data_ptr to be const fn 2025-09-22 12:51:50 -07:00
Alex
2d18c886f5 Fix a crash/mislex when more than one frontmatter closing possibility is considered 2025-09-22 15:10:41 -04:00
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
rustbot
5e7d346364 Update books 2025-09-22 19:01:13 +02:00
Ralf Jung
0d906b746a
Merge pull request #4600 from RalfJung/sifa
fix SIFA logic
2025-09-22 16:37:24 +00:00
Martin Nordholts
2dc1354cd0 tests/run-make/crate-loading: Rename source files for clarity
To make the code easier to understand.
2025-09-22 18:18:36 +02:00
Ralf Jung
293e0a3aa0 fix SIFA logic 2025-09-22 18:08:17 +02:00
Iris Shi
bd98e73fe0
Update tests/rustdoc/reexport/private-mod-override-reexport.rs 2025-09-22 17:45:51 +02:00
Guillaume Gomez
9814d08545
Rollup merge of #146887 - taiki-e:rc-doc-feature, r=joboet
Remove unused #![feature(get_mut_unchecked)] in Rc and Arc examples

https://github.com/rust-lang/rust/pull/93109 removed the use of APIs enabled by this feature in these examples, but the `#![feature]` attributes ware not removed.
2025-09-22 17:17:46 +02: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
Guillaume Gomez
dc176bd216
Rollup merge of #146795 - alexcrichton:wasm-limit-rdylib-exports, r=bjorn3
Enable `limit_rdylib_exports` on wasm targets

This commit updates the target specification of wasm targets to set the `limit_rdylib_exports` value to `true` like it is on other native platforms. This was originally not implemented long ago as `wasm-ld` didn't have options for symbol exports, but since then it's grown a `--export` flag and such to control this. A custom case is needed in the linker implementation to handle wasm targets as `wasm-ld` doesn't support linker scripts used on other targets, but other than that the implementation is straightforward.

The goal of this commit is enable building dynamic libraries on `wasm32-wasip2` which don't export every single symbol in the Rust standard library. Currently, without otherwise control over symbol visibility, all symbols end up being exported which generates excessively large binaries because `--gc-sections` ends up doing nothing as it's all exported anyway.
2025-09-22 17:17:42 +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
Tshepang Mbambo
70f3768fb8
Merge pull request #2593 from rust-lang/tshepang/testing-with-ci
various improvements resulting from reading Testing with CI
2025-09-22 16:33:40 +02:00
Tshepang Mbambo
1e2594f94f various improvements resulting from reading Testing with CI 2025-09-22 16:32:50 +02:00
Tshepang Mbambo
45f891d832
Merge pull request #2596 from rust-lang/tshepang/sembr
reduce overlong lines
2025-09-22 16:27:31 +02:00
Tshepang Mbambo
62b2bd5809 reduce overlong lines 2025-09-22 16:26:27 +02:00
Nathaniel McCallum
5dde557fc4 constify {float}::total_cmp() 2025-09-22 10:24:39 -04:00
Tshepang Mbambo
391a2ea868
Merge pull request #2595 from rust-lang/rustc-pull
Rustc pull update
2025-09-22 16:18:39 +02:00
bit-aloo
83b784fda1
add comment explaining the test_build_dir 2025-09-22 18:54:23 +05:30
Ralf Jung
bd5e7e59f8
Merge pull request #4599 from RalfJung/nondet
share non-det test helpers and increase iteration counts
2025-09-22 13:19:24 +00:00
bit-aloo
8a0e3808c0
add check for toml file 2025-09-22 18:46:18 +05:30
Taiki Endo
823337a4ad Remove unused #![feature(get_mut_unchecked)] in Rc and Arc examples 2025-09-22 22:15:25 +09:00
Ralf Jung
37de09fed9 share the check_nondet helper as well 2025-09-22 14:52:35 +02:00
Ralf Jung
a25896bc27 share check_all_outcomes impl, and increase max iteration counts 2025-09-22 14:52:35 +02:00
Iris Shi
42ebba214b
address review comments 2025-09-22 20:36:18 +08:00
bit-aloo
6adbb3a189
remove explicit target assignment in config during rustc initialization 2025-09-22 18:06:07 +05:30
Jakub Beránek
870a98c7b3
Fix modification check of rustdoc-json-types 2025-09-22 14:14:48 +02:00
Ralf Jung
5caffb1830
Merge pull request #4595 from RalfJung/tb-terms
TB: update terminology to match paper & MiniRust
2025-09-22 11:50:27 +00:00
bors
29005cb128 Auto merge of #146879 - Zalathar:rollup-vm97j8b, r=Zalathar
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#145411 (regression test for Cow<[u8]> layout)
 - rust-lang/rust#146397 (std_detect on Darwin AArch64: update features)
 - rust-lang/rust#146791 (emit attribute for readonly non-pure inline assembly)
 - rust-lang/rust#146831 (Support ctr and lr as clobber-only registers in PowerPC inline assembly)
 - rust-lang/rust#146838 (Introduce "wrapper" helpers to rustdoc)
 - rust-lang/rust#146845 (Add self-profile events for target-machine creation)
 - rust-lang/rust#146846 (btree InternalNode::new safety comments)
 - rust-lang/rust#146858 (Make mips64el-unknown-linux-muslabi64 link dynamically)
 - rust-lang/rust#146878 (assert_unsafe_precondition: fix some incorrect check_language_ub)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-09-22 11:15:49 +00:00
Reuben Cruise
06819d95c0 Extends branch protection tests to include GCS 2025-09-22 11:29:54 +01:00
Stuart Cook
8f80707bc5
Rollup merge of #146878 - RalfJung:check_language_ub, r=tgross35
assert_unsafe_precondition: fix some incorrect check_language_ub

r? `@tgross35`
2025-09-22 20:25:17 +10:00
Stuart Cook
a5e1ab590b
Rollup merge of #146858 - Gelbpunkt:mips64el-musl-dynamic, r=jieyouxu
Make mips64el-unknown-linux-muslabi64 link dynamically

I missed this target when I changed all the other tier 3 targets in https://github.com/rust-lang/rust/pull/144410. Only realized that this one was still statically linked when I looked at the list of targets in the test later (https://github.com/rust-lang/rust/pull/146588).

since those two PRs were reviewed by you:
r? ````@jieyouxu````
2025-09-22 20:25:17 +10:00
Stuart Cook
8cf94b6c82
Rollup merge of #146846 - hkBst:btree-2, r=tgross35
btree InternalNode::new safety comments
2025-09-22 20:25:16 +10:00
Stuart Cook
7b6553c746
Rollup merge of #146845 - Zalathar:prof-target-machine, r=Kobzol
Add self-profile events for target-machine creation

These code paths are surprisingly hot in the `large-workspace` benchmark (e.g. see perf changes from rust-lang/rust#146700), suggesting room for more improvement. It would be handy to see some detailed timings and execution counts.
2025-09-22 20:25:15 +10: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
Stuart Cook
40db498a0f
Rollup merge of #146791 - folkertdev:readonly-not-pure, r=nikic,joshtriplett
emit attribute for readonly non-pure inline assembly

fixes https://github.com/rust-lang/rust/issues/146761

Provide a better `MemoryEffects` to LLVM when an inline assembly block specifies `readonly` but not `pure`. That means that the assembly block may not perform any writes, but that there still may be side effects from its instructions.

I haven't been able to find a case yet where this actually matters, though. So the test checks that the right attribute is applied, but the generated assembly is equivalent to not specifying `readonly` at all.

r? ````@nikic````
cc ````@Amanieu````
2025-09-22 20:25:13 +10:00
Stuart Cook
d144638f89
Rollup merge of #146397 - pthariensflame:patch-1, r=Amanieu
std_detect on Darwin AArch64: update features

Synchronizes the list (and re-sorts it alphabetically by `FEAT` name) with the initial release version of macOS Tahoe.
2025-09-22 20:25:12 +10:00
Stuart Cook
8c0c53791b
Rollup merge of #145411 - the8472:cows-have-no-branches, r=Mark-Simulacrum
regression test for Cow<[u8]> layout

requested by ralf in https://github.com/rust-lang/rust/issues/117763#issuecomment-3126080834
2025-09-22 20:25:12 +10:00
Iris Shi
ba2537b6ff
add exit code check 2025-09-22 18:09:10 +08:00
Ralf Jung
bbe05dcbdf Tree::new_child: remove SIFA precondition and sync terminology 2025-09-22 11:54:43 +02:00
Ralf Jung
1c316023d6 TB: rename Active → Unique to match paper 2025-09-22 11:49:45 +02:00