about summary refs log tree commit diff
path: root/src/doc
AgeCommit message (Collapse)AuthorLines
2025-09-06reduce overlong physical lines (sembr)Tshepang Mbambo-20/+51
2025-09-06capitalize "zulip"Tshepang Mbambo-7/+7
2025-09-06Zulip streams have been renamed to channelsTshepang Mbambo-11/+11
https://blog.zulip.com/2024/07/25/zulip-9-0-released
2025-09-05Rollup merge of #145735 - joshtriplett:style-guide-trailing-whitespace, ↵León Orell Valerian Liehr-2/+10
r=joshtriplett style-guide: Document absence of trailing whitespace We didn't previously have a blanket prohibition on trailing whitespace. Adding one, inspired by discussion in https://github.com/rust-lang/rust/pull/145617 .
2025-09-05Rollup merge of #139113 - folkertdev:sanitizer-unstable-book-check-block, ↵León Orell Valerian Liehr-16/+16
r=rcvalle unstable book: in a sanitizer example, check the code Use some `#` directives to make sure the code checks on x86_64, and does not produce errors on other platforms. This example still used an older version of `#[naked]`, and because the snippet was ignored that was missed before. I'm not sure when this gets built on CI exactly, so it might be worthwhile to try and build it for a non-x86_64 architecture to make sure that works. I'm not sure how to verify locally that e.g. on aarch64 this code works without errors/warnings. try-job: aarch64-apple try-job: x86_64-msvc-2
2025-09-05Merge pull request #2422 from aDotInTheVoid/tenthousandyearsAlona Enraght-Moony-2/+84
Start documenting tests/rustdoc-json
2025-09-05Better linkAlona Enraght-Moony-1/+1
2025-09-05Consistent punctuationAlona Enraght-Moony-4/+4
2025-09-05Make footnote render correctly in githubAlona Enraght-Moony-2/+2
2025-09-05Update renamed `take_region_var_origins`Ada Alakbarova-2/+2
This was first renamed to `get_region_var_origins` in https://github.com/rust-lang/rust/pull/109753, and then to `get_region_var_infos` in https://github.com/rust-lang/rust/commit/b0fc1d47d5dcffb5d516059d4a5af3b6843132d5
2025-09-05Update link to `resolve_regions_and_report_errors`Ada Alakbarova-1/+1
Moved into `ObligationCtxt` in https://github.com/rust-lang/rust/commit/a19adefa0e5aca0aabca2430530577ee140e4efa
2025-09-05rustc-dev-guide: update docs for `run-make-cargo`Jieyou Xu-30/+39
2025-09-05avoid inline external linksTshepang Mbambo-3/+4
2025-09-05sembrTshepang Mbambo-3/+9
2025-09-05clarify typo pr guidanceTshepang Mbambo-2/+4
2025-09-04Fix user facing stringEmmet Horgan-2/+2
Signed-off-by: Emmet Horgan <emmet.horgan@analog.com>
2025-09-04Update src/compiler-debugging.md emmet-horgan-1/+1
Change to public abi Co-authored-by: Tshepang Mbambo <hopsi@tuta.io>
2025-09-04Update src/appendix/code-index.md emmet-horgan-1/+1
Fix display string Co-authored-by: Tshepang Mbambo <hopsi@tuta.io>
2025-09-04Rollup merge of #145682 - dpaoliello:arm64tier1, r=jieyouxuJacob Pratt-5/+2
Promote aarch64-pc-windows-msvc to Tier 1 Per <https://github.com/rust-lang/rfcs/pull/3817> Tracking issue: <https://github.com/rust-lang/rust/issues/145671>
2025-09-04Rollup merge of #146127 - Kobzol:rename-tool-rustc, r=jieyouxuStuart Cook-5/+2
Rename `ToolRustc` to `ToolRustcPrivate` I think that this name gets the point across much better. r? ````@jieyouxu````
2025-09-04Rollup merge of #146112 - scrabsha:push-utkysktvulto, r=WaffleLapkinStuart Cook-1/+1
don't uppercase error messages
2025-09-03Fix some broken linksEmmet Horgan-9/+9
Signed-off-by: Emmet Horgan <horgan098@gmail.com>
2025-09-04fix: offline rustdoc html missing faviconKumar Ujjawal-2/+4
2025-09-03don't uppercase error messagesSasha Pourcelot-1/+1
a more general version of https://github.com/rust-lang/rust/pull/146080. after a bit of hacking in [`fluent.rs`](https://github.com/rust-lang/rust/blob/master/compiler/rustc_fluent_macro/src/fluent.rs), i discovered that i'm not the only one that is bad at following guidelines :sweat_smile:. this pr lowercases the first letter of all the error messages in the codebase. (i did not change things that are traditionally uppercased such as _MIR_, _ABI_ or _C_) i think it's reasonable to run a `@bors try` so all the test suite is checked, as i cannot run some of the tests on my machine. i double checked (and replaced manually) all the old error messages, but better be safe than sorry. in the future i will try to add a check in `x test tidy` that errors if an error message starts with an uppercase letter.
2025-09-03unstable book: in a sanitizer example, check the codeFolkert de Vries-16/+16
this uses some # directives to make sure the code works on x86_64, and does not produce errors on other platforms
2025-09-03Add note about trailing whitespace in string literals.Josh Triplett-1/+4
2025-09-03Rename `ToolRustc` to `ToolRustcPrivate`Jakub Beránek-5/+2
2025-09-02Rollup merge of #146115 - hax0kartik:master, r=lqdGuillaume Gomez-0/+1
Add maintainer for VxWorks Hi, This adds me as a target maintainer for VxWorks. I am currently a member of the VxWorks compiler team and I am actively working on improving rust support for VxWorks. Thanks!
2025-09-02Rollup merge of #144066 - RalfJung:extern-c-variadics, r=workingjubileeGuillaume Gomez-10/+0
stabilize c-style varargs for sysv64, win64, efiapi, aapcs This has been split up so the PR now only contains the extended_varargs_abi_support stabilization; "system" has been moved to https://github.com/rust-lang/rust/pull/145954. **Previous (combined) PR description:** This stabilizes extern block declarations of variadic functions with the system, sysv64, win64, efiapi, aapcs ABIs. This corresponds to the extended_varargs_abi_support and extern_system_varargs feature gates. The feature gates were split up since it seemed like there might be further discussion needed for what exactly "system" ABI variadic functions should do, but a [consensus](https://github.com/rust-lang/rust/issues/136946#issuecomment-2967847553) has meanwhile been reached: they shall behave like "C" functions. IOW, the ABI of a "system" function is (bold part is new in this PR): - "stdcall" for win32 targets **for non-variadic functions** - "C" for everything else This had been previously stabilized *without FCP* in https://github.com/rust-lang/rust/pull/116161, which got reverted in https://github.com/rust-lang/rust/pull/136897. There was also a "fun" race condition involved with the system ABI being [added](https://github.com/rust-lang/rust/pull/119587) to the list of variadic-supporting ABIs between the creation and merge of rust-lang/rust#116161. There was a question raised [here](https://github.com/rust-lang/rust/pull/116161#issuecomment-1983829513) whether t-lang even needs to be involved for a change like this. Not sure if that has meanwhile been clarified? The behavior of the "system" ABI (a Rust-specific ABI) definitely feels like t-lang territory to me. Fixes rust-lang/rust#100189 Cc `@rust-lang/lang` # Stabilization report > ## General design > ### What is the RFC for this feature and what changes have occurred to the user-facing design since the RFC was finalized? AFAIK there is no RFC. The tracking issues are - https://github.com/rust-lang/rust/issues/100189 - https://github.com/rust-lang/rust/issues/136946 > ### What behavior are we committing to that has been controversial? Summarize the major arguments pro/con. The only controversial point is whether "system" ABI functions should support variadics. - Pro: This allows crates like windows-rs to consistently use "system", see e.g. https://github.com/microsoft/windows-rs/issues/3626. - Cons: `@workingjubilee` had some implementation concerns, but I think those have been [resolved](https://github.com/rust-lang/rust/issues/136946#issuecomment-2967847553). EDIT: turns out Jubilee still has concerns (she mentioned that in a DM); I'll let her express those. Note that "system" is already a magic ABI we introduced to "do the right thing". This just makes it do the right thing in more cases. In particular, it means that on Windows one can almost always just do ```rust extern "system" { // put all the things here } ``` and it'll do the right thing, rather than having to split imports into non-varargs and varargs, with the varargs in a separate `extern "C"` block (and risking accidentally putting a non-vararg there). (I am saying "almost" always because some Windows API functions actually use cdecl, not stdcall, on x86. Those of course need to go in `extern "C"` blocks.) > ### Are there extensions to this feature that remain unstable? How do we know that we are not accidentally committing to those? Actually defining variadic functions in Rust remains unstable, under the [c_variadic feature gate](https://github.com/rust-lang/rust/issues/44930). > ## Has a Call for Testing period been conducted? If so, what feedback was received? > > Does any OSS nightly users use this feature? For instance, a useful indication might be "search <grep.app> for `#![feature(FEATURE_NAME)]` and had `N` results". There was no call for testing. A search brings up https://github.com/rust-osdev/uefi-rs/blob/main/uefi-raw/src/table/boot.rs using this for "efiapi". This doesn't seem widely used, but it is an "obvious" gap in our support for c-variadics. > ## Implementation quality All rustc does here is forward the ABI to LLVM so there's lot a lot to say here... > ### Summarize the major parts of the implementation and provide links into the code (or to PRs) > > An example for async closures: <https://rustc-dev-guide.rust-lang.org/coroutine-closures.html>. The check for allowed variadic ABIs is [here](https://github.com/rust-lang/rust/blob/9c870d30e2d6434c9e9a004b450c5ccffdf3d844/compiler/rustc_hir_analysis/src/lib.rs#L109-L126). The special handling of "system" is [here](https://github.com/rust-lang/rust/blob/c24914ec8329b22ec7bcaa6ab534a784b2bd8ab9/compiler/rustc_target/src/spec/abi_map.rs#L82-L85). > ### Summarize existing test coverage of this feature > > Consider what the "edges" of this feature are. We're particularly interested in seeing tests that assure us about exactly what nearby things we're not stabilizing. > > Within each test, include a comment at the top describing the purpose of the test and what set of invariants it intends to demonstrate. This is a great help to those reviewing the tests at stabilization time. > > - What does the test coverage landscape for this feature look like? > - Tests for compiler errors when you use the feature wrongly or make mistakes? > - Tests for the feature itself: > - Limits of the feature (so failing compilation) > - Exercises of edge cases of the feature > - Tests that checks the feature works as expected (where applicable, `//@ run-pass`). > - Are there any intentional gaps in test coverage? > > Link to test folders or individual tests (ui/codegen/assembly/run-make tests, etc.). Prior PRs add a codegen test for all ABIs and tests actually calling extern variadic functions for sysv64 and win64: - https://github.com/rust-lang/rust/pull/144359 - https://github.com/rust-lang/rust/pull/144379 We don't have a way of executing uefi target code in the test suite, so it's unclear how to fully test efiapi. aapcs could probably be done? (But note that we have hardly an such actually-calling-functions tests for ABI things, we almost entirely rely on codegen tests.) The test ensuring that we do *not* stabilize *defining* c-variadic functions is `tests/ui/feature-gates/feature-gate-c_variadic.rs`. > ### What outstanding bugs in the issue tracker involve this feature? Are they stabilization-blocking? None that I am aware of. > ### What FIXMEs are still in the code for that feature and why is it ok to leave them there? None that I am aware of. > ### Summarize contributors to the feature by name for recognition and assuredness that people involved in the feature agree with stabilization `@Soveu` added sysv64, win64, efiapi, aapcs to the list of ABIs that allow variadics, `@beepster4096` added system. `@workingjubilee` recently refactored the ABI handling in the compiler, also affecting this feature. > ### Which tools need to be adjusted to support this feature. Has this work been done? > > Consider rustdoc, clippy, rust-analyzer, rustfmt, rustup, docs.rs. Maybe RA needs to be taught about the new allowed ABIs? No idea how precisely they mirror what exactly rustc accepts and rejects here. > ## Type system and execution rules > ### What compilation-time checks are done that are needed to prevent undefined behavior? > > (Be sure to link to tests demonstrating that these tests are being done.) Nothing new here, this just expands the existing support for calling variadic functions to more ABIs. > ### Does the feature's implementation need checks to prevent UB or is it sound by default and needs opt in in places to perform the dangerous/unsafe operations? If it is not sound by default, what is the rationale? Nothing new here, this just expands the existing support for calling variadic functions to more ABIs. > ### Can users use this feature to introduce undefined behavior, or use this feature to break the abstraction of Rust and expose the underlying assembly-level implementation? (Describe.) Nothing new here, this just expands the existing support for calling variadic functions to more ABIs. > ### What updates are needed to the reference/specification? (link to PRs when they exist) - https://github.com/rust-lang/reference/pull/1936 > ## Common interactions > ### Does this feature introduce new expressions and can they produce temporaries? What are the lifetimes of those temporaries? No. > ### What other unstable features may be exposed by this feature? None.
2025-09-02Add maintainer for VxWorksKartik Agarwala-0/+1
2025-09-02stabilize extended_varargs_abi_supportRalf Jung-10/+0
2025-09-01Revert "dates: refresh diagnostics/ and tests/ annotated dates to August 2025"Tshepang Mbambo-9/+9
2025-09-01Revert "dates: refresh infra/tooling date annotations to Aug 2025"Tshepang Mbambo-12/+12
2025-09-01Revert "dates: refresh query-system date annotations to 2025-08 (preserve ↵Tshepang Mbambo-3/+3
style)"
2025-09-01Revert "dates: refresh type system & traits date annotations to Aug/2025"Tshepang Mbambo-9/+9
2025-08-30More docsAlona Enraght-Moony-7/+43
2025-08-30Start documenting tests/rustdoc-jsonAlona Enraght-Moony-2/+48
2025-08-30Merge pull request #2536 from apiraino/no-typofixes-plsapiraino-0/+3
2025-08-30Auto merge of #123319 - no92:managarm-target, r=davidtwcobors-0/+57
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-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-29doc: Add `*-unknown-managarm-mlibc` documentationno92-0/+57
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-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-28Add documentation for `doc(attribute = "...")` attributeGuillaume Gomez-1/+18
2025-08-28dates(infra): refresh date-check annotations for Aug 2025; preserve local styleAli Nazzal-12/+12
2025-08-28dates(diagnostics,tests): refresh annotated dates to Aug 2025; preserve ↵Ali Nazzal-9/+9
local style