about summary refs log tree commit diff
path: root/src/doc
AgeCommit message (Collapse)AuthorLines
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-06avoid duplicating commandsTshepang Mbambo-4/+5
The 2 commands do the same thing. Also, follow style used elsewhere in the guide.
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-01add rdg push git config entry for git protocol pushersTshepang Mbambo-0/+10
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
2025-04-26Merge pull request #2343 from hwhsu1231-fork/fix-prefix-chapterTshepang Mbambo-0/+5
fix(docs): add newlines between prefix/suffix chapters
2025-04-26Merge pull request #2345 from rust-lang/extraneousTshepang Mbambo-3/+3
toolchain version does not need to be specified
2025-04-25Auto merge of #140298 - matthiaskrgr:rollup-5tc1gvb, r=matthiaskrgrbors-1/+1
Rollup of 8 pull requests Successful merges: - #137683 (Add a tidy check for GCC submodule version) - #138968 (Update the index of Result to make the summary more comprehensive) - #139572 (docs(std): mention const blocks in const keyword doc page) - #140152 (Unify the format of rustc cli flags) - #140193 (fix ICE in `#[naked]` attribute validation) - #140205 (Tidying up UI tests [2/N]) - #140284 (remove expect() in `unnecessary_transmutes`) - #140290 (rustdoc: fix typo change from equivelent to equivalent) r? `@ghost` `@rustbot` modify labels: rollup
2025-04-25typoTshepang Mbambo-2/+2
2025-04-25Rollup merge of #140290 - styvane:patch0001-fix-typo-in-rusdoc-search, ↵Matthias Krüger-1/+1
r=GuillaumeGomez rustdoc: fix typo change from equivelent to equivalent This PR fixes a typo in the search section in `rustdoc` book.
2025-04-25Auto merge of #140282 - matthiaskrgr:rollup-g6ze4jj, r=matthiaskrgrbors-0/+3
Rollup of 8 pull requests Successful merges: - #137653 (Deprecate the unstable `concat_idents!`) - #138957 (Update the index of Option to make the summary more comprehensive) - #140006 (ensure compiler existance of tools on the dist step) - #140143 (Move `sys::pal::os::Env` into `sys::env`) - #140202 (Make #![feature(let_chains)] bootstrap conditional in compiler/) - #140236 (norm nested aliases before evaluating the parent goal) - #140257 (Some drive-by housecleaning in `rustc_borrowck`) - #140278 (Don't use item name to look up associated item from trait item) r? `@ghost` `@rustbot` modify labels: rollup
2025-04-25rustdoc: fix typo change from equivelent to equivalentSede Soukossi-1/+1
2025-04-25Enable [behind-upstream] triagebot optionxizheyin-0/+3
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-04-25Rollup merge of #137096 - ehuss:stabilize-doctest-xcompile, r=fmeaseMatthias Krüger-54/+59
Stabilize flags for doctest cross compilation This makes the following changes in preparation for supporting doctest cross-compiling in cargo: - Renames `--runtool` and `--runtool-arg` to `--test-runtool` and `--test-runtool-arg` to maintain consistency with other `--test-*` arguments. - Stabilizes the `--test-runtool` and `--test-runtool-arg`. These are needed in order to support cargo's `target.runner` option which specifies a runner to execute a cross-compiled doctest (for example, qemu). - Stabilizes the `--enable-per-target-ignores` flag by removing it and making it unconditionally enabled. This makes it possible to disable a doctest on a per-target basis, which I think will be helpful for rolling out this feature. These changes were suggested in https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/stabilizing.20doctest.20xcompile/near/409281127 The intent is to stabilize the doctest-xcompile feature in cargo. This will help ensure that for projects that do cross-compile testing that their doctests are also covered. Currently there is a somewhat surprising behavior that they are ignored. Closes https://github.com/rust-lang/rust/issues/64245 try-job: x86_64-msvc-1