about summary refs log tree commit diff
path: root/src/doc
AgeCommit message (Collapse)AuthorLines
2025-03-16Following commit 401dd84 in the Rust projectYang Lin-4/+7
(https://github.com/rust-lang/rust), `ErrorGuaranteed` was replaced by fatal errors. As a result, `tcx.analysis()` now aborts directly instead of returning an error guard. To accommodate this change, this update replaces `tcx.analysis()` with `typeck()` to perform type checking in the example.
2025-03-16Adapt to rust-lang/rust#136466:Yang Lin-13/+9
Start removing `rustc_middle::hir::map::Map` Following commit f86f7ad from pull request #136466 in the Rust project (https://github.com/rust-lang/rust), some methods in `Map` were moved to `TyCtxt`. This update reimplements `rustc-drive-example.rs`, `rustc-driver-interacting-with-the-ast.rs`, and `rustc-interface-example.rs` using the new versions of these methods, ensuring compatibility with the nightly-2025-03-08 toolchain.
2025-03-16Rollup merge of #138323 - kpreid:offset-of-doc, r=Mark-Simulacrum许杰友 Jieyou Xu (Joe)-0/+59
Expand and organize `offset_of!` documentation. * Give example of how to get the offset of an unsized tail field (prompted by discussion <https://github.com/rust-lang/rust/pull/133055#discussion_r1986422206>). * Specify the return type. * Add section headings. * Reduce “Visibility is respected…”, to a single sentence. * Move `offset_of_enum` documentation to unstable book (with link to it). * Add `offset_of_slice` documentation in unstable book. r? Mark-Simulacrum
2025-03-15add some copy-paste goodnessTshepang Mbambo-3/+3
2025-03-15make 'mdbook test --chapter "Running tests"' passTshepang Mbambo-1/+1
2025-03-15those should not get shell highlightingTshepang Mbambo-24/+24
2025-03-14Rollup merge of #138485 - BoxyUwU:rdg-push, r=jieyouxuLeón Orell Valerian Liehr-105/+202
Rustc dev guide subtree update r? `@jieyouxu`
2025-03-14Fix MCP linksJakub Beránek-2/+2
2025-03-14Merge pull request #2283 from jieyouxu/sync许杰友 Jieyou Xu (Joe)-122/+330
Rustc pull
2025-03-13Fix grammar and remove redundant infoKonaeAkira-2/+1
2025-03-13Remove the doc for `no-system-llvm`Josh Stone-1/+0
This compiletest directive was removed in rust-lang/rust#120265.
2025-03-13Rollup merge of #136842 - randomPoison:trusty-libstd-v3, r=ChrisDentonMatthias Krüger-5/+7
Add libstd support for Trusty targets This PR adds support for `alloc` and `std` for the Trusty targets based on the internal patches used in Android. The original patches can be seen [here](https://android.googlesource.com/toolchain/android_rust/+/refs/heads/main/patches/development/rustc-0023-Add-Trusty-OS-support-to-Rust-std.patch) and [here](https://android.googlesource.com/toolchain/android_rust/+/refs/heads/main/patches/development/rustc-0054-Add-std-os-fd-support-for-Trusty.patch). Please let me know if there's any additional context I need to add.
2025-03-13Document `fetch.prunetags = true` gotcha during rustc-pull许杰友 Jieyou Xu (Joe)-0/+13
2025-03-13Merge from rustc许杰友 Jieyou Xu (Joe)-121/+329
2025-03-13Preparing for merge from rustc许杰友 Jieyou Xu (Joe)-1/+1
2025-03-13less text for same effectTshepang Mbambo-3/+2
2025-03-12Rollup merge of #137504 - nnethercote:remove-Map-4, r=ZalatharManish Goregaokar-2/+2
Move methods from Map to TyCtxt, part 4. A follow-up to https://github.com/rust-lang/rust/pull/137350. r? ```@Zalathar```
2025-03-12Rollup merge of #138313 - rustbot:docs-update, r=jieyouxuMatthias Krüger-0/+0
Update books ## rust-lang/book 11 commits in 4a01a9182496f807aaa5f72d93a25ce18bcbe105..81a976a237f84b8392c4ce1bd5fd076eb757a2eb 2025-02-27 22:10:41 UTC to 2025-02-24 18:36:27 UTC - Ch. 10: Make social media discussion generic. (rust-lang/book#4249) - Another Ch. 17 -> 18 fix (rust-lang/book#4247) - Ch. 05: further tweak to wording about `user1` availability (rust-lang/book#4246) - Ch. 02: Fix rand version mistake (from testing) (rust-lang/book#4245) - Ch. 19: Correct the discussion of `fn` type and closures (rust-lang/book#4244) - Edition maintenance: scripting the updates for future work (rust-lang/book#4243) - Ch. 17: fresh-eyes edits (rust-lang/book#4242) - Ch. 17: drop lifetime not required in 2024 Edition (rust-lang/book#4212) - Appendix B, Operators: Replace “member access” with “field access” and “method call”. (rust-lang/book#4240) - Update to Rust 1.85 and 2024 Edition! (rust-lang/book#4241) - Chapter 1: fix 'four things' now that spacing is not emphasized (rust-lang/book#4239) ## rust-lang/edition-guide 2 commits in daa4b763cd848f986813b5cf8069e1649f7147af..1e27e5e6d5133ae4612f5cc195c15fc8d51b1c9c 2025-03-04 22:02:00 UTC to 2025-02-26 12:47:41 UTC - Mention both `rustfmt.toml` and `.rustfmt.toml` (rust-lang/edition-guide#372) - Fix a typo (rust-lang/edition-guide#370) ## rust-lang/nomicon 1 commits in 8f5c7322b65d079aa5b242eb10d89a98e12471e1..b4448fa406a6dccde62d1e2f34f70fc51814cdcc 2025-03-01 04:48:05 UTC to 2025-03-01 04:48:05 UTC - Update to 2024 edition (rust-lang/nomicon#481) ## rust-lang/reference 8 commits in 615b4cec60c269cfc105d511c93287620032d5b0..dda31c85f2ef2e5d2f0f2f643c9231690a30a626 2025-03-09 14:25:25 UTC to 2025-02-25 16:07:17 UTC - Rework note blocks and change admonition rendering (rust-lang/reference#1754) - Add more information on rules and tests (rust-lang/reference#1753) - Mention `explicit_builtin_cfgs_in_flags` lint cfg chapter (rust-lang/reference#1747) - fixup test links (rust-lang/reference#1741) - Fix diagnostics typo: `do_no_recommend` -> `do_not_recommend` (rust-lang/reference#1749) - panic runtime and C-unwind documentation (rust-lang/reference#1226) - Closures: fix example of desugaring (rust-lang/reference#1743) - Update boolean.md, Comment breaks paragraph format (rust-lang/reference#1744) ## rust-lang/rust-by-example 1 commits in 66543bbc5b7dbd4e679092c07ae06ba6c73fd912..6f69823c28ae8d929d6c815181c73d3e99ef16d3 2025-03-09 13:12:24 UTC to 2025-03-09 13:12:24 UTC - Update mdbook to 0.4.46 (rust-lang/rust-by-example#1914) try-job: x86_64-gnu-distcheck
2025-03-12Move methods from `Map` to `TyCtxt`, part 4.Nicholas Nethercote-2/+2
Continuing the work from #137350. Removes the unused methods: `expect_variant`, `expect_field`, `expect_foreign_item`. Every method gains a `hir_` prefix.
2025-03-11Rollup merge of #138307 - Kobzol:citool-alias, r=marcoieniJakub Beránek-10/+18
Allow specifying glob patterns for try jobs This PR modifies the `try-job` lookup logic to allow glob patterns. So you can e.g. request all MSVC-related jobs with `try-job: *msvc*`. Best reviewed commit by commit. r? ``````@marcoieni`````` try-job: `*msvc*`
2025-03-11Rollup merge of #138288 - jyn514:crate-attr, r=NoratriebJakub Beránek-0/+16
Document -Z crate-attr and also add a bunch of tests
2025-03-11Rollup merge of #138147 - daltenty:patch-1, r=jieyouxuJakub Beránek-1/+49
Add maintainers for powerpc64le-unknown-linux-gnu The instructions are similar to `powerpc64le-unknown-linux-musl`
2025-03-11Auto merge of #135651 - arjunr2:master, r=davidtwcobors-0/+100
Support for `wasm32-wali-linux-musl` Tier-3 target Adding a new target -- `wasm32-wali-linux-musl` -- to the compiler can target the [WebAssembly Linux Interface](https://github.com/arjunr2/WALI) according to MCP rust-lang/compiler-team#797 Preliminary support involves minimal changes, primarily * A new target spec for `wasm32_wali_linux_musl` that bridges linux options with supported wasm options. Right now, since there is no canonical Linux ABI for Wasm, we use `wali` in the vendor field, but this can be migrated in future version. * Dependency patches to the following crates are required and these crates can be updated to bring target support: - **stdarch** rust-lang/stdarch#1702 - **libc** rust-lang/libc#4244 - **cc** rust-lang/cc-rs#1373 * Minimal additions for FFI support cc `@tgross35` for libc-related changes Tier-3 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.) I will take responsibility for maintaining this target as well as issues > 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. The target name is consistent with naming patterns from currently supported targets for arch (wasm32), OS, (linux) and env (musl) > 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. No naming confusion is introduced. > If possible, use only letters, numbers, dashes and underscores for the name. Periods (.) are known to cause issues in Cargo. Compliant > 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. It's fully open source > 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). Noted > 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. Compliant > 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. All tools are open-source > "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. No terms present > 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. I am not a reviewer > 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. This target supports the full standard library with appropriate configuration stubs where necessary (however, similar to all existing wasm32 targets, it excludes dynamic linking or hardware-specific features) > 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. Preliminary documentation is provided at https://github.com/arjunr2/WALI. Further detailed docs (if necessary) can be added once this PR lands > 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. To the best of my knowledge, it does not break any existing target in the ecosystem -- only minimal configuration-specific additions were made to support the target. > 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.) We can upstream LLVM target support
2025-03-11Document -Z crate-attrjyn-0/+16
Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
2025-03-10Target definition for `wasm32-wali-linux-musl` to support the Wasm LinuxArjun Ramesh-0/+100
Interface This commit does not patch libc, stdarch, or cc
2025-03-11Auto merge of #138302 - matthiaskrgr:rollup-an2up80, r=matthiaskrgrbors-1/+1
Rollup of 8 pull requests Successful merges: - #136395 (Update to rand 0.9.0) - #137279 (Make some invalid codegen attr errors structured/translatable) - #137585 (Update documentation to consistently use 'm' in atomic synchronization example) - #137926 (Add a test for `-znostart-stop-gc` usage with LLD) - #138074 (Support `File::seek` for Hermit) - #138238 (Fix dyn -> param suggestion in struct ICEs) - #138270 (chore: Fix some comments) - #138286 (triagebot.toml: Don't label `test/rustdoc-json` as A-rustdoc-search (…) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-10Move `offset_of_enum` documentation to unstable book; add `offset_of_slice`.Kevin Reid-0/+59
2025-03-10Add powerpc64le maintainersDavid Tenty-1/+49
2025-03-10Update booksrustbot-0/+0
2025-03-10Update Trusty platform docsNicole LeGare-5/+7
2025-03-10Update metadata for cygwin target王宇逸-1/+1
2025-03-10Add remark for missing llvm-tools component re. rustc_private linker ↵xizheyin-0/+30
failures related to not finding LLVM libraries Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-03-10Handle backticks in try job patternsJakub Beránek-11/+16
2025-03-10Modify try-job documentationJakub Beránek-5/+8
2025-03-10Merge pull request #2258 from fee1-dead-contrib/constckOli Scherer-67/+160
Rewrite effects checking chapter
2025-03-10Merge pull request #2273 from rust-lang/tshepang-patch-1许杰友 Jieyou Xu (Joe)-2/+2
use new terminology
2025-03-10add missing punctuationTshepang Mbambo-1/+1
2025-03-10clean --bless textTshepang Mbambo-5/+7
2025-03-10add a pause, for readabilityTshepang Mbambo-2/+2
2025-03-10already mentioned before showing code snippetTshepang Mbambo-1/+1
2025-03-10use new terminologyTshepang Mbambo-2/+2
2025-03-09chore: Fix some commentsStevenMia-1/+1
Signed-off-by: StevenMia <flite@foxmail.com>
2025-03-09Merge pull request #2270 from tshepang/example-llvm-prs许杰友 Jieyou Xu (Joe)-14/+9
mention llvm 20 in example prs
2025-03-09Merge pull request #2271 from rust-lang/tshepang-patch-1许杰友 Jieyou Xu (Joe)-2/+1
fix text
2025-03-08ignore-stage0 and only-stage0 do not existTshepang Mbambo-1/+1
2025-03-08fix textTshepang Mbambo-2/+1
- There is more than just target and stage - There is only 3 stages, so don't mention them specially
2025-03-08link to latest major llvm update prTshepang Mbambo-1/+2
2025-03-08only a few are needed as examplesTshepang Mbambo-6/+0
2025-03-08numbers were not sequential, so stop tryingTshepang Mbambo-7/+7
2025-03-08consider `explicit_implied_const_bounds`Deadbeef-1/+30