summary refs log tree commit diff
path: root/src/doc
AgeCommit message (Collapse)AuthorLines
2025-05-22Update the edition guide for let chainsest31-0/+0
(cherry picked from commit 577e82f71b07b11c6a6f74ac788c65cbd2674a2a)
2025-05-09update version placeholdersPietro Albini-1/+1
2025-05-08Auto merge of #140786 - Kobzol:try-builds-no-deny-warnings, r=jieyouxubors-6/+10
Do not deny warnings in "fast" try builds When we do the classic ``@bors` try` build without specifying `try-job` in the PR description, we want to get a compiler toolchain for perf./crater/local experimentation as fast as possible. We don't run any tests in that case, so it seems reasonable to also ignore warnings. Fixes: https://github.com/rust-lang/rust/issues/140753 r? `@jieyouxu` try-job: dist-x86_64-linux
2025-05-08Mention fast try builds in the rustc-dev-guideJakub Beránek-6/+10
2025-05-08Rollup merge of #140764 - joshtriplett:style-nullary-functions, r=traviscrossMatthias Krüger-0/+13
style: Never break within a nullary function call `func()` or a unit literal `()` Implements https://github.com/rust-lang/style-team/issues/210
2025-05-08Auto merge of #140106 - dianne:deref-pat-usefulness, r=Nadrierilbors-2/+1
allow deref patterns to participate in exhaustiveness analysis Per [this proposal](https://hackmd.io/4qDDMcvyQ-GDB089IPcHGg#Exhaustiveness), this PR allows deref patterns to participate in exhaustiveness analysis. Currently all deref patterns enforce `DerefPure` bounds on their scrutinees, so this assumes all patterns it's analyzing are well-behaved. This also doesn't support [mixed exhaustiveness](https://hackmd.io/4qDDMcvyQ-GDB089IPcHGg#Mixed-exhaustiveness), and instead emits an error if deref patterns are used together with normal constructors. I think mixed exhaustiveness would be nice to have (especially if we eventually want to support arbitrary `Deref` impls[^1]), but it'd require more work to get reasonable diagnostics[^2]. Tracking issue for deref patterns: #87121 r? `@Nadrieril` [^1]: Regardless of whether we support limited exhaustiveness checking for untrusted `Deref` or always require other arms to be exhaustive, I think it'd be useful to allow mixed matching for user-defined smart pointers. And it'd be strange if it worked there but not for `Cow`. [^2]: I think listing out witnesses of non-exhaustiveness can be confusing when they're not necessarily disjoint, and when you only need to cover some of them, so we'd probably want special formatting and/or explanatory subdiagnostics. And if it's implemented similarly to unions, we'd probably also want some way of merging witnesses; the way witnesses for unions can appear duplicated is pretty unfortunate. I'm not sure yet how the diagnostics should look, especially for deeply nested patterns.
2025-05-07style: Never break within a nullary function call `func()` or a unit literal ↵Josh Triplett-0/+13
`()`
2025-05-07Rollup merge of #140741 - husqvarnagroup:af/armv5te-target-maintainer, ↵Guillaume Gomez-1/+31
r=jieyouxu add armv5te-unknown-linux-gnueabi target maintainer My employer is interested in having this target maintained and we already have some tests in our CI running for it. armv5te-unknown-linux-gnueabi can be ticket off in #113739.
2025-05-07Rollup merge of #140234 - nnethercote:separate-Analysis-and-Results, r=davidtwcoGuillaume Gomez-2/+1
Separate dataflow analysis and results `Analysis` gets put into `Results` with `EntryStates`, by `iterate_to_fixpoint`. This has two problems: - `Results` is passed various places where only `Analysis` is needed. - `EntryStates` is passed around mutably everywhere even though it is immutable. This commit mostly separates `Analysis` from `Results` and fixes these two problems. r? `@davidtwco`
2025-05-07add armv5te-unknown-linux-gnueabi target maintainerAdrian Friedli-1/+31
2025-05-07Rollup merge of #139518 - xizheyin:issue-138527, r=traviscrossGuillaume Gomez-12/+12
Stabilize precise capture syntax in style guide Closes #138527 r? `@jieyouxu`
2025-05-06let deref patterns participate in usefulness/exhaustivenessdianne-2/+1
This does not yet handle the case of mixed deref patterns with normal constructors; it'll ICE in `Constructor::is_covered_by`. That'll be fixed in a later commit.
2025-05-06Rollup merge of #140658 - dianne:lit-deref-pats-p2, r=oli-obkGuillaume Gomez-7/+24
`deref_patterns`: let string and byte string literal patterns peel references and smart pointers before matching This follows up on #140028. Together, they allow using string and byte string literal patterns to match on smart pointers when `deref_patterns` is enabled. In particular, string literals can now match on `String`, subsuming the functionality of the `string_deref_patterns` feature. More generally, this works by letting literals peel references (and smart pointers) before matching, similar to most other patterns, providing an answer to #44849. Though it's only partially implemented at this point: this doesn't yet let named const patterns peel before matching. The peeling logic is general enough to support named consts, but the typing rules for named const patterns would need adjustments to feel consistent (e.g. arrays would need rules to be usable as slices, and `const STR: &'static str` wouldn't be able to match on a `String` unless a rule was added to let it be used where a `str` is expected, similar to what #140028 did for literals). This also allows string and byte string patterns to match on mutable references, following up on https://github.com/rust-lang/rust/pull/140028#discussion_r2053927512. Rather than forward the mutability of the scrutinee to literal patterns, I've opted to peel `&mut`s from the scrutinee. From a design point of view, this makes the behavior consistent with what would be expected from deref coercions using the methodology in the next paragraph. From a diagnostics point of view, this avoids labeling string and byte string patterns as "mutable references", which I think could be confusing. See [`byte-string-type-errors.rs`](https://github.com/rust-lang/rust/compare/master...dianne:rust:lit-deref-pats-p2?expand=1#diff-4a0dd9b164b67c706751f3c0b5762ddab08bcef05a91972beb0190c6c1cd3706) for how the diagnostics look. At a high level, the peeling logic implemented here tries to mimic how deref coercions work for expressions: we peel references (and smart pointers) from the scrutinee until the pattern can match against it, and no more. This is primarily tested by [`const-pats-do-not-mislead-inference.rs`](https://github.com/rust-lang/rust/compare/master...dianne:rust:lit-deref-pats-p2?expand=1#diff-19afc05b8aae9a30fe4a3a8c0bc2ab2c56b58755a45cdf5c12be0d5e83c4739d). To illustrate the connection, I wasn't sure if this made sense to include in the test file, but I've translated those tests to make sure they give the same inference results as deref coercions: [(playground)](https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=1869744cb9cdfed71a686990aadf9fe1). In each case, a reference to the scrutinee is coerced to have the type of the pattern (under a reference). Tracking issue for deref patterns: #87121 r? `@oli-obk` cc `@Nadrieril`
2025-05-06Rollup merge of #140035 - fee1-dead-contrib:push-oszwkkvmpkks, ↵Stuart Cook-3/+28
r=jieyouxu,wesleywiser Implement RFC 3503: frontmatters Tracking issue: #136889 Supercedes #137193. This implements [RFC 3503](https://github.com/rust-lang/rfcs/blob/master/text/3503-frontmatter.md). This might break rust-analyzer. Will look into how to fix that. Suggestions welcome for how to improve diagnostics.
2025-05-05Update booksrustbot-0/+0
2025-05-05Implement RFC 3503: frontmattersDeadbeef-3/+28
Supercedes #137193
2025-05-05update unstable bookdianne-7/+24
2025-05-04compiletest: Support matching on non-json lines in compiler outputVadim Petrochenkov-2/+4
and migrate most of remaining `error-pattern`s to it.
2025-05-02zkvm: remove schmerik from maintainers listErik Kaneda-1/+0
2025-05-01Merge pull request #2367 from rust-lang/rustc-pullTshepang Mbambo-10/+25
Rustc pull update
2025-05-01adds commasMartin Ombura Jr.-2/+2
2025-05-01Merge from rustcThe rustc-dev-guide Cronjob Bot-9/+24
2025-05-01Preparing for merge from rustcThe rustc-dev-guide Cronjob Bot-1/+1
2025-05-01adds 'with' to help clarify how to build a new compilerMartin Ombura Jr.-2/+2
2025-04-30Rollup merge of #140506 - tshepang:patch-1, r=jieyouxuMatthias Krüger-1/+1
unstable-book: fix capitalization
2025-04-30Merge pull request #2352 from xizheyin/enable-behind-upstream许杰友 Jieyou Xu (Joe)-0/+3
2025-04-30Merge pull request #2359 from rust-lang/tshepang-repo-name许杰友 Jieyou Xu (Joe)-1/+1
2025-04-30unstable-book: fix capitalizationTshepang Mbambo-1/+1
2025-04-30compiletest: Make diagnostic kind mandatory on line annotationsVadim Petrochenkov-3/+3
2025-04-29for a more friendly outputTshepang Mbambo-2/+6
Also, these are normal Rust things (crates/packages), so remove the word *normal*.
2025-04-29Merge pull request #2363 from smanilov/patch-1Tshepang Mbambo-13/+12
Update compiler-src.md
2025-04-29Merge PR #2360: Add docs about stabilizing an editionTravis Cross-0/+54
2025-04-29Fix footnotesBoxy-12/+12
2025-04-29Merge pull request #2266 from BoxyUwU/normalizationlcnr-129/+311
Introduce a normalization chapter
2025-04-29Introduce a normalization chapterBoxy-129/+311
2025-04-29Update compiler-src.mdStan Manilov-13/+12
Refactor the dependency structure from a nested unordered list to a single-level ordered list. IMO, this is clearer, but happy to close this PR without merging, if the change is not desired.
2025-04-28Rollup merge of #140022 - dianne:box-deref-pats, r=NadrierilChris Denton-1/+14
allow deref patterns to move out of boxes This adds a case to lower deref patterns on boxes using a built-in deref instead of a `Deref::deref` or `DerefMut::deref_mut` call: if `deref!(inner): Box<T>` is matching on place `place`, the inner pattern `inner` now matches on `*place` rather than a temporary. No longer needing to call a method also means it won't borrow the scrutinee in match arms. This allows for bindings in `inner` to move out of `*place`. For comparison with box patterns, this uses the same MIR lowering but different THIR. Consequently, deref patterns on boxes are treated the same as any other deref patterns in match exhaustiveness analysis. Box patterns can't quite be implemented in terms of deref patterns until exhaustiveness checking for deref patterns is implemented (I'll open a PR for exhaustiveness soon!). Tracking issue: #87121 r? ``@Nadrieril``
2025-04-28Add documentation on how to stabilize the compiler editionEric Huss-0/+19
This adds documentation on how to stabilize the edition in the compiler.
2025-04-28Update mdbook to 0.4.48Eric Huss-1/+1
This updates to the latest version of mdbook which has had a variety of fixes of new features since the last update. Changelog: https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-0448
2025-04-28Add documentation on how to migration the edition of the standard libraryEric Huss-0/+18
Based on lessons learned from 2024. There's probably still more details to say here since it was a ton of work. These are the major points that I remember.
2025-04-28Add an example of the example of an edition migration lintEric Huss-0/+17
It was observed that some people were missing the `edition20xx` rustdoc attribute. Although this probably won't solve that problem, I'd still like to highlight it as something to be aware of.
2025-04-28Rollup merge of #140379 - tshepang:rdg-push, r=jieyouxuGuillaume Gomez-39/+49
rustc-dev-guide subtree update
2025-04-28use repo name in push pr titleTshepang Mbambo-1/+1
I found "Rustc dev guide subtree update awkward"
2025-04-28Merge from rustcThe rustc-dev-guide Cronjob Bot-69/+92
2025-04-28Preparing for merge from rustcThe rustc-dev-guide Cronjob Bot-1/+1
2025-04-28Rollup merge of #139224 - epage:nocapture, r=thomccChris Denton-4/+6
fix(test): Expose '--no-capture' in favor of `--nocapture` This improves consistency with commonly expected CLI conventions, avoiding a common stutter people make when running tests (trying what they expect and then having to check the docs to then user whats accepted). An alternative could have been to take a value, like `--capture <value>` (e.g. `pytest` does this). Overall, we're shifting focus for features to custom test harnesses (see #134283). Most of `pytest`s modes will likely be irrelevant in that situation. As for the rest, its too early to tell which, if any, may be relevant, so we're sticking with this small, quality of life improvement. I expect we'll warn about `--nocapture` being deprecated in the future after a sufficient transition period has been allowed. By deprecating `--nocapture`, we intend that custom test harnesses do not need to support it for reasons outside of their own compatibility requirements, much like the deprecation in #134283 I'm punting for now on the naming of `RUST_TEST_NOCAPTURE`. I feel like T-testing-devex should do a wider look at environment variables role in lib`test` before evaluating whether to - Deprecate it in favor of the user passing CLI flags or the test runner providing its own config - Deprecate in favor of `RUST_TEST_NO_CAPTURE` - Deprecate in favor of `RUST_TEST_CAPTURE` Other CLI flags were evaluated for casing consistency: - `--logfile` has the same problem but was deprecated in #134283 Regarding the implementation, I moved `--nocapture` out of `optgroups()`, into `parse_opts()`, out of an abundance of caution in passing the options without a deprecated value to the usage generation. However, the usage does not actually show optional flags, so this could potentially be dropped, simplifying the PR. Note: `compiletest` added `--no-capture` instead of `--nocapture` in #134809 T-testing-devex FCP: https://github.com/rust-lang/rust/issues/133073#issuecomment-2486921104 Fixes #133073
2025-04-27Merge pull request #2351 from rust-lang/rustc-pullYuki Okushi-3/+22
2025-04-26replace command that does not workTshepang Mbambo-3/+6
2025-04-26copy-paste easeTshepang Mbambo-1/+1
2025-04-26use correct code block markersTshepang Mbambo-24/+24