about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2025-08-30native-lib mode: avoid unsoundness due to mrpotectRalf Jung-17/+13
2025-08-30Auto merge of #123319 - no92:managarm-target, r=davidtwcobors-3/+63
Add managarm as a tier 3 target This PR aims to introduce the `x86_64-unknown-managarm-mlibc` as a tier 3 target to Rust. [managarm](https://github.com/managarm/managarm) is a microkernel with fully asynchronous I/O that also provides a POSIX server. Despite the differences, managarm provides good compatability with POSIX and Linux APIs. As a rule of thumb, barring OS-specific code, it should be mostly source-compatible with Linux. We have been shipping a patched rust for over 25 releases now, and we would like to upstream our work. For a smoother process, this PR only adds the target to rustc and some documentation. `std` support will be added in a future PR. ## Addressing the tier 3 target policy > 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.) `@no92,` `@64` and `@Dennisbonke` will be target maintainers. > 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. `x86_64-unknown-managarm-mlibc` is what we use for LLVM as well. > 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. > - 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. [managarm](https://github.com/managarm/managarm) is licensed as MIT. No dependencies were added. > 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. Understood. None of the listed maintainers are on a Rust team. > 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. Support for `std` will be provided in a future PR. Only minor changes are required, however they depend on support in the `libc` crate which will be PRed in soon. > 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. The steps needed to take are described in the documentation provided with this PR. > 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. > - 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. Understood. > 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. We have no indication that anything breaks due to this PR. > Tier 3 targets must be able to produce assembly using at least one of rustc's supported backends from any host target. No problems here, as we target `x86_64`. r? compiler-team
2025-08-30Merge ref 'e004014d1bf4' from rust-lang/rustThe Miri Cronjob Bot-351/+443
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: e004014d1bf4c29928a0f0f9f7d0964d43606cbd Filtered ref: d62798e442c1c6ec461725b87dacc87c285259c8 This merge was created using https://github.com/rust-lang/josh-sync.
2025-08-30Prepare for merging from rust-lang/rustThe Miri Cronjob Bot-1/+1
This updates the rust-version file to e004014d1bf4c29928a0f0f9f7d0964d43606cbd.
2025-08-29Rollup merge of #146000 - GuillaumeGomez:rustdoc-error-improvement, r=notriddleTrevor Gross-1/+3
Improve librustdoc error when a file creation/modification failed The message before looks like this: ``` failed to create or modify "/build/x86_64-unknown-linux-gnu/test/rustdoc-gui/doc/search.index/entry/" ``` And with this change it looks like this: ``` failed to create or modify "/build/x86_64-unknown-linux-gnu/test/rustdoc-gui/doc/search.index/entry/": failed to read column from disk: data consumer error: missing field `unknown number` at line 1 column 8 ``` r? ``````@lolbinarycat``````
2025-08-29Rollup merge of #145756 - okaneco:stabilize_char_boundary, r=scottmcmTrevor Gross-18/+16
str: Stabilize `round_char_boundary` feature Closes https://github.com/rust-lang/rust/issues/93743 FCP completed https://github.com/rust-lang/rust/issues/93743#issuecomment-3168382171
2025-08-29Rollup merge of #145467 - Kivooeo:stabilize-strict_provenance_atomic_ptr, ↵Trevor Gross-1/+0
r=scottmcm Stabilize `strict_provenance_atomic_ptr` feature This closes [tracking issue](https://github.com/rust-lang/rust/issues/99108) and stabilises `AtomicPtr::{fetch_ptr_add, fetch_ptr_sub, fetch_byte_add, fetch_byte_sub, fetch_or, fetch_and, fetch_xor}` --- EDIT: FCP completed at https://github.com/rust-lang/rust/issues/99108#issuecomment-3168260347
2025-08-29Bump tracing-subscriber from 0.3.19 to 0.3.20dependabot[bot]-2/+2
Bumps [tracing-subscriber](https://github.com/tokio-rs/tracing) from 0.3.19 to 0.3.20. - [Release notes](https://github.com/tokio-rs/tracing/releases) - [Commits](https://github.com/tokio-rs/tracing/compare/tracing-subscriber-0.3.19...tracing-subscriber-0.3.20) --- updated-dependencies: - dependency-name: tracing-subscriber dependency-version: 0.3.20 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
2025-08-29Bump tracing-subscriber from 0.3.19 to 0.3.20dependabot[bot]-3/+3
Bumps [tracing-subscriber](https://github.com/tokio-rs/tracing) from 0.3.19 to 0.3.20. - [Release notes](https://github.com/tokio-rs/tracing/releases) - [Commits](https://github.com/tokio-rs/tracing/compare/tracing-subscriber-0.3.19...tracing-subscriber-0.3.20) --- updated-dependencies: - dependency-name: tracing-subscriber dependency-version: 0.3.20 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
2025-08-29Merge pull request #4371 from CraftSpider/duplicate-handle-testRalf Jung-9/+46
Add shim test for `DuplicateHandle`
2025-08-29Add duplicate handle test + make null lpTargetHandle an abort, not an ↵Rune Tynan-9/+46
unsupported.
2025-08-29Update mdbookEric Huss-1/+1
This updates mdbook to 0.4.52, which includes a number of fixes and enhancements since 0.4.48. Changelog: https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-0452
2025-08-29Auto merge of #145997 - matthiaskrgr:rollup-tsgylre, r=matthiaskrgrbors-83/+30
Rollup of 4 pull requests Successful merges: - rust-lang/rust#145675 (Rehome 30 `tests/ui/issues/` tests to other subdirectories under `tests/ui/` [rust-lang/rust#1 of Batch rust-lang/rust#2]) - rust-lang/rust#145676 (Rehome 30 `tests/ui/issues/` tests to other subdirectories under `tests/ui/` [rust-lang/rust#2 of Batch rust-lang/rust#2]) - rust-lang/rust#145982 (compiletest: Reduce the number of `println!` calls that don't have access to `TestCx`) - rust-lang/rust#145984 (`TokenStream` cleanups) r? `@ghost` `@rustbot` modify labels: rollup
2025-08-29Update getopts to remove unicode-width dependencybjorn3-1/+0
2025-08-29Improve librustdoc error when a file creation/modification failedGuillaume Gomez-1/+3
2025-08-29Merge pull request #4545 from RalfJung/zst-readwriteRalf Jung-9/+28
unix read/write: fix zero-size handling
2025-08-29unix read/write: fix zero-size handlingRalf Jung-9/+28
2025-08-29Auto merge of #145902 - Kobzol:dist-docs-build-compiler, r=jieyouxubors-80/+127
Avoid more rustc rebuilds in cross-compilation scenarios This is a continuation of https://github.com/rust-lang/rust/pull/145874. It adds a `compiler_for_std` function, which is a slimmed down version of `compiler_for`, which is much simpler, and designed to be used only for the standard library. The build, dist and doc steps somtimes work with a stage2 std for a given target. That currently requires building a stage2 host compiler. However, if we uplift the stage1 libstd anyway, that is wasteful, in particular when we are cross-compiling. The last two commits progressively make the stage 2 host rustc build avoidance more and more aggressive. I think that if we decide that it is fine to ship stage1 libstd everywhere, then it makes sense to go all the way. When we ship stuff, we always build it with the stage 1 compiler (e.g. we ship stage 2 rustc which is built with stage 1 rustc). Libstd is the only component where stage N is built with the stage N compiler. So I think that shipping stage 1 libstd is "enough", and we could thus optimize what gets built on CI. r? `@jieyouxu`
2025-08-29Rollup merge of #145982 - Zalathar:logv, r=jieyouxuMatthias Krüger-83/+30
compiletest: Reduce the number of `println!` calls that don't have access to `TestCx` In order to stop using `#![feature(internal_output_capture)]` in compiletest, we need to be able to capture the console output of individual tests run by the executor. The approach I have planned is to have all test runners print “console” output into a trait object that is passed around as part of `TestCx`, since almost all test-runner code has easy access to that context. So `println!("foo")` will become `writeln!(self.stdout, "foo")`, and so on. In order to make that viable, we need to avoid unnecessary printing in places that don't have easy access to `TestCx`. To do so, we can either get rid of unnecessary print statements, or rearrange the code to make the context available. This PR uses both approaches. r? jieyouxu
2025-08-29Merge pull request #20560 from ChayimFriedman2/analysis-stats-improveLukas Wirth-3/+52
fix: Add progress bars to more places in analysis-stats
2025-08-29Don't print captures in `TestCx::normalize_platform_differences`Zalathar-7/+4
This appears to have been leftover debugging code. If the capture information turns out to have still been useful, we can find a way to emit it in a way that doesn't interfere with overhauling compiletests's output capture system.
2025-08-29Move module `compute_diff` into `compiletest::runtest`Zalathar-5/+4
The code in this module is always called in the context of running an individual tests, and sometimes prints output that needs to be captured. Moving this module into `runtest` will make it easier to find and audit all of the print statements that need to be updated when overhauling output-capture.
2025-08-29Change the `logv` function into a `TestCx` method.Zalathar-23/+19
When working on a new output-capture system, this will make it easier to obtain a capturing stream from the test context.
2025-08-29Don't bother logging an arbitrary subset of the compiletest configZalathar-48/+3
Running `./x --verbose` will still print out the command-line arguments, and setting `RUST_LOG=compiletest` will now log the full config instead of a subset.
2025-08-29Rollup merge of #145947 - nnethercote:workspace-members-2, r=KobzolStuart Cook-21/+21
Add more to the `[workspace.dependencies]` section in the top-level `Cargo.toml` Following on from rust-lang/rust#145740. r? `@Kobzol`
2025-08-29doc: Add `*-unknown-managarm-mlibc` documentationno92-0/+57
2025-08-29compiler: Add `{x86_64,aarch64,riscv64gc}-unknown-managarm-mlibc` targetsno92-0/+3
Co-authored-by: Dennis Bonke <dennis@managarm.org>
2025-08-28std: Start supporting WASIp2 nativelyAlex Crichton-1/+5
This commit is the start of an effort to support WASIp2 natively in the standard library. Before this commit the `wasm32-wasip2` target behaved exactly like `wasm32-wasip1` target by importing APIs from the core wasm module `wasi_snapshot_preview1`. These APIs are satisfied by the `wasm-component-ld` target by using an [adapter] which implements WASIp1 in terms of WASIp2. This adapter comes at a cost, however, in terms of runtime indirection and instantiation cost, so ideally the adapter would be removed entirely. The purpose of this adapter was to provide a smoother on-ramp from WASIp1 to WASIp2 when it was originally created. The `wasm32-wasip2` target has been around for long enough now that it's much more established. Additionally the only thing historically blocking using WASIp2 directly was implementation effort. Work is now underway to migrate wasi-libc itself to using WASIp2 directly and now seems as good a time as any to migrate the Rust standard library too. Implementation-wise the milestones here are: * The `wasm32-wasip2` target now also depends on the `wasi` crate at version 0.14.* in addition to the preexisting dependency of 0.11.*. The 0.14.* release series binds WASIp2 APIs instead of WASIp1 APIs. * Some preexisting naming around `mod wasi` or `wasi.rs` was renamed to `wasip1` where appropriate. For example `std::sys::pal::wasi` is now called `std::sys::pal::wasip1`. * More platform-specific WASI modules are now split between WASIp1 and WASIp2. For example getting the current time, randomness, and process arguments now use WASIp2 APIs directly instead of using WASIp1 APIs that require an adapter. It's worth pointing out that this PR does not migrate the entire standard library away from using WASIp1 APIs on the `wasm32-wasip2` target. Everything related to file descriptors and filesystem APIs is still using WASIp1. Migrating that is left for a future PR. In the meantime the goal of this change is to lay the groundwork necessary for migrating in the future. Eventually the goal is to drop the `wasi` 0.11.* dependency on the `wasm32-wasip2` target (the `wasm32-wasip1` target will continue to retain this dependency). [adapter]: https://github.com/bytecodealliance/wasmtime/blob/main/crates/wasi-preview1-component-adapter/README.md
2025-08-28Add a sanity check to bootstrap for wasm-component-ldAlex Crichton-0/+10
For `wasm32-wasip2`-and-beyond this tool is required, so in case it's disabled in `config.toml` add a sanity-check that it's present in the environment.
2025-08-28bootstrap: bump cc-rs to 1.2.28no92-3/+3
2025-08-28Merge pull request #2553 from ali90h/fix-stab-guide-gating-v2jyn-1/+1
stabilization_guide: fix macro name and syntax in gating example
2025-08-28Merge pull request #2556 from ali90h/date-sweep-2025-08-diag-testsjyn-9/+9
dates: refresh diagnostics/ and tests/ annotated dates to August 2025
2025-08-28Merge pull request #2559 from ali90h/date-sweep-2025-08-types-traitsjyn-9/+9
dates: refresh type system & traits date annotations to Aug/2025
2025-08-28Merge pull request #2558 from ali90h/date-sweep-2025-08-queriesjyn-3/+3
dates: refresh query-system date annotations to 2025-08 (preserve style)
2025-08-28When mapping next-solver's `dyn` type, add `Self` (aka. bound var ^1.0) to ↵Chayim Refael Friedman-1/+70
auto traits' substitutions Chalk represents dyn types as a list of predicate, the self type should be there. The next solver represents them quite differently. The `Self` was forgotten for the auto trait case.
2025-08-28Rollup merge of #145920 - Zalathar:failure-stdout, r=jieyouxuGuillaume Gomez-1/+7
bootstrap: Explicitly mark the end of a failed test's captured output While working on some compiletest stuff, I noticed that when bootstrap prints a failed test's captured output, there's no indication of where that output actually ends. In addition to indicating where the captured output ends, this end marker also makes it easier to see the relevant test name when scrolling upwards in terminal output.
2025-08-28Rollup merge of #142472 - GuillaumeGomez:doc-attribute-attribute, r=fmeaseGuillaume Gomez-26/+126
Add new `doc(attribute = "...")` attribute Fixes rust-lang/rust#141123. The implementation and purpose of this new `#[doc(attribute = "...")]` attribute is very close to `#[doc(keyword = "...")]`. Which means that luckily for us, most of the code needed was already in place and `@Noratrieb` nicely wrote a first draft that helped me implement this new attribute very fast. Now with all this said, there is one thing I didn't do yet: adding a `rustdoc-js-std` test. I added GUI tests with search results for attributes so should be fine but I still plan on adding one for it once documentation for builtin attributes will be written into the core/std libs. You can test it [here](https://rustdoc.crud.net/imperio/doc-attribute-attribute/foo/index.html). cc `@Noratrieb` `@Veykril`
2025-08-28dates(types,traits): refresh date-check annotations for Aug/2025-08; ↵Ali Nazzal-9/+9
preserve local style
2025-08-28dates(queries): refresh date-check annotations to 2025-08; preserve local styleAli Nazzal-3/+3
2025-08-28Create new `Item::is_fake_item` method as equivalent to check for ↵Guillaume Gomez-2/+13
`is_primitive`, `is_keyword` and `is_attribute` methods
2025-08-28Add documentation for `doc(attribute = "...")` attributeGuillaume Gomez-1/+18
2025-08-28Don't require a full `InferenceTable` for `CastTy`Chayim Refael Friedman-59/+52
A DB is enough.
2025-08-28dates(infra): refresh date-check annotations for Aug 2025; preserve local styleAli Nazzal-12/+12
2025-08-28Add progress bars to more places in analysis-statsChayim Refael Friedman-3/+52
Namely, mir lowering, const eval and IDE things.
2025-08-28Add new `doc(attribute = "...")` attributeGuillaume Gomez-25/+97
2025-08-28Merge pull request #4539 from Stypox/tracing-docsRalf Jung-0/+292
Add documentation for tracing
2025-08-28Rollup merge of #145953 - robertbastian:master, r=ManishearthStuart Cook-6/+6
Update `icu_list` to 2.0 This updates the `icu_list` crate, which is used for error formatting, from 1.5 to 2.0.
2025-08-28Rollup merge of #145926 - Zalathar:no-libtest, r=jieyouxuStuart Cook-90/+53
compiletest: Remove several remnants of the old libtest-based executor I noticed a few bits of low-hanging cleanup that are possible now that the non-libtest executor is well and truly established.
2025-08-28Add documentation for tracingStypox-0/+292
2025-08-28Add `rustc-demangle` to `[workspace.dependencies]`.Nicholas Nethercote-1/+1