about summary refs log tree commit diff
path: root/src/doc
AgeCommit message (Collapse)AuthorLines
2021-03-29Update booksEric Huss-0/+0
2021-03-27Update rustup cross-compilation docs linkJon Jensen-1/+1
2021-03-22Auto merge of #79278 - mark-i-m:stabilize-or-pattern, r=nikomatsakisbors-36/+0
Stabilize or_patterns (RFC 2535, 2530, 2175) closes #54883 This PR stabilizes the or_patterns feature in Rust 1.53. This is blocked on the following (in order): - [x] The crater run in https://github.com/rust-lang/rust/pull/78935#issuecomment-731564021 - [x] The resolution of the unresolved questions and a second crater run (https://github.com/rust-lang/rust/pull/78935#issuecomment-735412705) - It looks like we will need to pursue some sort of edition-based transition for `:pat`. - [x] Nomination and discussion by T-lang - [x] Implement new behavior for `:pat` based on consensus (https://github.com/rust-lang/rust/pull/80100). - [ ] An FCP on stabilization EDIT: Stabilization report is in https://github.com/rust-lang/rust/pull/79278#issuecomment-772815177
2021-03-21Update doc/reference submoduleNikita Popov-0/+0
In particular this pulls in an update to the auto-deref recursion_limit example, to no longer rely on the Freeze query.
2021-03-19remove unstable book chaptermark-36/+0
2021-03-19Rollup merge of #82846 - GuillaumeGomez:doc-alias-list, r=jyn514Dylan DPC-0/+7
rustdoc: allow list syntax for #[doc(alias)] attributes Fixes https://github.com/rust-lang/rust/issues/81205. It now allows to have: ```rust #[doc(alias = "x")] // and: #[doc(alias("y", "z"))] ``` cc ``@jplatte`` r? ``@jyn514``
2021-03-17Rollup merge of #83206 - ehuss:update-books, r=ehussYuki Okushi-0/+0
Update books ## nomicon 1 commits in adca786547d08fe676b2fc7a6f08c2ed5280ca38..6fe476943afd53a9a6e91f38a6ea7bb48811d8ff 2021-02-16 16:34:20 +0900 to 2021-03-10 07:28:57 +0900 - Merge pull request rust-lang-nursery/nomicon#257 from skade/opaque-types-fix ## reference 3 commits in 3b6fe80c205d2a2b5dc8a276192bbce9eeb9e9cf..e32a2f928f8b78d534bca2b9e7736413314dc556 2021-02-22 22:09:17 -0800 to 2021-03-08 23:24:30 -0800 - Clarify that ::foo paths are not necessarily based off of the "crate root" (rust-lang-nursery/reference#974) - Comment typo (rust-lang-nursery/reference#977) - Fix misspelled word discrimnant (rust-lang-nursery/reference#976) ## book 2 commits in 0f87daf683ae3de3cb725faecb11b7e7e89f0e5a..fc2f690fc16592abbead2360cfc0a42f5df78052 2021-03-01 08:54:04 -0500 to 2021-03-05 14:03:22 -0500 - Fix wrapping - fix: redundant double introduction of shadowing (rust-lang/book#2633) ## rust-by-example 1 commits in 3e0d98790c9126517fa1c604dc3678f396e92a27..eead22c6c030fa4f3a167d1798658c341199e2ae 2021-02-25 08:23:10 -0300 to 2021-03-04 16:26:43 -0300 - Fix grammar "terminates" -> "terminate" (rust-lang/rust-by-example#1423) ## rustc-dev-guide 15 commits in c431f8c29a41413dddcb3bfa0d71c9cabe366317..67ebd4b55dba44edfc351621cef6e5e758169c55 2021-02-28 16:35:20 -0500 to 2021-03-11 13:36:25 -0800 - Remove extra the (rust-lang/rustc-dev-guide#1088) - Fix double-word typos (rust-lang/rustc-dev-guide#1084) - I-nominated are nominated for discussion (rust-lang/rustc-dev-guide#1080) - Complete unfinished statement - Check `BASE_SHA` only if it's a PR (rust-lang/rustc-dev-guide#1083) - Update lins - Apply suggestions from code review - Add stub about the THIR - Switch from Travis to GHA (rust-lang/rustc-dev-guide#1073) - Adjust a bit better P- label text - Fix typos (rust-lang/rustc-dev-guide#1079) - Update cmake version in prerequisites.md (rust-lang/rustc-dev-guide#1077) - Fix typo: suceed -> succeed - Add article on using WPA to profile rustc memory usage on Windows (rust-lang/rustc-dev-guide#1074) - Use more accurate estimate of generated LLVM IR with llvm-lines ## embedded-book 1 commits in a96d096cffe5fa2c84af1b4b61e1492f839bb2e1..f61685755fad7d3b88b4645adfbf461d500563a2 2021-02-17 08:08:52 +0000 to 2021-03-08 01:06:44 +0000 - Swap to GHA (rust-embedded/book#285)
2021-03-16Update booksEric Huss-0/+0
2021-03-16Show details in cfg version unstable bookIvan Tham-3/+4
2021-03-12Rollup merge of #82979 - GuillaumeGomez:run-button-pos, r=Nemo157Yuki Okushi-0/+1
Fix "run" button position in error index This isn't really a rustdoc issue but I still made the same fix in the `rustdoc.css` file (doesn't hurt). Before: ![Screenshot from 2021-03-10 16-35-49](https://user-images.githubusercontent.com/3050060/110655807-aa402800-81bf-11eb-8a88-bc979efd1697.png) After: ![Screenshot from 2021-03-10 16-40-08](https://user-images.githubusercontent.com/3050060/110655843-b4622680-81bf-11eb-8670-42975d92b4eb.png) cc ````@jyn514```` (considering this is quite a big bug and an easy fix) r? ````@Nemo157````
2021-03-10Auto merge of #76570 - cratelyn:implement-rfc-2945-c-unwind-abi, r=Amanieubors-0/+15
Implement RFC 2945: "C-unwind" ABI ## Implement RFC 2945: "C-unwind" ABI This branch implements [RFC 2945]. The tracking issue for this RFC is #74990. The feature gate for the issue is `#![feature(c_unwind)]`. This RFC was created as part of the ffi-unwind project group tracked at rust-lang/lang-team#19. ### Changes Further details will be provided in commit messages, but a high-level overview of the changes follows: * A boolean `unwind` payload is added to the `C`, `System`, `Stdcall`, and `Thiscall` variants, marking whether unwinding across FFI boundaries is acceptable. The cases where each of these variants' `unwind` member is true correspond with the `C-unwind`, `system-unwind`, `stdcall-unwind`, and `thiscall-unwind` ABI strings introduced in RFC 2945 [3]. * This commit adds a `c_unwind` feature gate for the new ABI strings. Tests for this feature gate are included in `src/test/ui/c-unwind/`, which ensure that this feature gate works correctly for each of the new ABIs. A new language features entry in the unstable book is added as well. * We adjust the `rustc_middle::ty::layout::fn_can_unwind` function, used to compute whether or not a `FnAbi` object represents a function that should be able to unwind when `panic=unwind` is in use. * Changes are also made to `rustc_mir_build::build::should_abort_on_panic` so that the function ABI is used to determind whether it should abort, assuming that the `panic=unwind` strategy is being used, and no explicit unwind attribute was provided. [RFC 2945]: https://github.com/rust-lang/rfcs/blob/master/text/2945-c-unwind-abi.md
2021-03-10Fix "run" button position in error indexGuillaume Gomez-0/+1
2021-03-10Allow doc alias attributes to use both list and valueGuillaume Gomez-0/+7
2021-03-10Rollup merge of #82733 - Yn0ga:master, r=estebankYuki Okushi-0/+1
Add powerpc-unknown-openbsd target
2021-03-09address pr review commentskatelyn a. martin-1/+2
### Add debug assertion to check `AbiDatas` ordering This makes a small alteration to `Abi::index`, so that we include a debug assertion to check that the index we are returning corresponds with the same abi in our data array. This will help prevent ordering bugs in the future, which can manifest in rather strange errors. ### Using exhaustive ABI matches This slightly modifies the changes from our previous commits, favoring exhaustive matches in place of `_ => ...` fall-through arms. This should help with maintenance in the future, when additional ABI's are added, or when existing ABI's are modified. ### List all `-unwind` ABI's in unstable book This updates the `c-unwind` page in the unstable book to list _all_ of the other ABI strings that are introduced by this feature gate. Now, all of the ABI's specified by RFC 2945 are shown. Co-authored-by: Amanieu d'Antras <amanieu@gmail.com> Co-authored-by: Niko Matsakis <niko@alum.mit.edu>
2021-03-09rustc_target: add "unwind" payloads to `Abi`katelyn a. martin-0/+14
### Overview This commit begins the implementation work for RFC 2945. For more information, see the rendered RFC [1] and tracking issue [2]. A boolean `unwind` payload is added to the `C`, `System`, `Stdcall`, and `Thiscall` variants, marking whether unwinding across FFI boundaries is acceptable. The cases where each of these variants' `unwind` member is true correspond with the `C-unwind`, `system-unwind`, `stdcall-unwind`, and `thiscall-unwind` ABI strings introduced in RFC 2945 [3]. ### Feature Gate and Unstable Book This commit adds a `c_unwind` feature gate for the new ABI strings. Tests for this feature gate are included in `src/test/ui/c-unwind/`, which ensure that this feature gate works correctly for each of the new ABIs. A new language features entry in the unstable book is added as well. ### Further Work To Be Done This commit does not proceed to implement the new unwinding ABIs, and is intentionally scoped specifically to *defining* the ABIs and their feature flag. ### One Note on Test Churn This will lead to some test churn, in re-blessing hash tests, as the deleted comment in `src/librustc_target/spec/abi.rs` mentioned, because we can no longer guarantee the ordering of the `Abi` variants. While this is a downside, this decision was made bearing in mind that RFC 2945 states the following, in the "Other `unwind` Strings" section [3]: > More unwind variants of existing ABI strings may be introduced, > with the same semantics, without an additional RFC. Adding a new variant for each of these cases, rather than specifying a payload for a given ABI, would quickly become untenable, and make working with the `Abi` enum prone to mistakes. This approach encodes the unwinding information *into* a given ABI, to account for the future possibility of other `-unwind` ABI strings. ### Ignore Directives `ignore-*` directives are used in two of our `*-unwind` ABI test cases. Specifically, the `stdcall-unwind` and `thiscall-unwind` test cases ignore architectures that do not support `stdcall` and `thiscall`, respectively. These directives are cribbed from `src/test/ui/c-variadic/variadic-ffi-1.rs` for `stdcall`, and `src/test/ui/extern/extern-thiscall.rs` for `thiscall`. This would otherwise fail on some targets, see: https://github.com/rust-lang-ci/rust/commit/fcf697f90206e9c87b39d494f94ab35d976bfc60 ### Footnotes [1]: https://github.com/rust-lang/rfcs/blob/master/text/2945-c-unwind-abi.md [2]: https://github.com/rust-lang/rust/issues/74990 [3]: https://github.com/rust-lang/rfcs/blob/master/text/2945-c-unwind-abi.md#other-unwind-abi-strings
2021-03-08Rollup merge of #82810 - amaurremi:source-based-coverage-typo, r=ehussMara Bos-1/+1
Typo fix in Unstable book: `cargo cov` -> `cargo profdata`
2021-03-07Rollup merge of #77916 - QuiltOS:kernel-code-targets-os-none, r=joshtriplettYuki Okushi-2/+2
Change built-in kernel targets to be os = none throughout Whether for Rust's own `target_os`, LLVM's triples, or GNU config's, the OS-related have fields have been for code running *on* that OS, not code hat is *part* of the OS. The difference is huge, as syscall interfaces are nothing like freestanding interfaces. Kernels are (hypervisors and other more exotic situations aside) freestanding programs that use the interfaces provided by the hardware. It's *those* interfaces, the ones external to the program being built and its software dependencies, that are the content of the target. For the Linux Kernel in particular, `target_env: "gnu"` is removed for the same reason: that `-gnu` refers to glibc or GNU/linux, neither of which applies to the kernel itself. Relates to #74247
2021-03-05Typo fix: cargo cov -> cargo profdataMarianna Rapoport-1/+1
2021-03-04Add powerpc-unknown-openbsd targetyn0ga-0/+1
Add powerpc-unknown-openbsd target * Fix missing abi::endian crate * Missing platform-support.md
2021-03-04Rollup merge of #82690 - jyn514:remove-pass-docs, r=ManishearthGuillaume Gomez-132/+67
Update rustdoc documentation - Remove most of the information about passes. Passes are deprecated. - Add `--document-private-items`; it was missing before. - Update `--output-format json`; it was very outdated. - Note that `--input-format` is deprecated. - Move deprecated options to the very end. Closes https://github.com/rust-lang/rust/issues/82675. r? `@Manishearth`
2021-03-04Update rustdoc documentationJoshua Nelson-132/+67
- Remove most of the information about passes. Passes are deprecated. - Add `--document-private-items`; it was missing before. - Update `--output-format json`; it was very outdated. - Note that `--input-format` is deprecated. - Move deprecated options to the very end. - Move `passes.html` to the end of the table of contents. Ideally it would be removed altogether, but that causes mdbook not to generate the docs.
2021-03-04Rollup merge of #82315 - jsha:font-display-swap, r=GuillaumeGomezYuki Okushi-0/+6
Improve page load performance in rustdoc Add an explicit height to icons (which already had an explicit width) to allow browsers to lay out the page more accurately before the icons have been loaded. https://web.dev/optimize-cls/. Add min-width: 115px to the crate search dropdown. When the HTML first loads, this dropdown includes only the text "All crates." Later, JS loads the items underneath it, some of which are wider. That causes the dropdown to get wider, causing a distracting reflow. This sets a min-width based on the size that the dropdown eventually becomes based on the crates on doc.rust-lang.org, reducing page movement during load. Add font-display: swap. Per https://web.dev/font-display/, this prevents "flash of invisible text" during load by using a system font until the custom font is available. I've noticed this flash of invisible text occasionally when reading Rust docs. Note that users without cached fonts will see text, and then see it reflow. For `docs.rust-lang.org`, [setting caching headers will help a lot](https://github.com/rust-lang/simpleinfra/issues/62). Generated output at https://jacob.hoffman-andrews.com/rust/flow-improvements/std/string/struct.String.html.
2021-03-04Rollup merge of #80527 - jyn514:rustdoc-lints, r=GuillaumeGomezYuki Okushi-14/+21
Make rustdoc lints a tool lint instead of built-in - Rename `broken_intra_doc_links` to `rustdoc::broken_intra_doc_links` (and similar for other rustdoc lints; I don't expect any others to be used frequently, though). - Ensure that the old lint names still work and give deprecation errors - Register lints even when running doctests - Move lint machinery into a separate file - Add `declare_rustdoc_lint!` macro Unblocks https://github.com/rust-lang/rust/pull/80300, https://github.com/rust-lang/rust/pull/79816, https://github.com/rust-lang/rust/pull/80965. Makes the strangeness in https://github.com/rust-lang/rust/pull/77364 more apparent to the end user (note that `missing_docs` is *not* moved to rustdoc in this PR). Closes https://github.com/rust-lang/rust/issues/78786. ## Current status This is blocked on #82620 (see https://github.com/rust-lang/rust/pull/80527#issuecomment-787401519)
2021-03-02Improve page load performance in rustdoc.Jacob Hoffman-Andrews-0/+6
Add font-display: swap. Per https://web.dev/font-display/, this prevents "flash of invisible text" during load by using a system font until the custom font is available. I've noticed this flash of invisible text occasionally when reading Rust docs. Add an explicit height to icons (which already had an explicit width) to allow browsers to lay out the page more accurately before the icons have been loaded. https://web.dev/optimize-cls/. Add min-width: 115px to the crate search dropdown. When the HTML first loads, this dropdown includes only the text "All crates." Later, JS loads the items underneath it, some of which are wider. That causes the dropdown to get wider, causing a distracting reflow. This sets a min-width based on the size that the dropdown eventually becomes based on the crates on doc.rust-lang.org, reducing page movement during load.
2021-03-02Rollup merge of #82691 - ehuss:update-books, r=ehussYuki Okushi-0/+0
Update books ## reference 2 commits in 361367c126290ac17cb4089f8d38fd8b2ac43f98..3b6fe80c205d2a2b5dc8a276192bbce9eeb9e9cf 2021-02-15 09:58:13 -0800 to 2021-02-22 22:09:17 -0800 - Add an extra fn() entry to the variance table in the subtyping chapter (rust-lang-nursery/reference#874) - Turbofish: Explain what the example is of. (rust-lang-nursery/reference#966) ## book 28 commits in db5e8a5105aa22979490dce30e33b68d8645761d..0f87daf683ae3de3cb725faecb11b7e7e89f0e5a 2021-02-12 16:58:20 -0500 to 2021-03-01 08:54:04 -0500 - Ohhh the should_panic was for mdbook test. Oops - Fix bad regex in the update rustc script and regenerate broken output - Clarify that we only mentioned unwrap_or_else, but haven't explained it - Add ferris to some listings that don't compile. Fixes rust-lang/book#2598 - Remove fancy quote from a code comment - Panic now points at our code, not stdlib slice code - Disable playground on thread::sleep examples - Disable playground button on listings in ch 12 that use CLI args - Reword ambiguous sentence. Fixes rust-lang/book#2317. - Rename shoes_in_my_size to shoes_in_size to be a better example - Fix visible "ANCHOR: here" in listing 13-21 (rust-lang/book#2628) - minor clarification about deriving Copy and Clone (rust-lang/book#2627) - Clarify relationship of trait to mock object - Fix "message" that should be "method" - Fix rust-lang/book#2625 (rust-lang/book#2626) - fix misleading hash claim (rust-lang/book#2621) - Make link syntax consistent and word wrap - Added hyperlinks to Appendices - Use console syntax highlighting in some more places - Merge remote-tracking branch 'origin/pr/2615' - Fix broken blockquote - Update one more bit of output caught by the update rust script - Update and clarify some text affected by the rand update - Update lock files and output - Update error output for changes to chapter 10 listings - Merge remote-tracking branch 'origin/pr/2542' - Tweak wording in for loop explanation - Merge remote-tracking branch 'origin/pr/2460' ## rust-by-example 1 commits in 551cc4bc8394feccea6acd21f86d9a4e1d2271a0..3e0d98790c9126517fa1c604dc3678f396e92a27 2021-02-03 17:12:37 -0300 to 2021-02-25 08:23:10 -0300 - Make flow_control/for/.into_iter() example run (rust-lang/rust-by-example#1415) ## rustc-dev-guide 530 commits in 7adfab42bab045a848126895c2f1e09927c1331a..c431f8c29a41413dddcb3bfa0d71c9cabe366317 2020-04-08 08:52:05 +0200 to 2021-02-28 16:35:20 -0500 ... Many updates. ## embedded-book 1 commits in 4cf7981696a85c3e633076c6401611bd3f6346c4..a96d096cffe5fa2c84af1b4b61e1492f839bb2e1 2021-02-11 10:55:22 +0000 to 2021-02-17 08:08:52 +0000 - Add note about using more recent openocd interface file. Closes rust-embedded/book#277 and rust-embedded/book#263 (rust-embedded/book#284)
2021-03-02Rollup merge of #80874 - jyn514:intra-doc-docs, r=ManishearthYuki Okushi-13/+62
Update intra-doc link documentation to match the implementation r? `@Manishearth` cc `@camelid` `@m-ou-se` Relevant PRs: - https://github.com/rust-lang/rust/pull/74489 - https://github.com/rust-lang/rust/pull/80181 - https://github.com/rust-lang/rust/pull/76078 - https://github.com/rust-lang/rust/pull/77519 - https://github.com/rust-lang/rust/pull/73101 Relevant issues: - https://github.com/rust-lang/rust/issues/78800 - https://github.com/rust-lang/rust/issues/77200 - https://github.com/rust-lang/rust/issues/77199 / https://github.com/rust-lang/rust/issues/54191/ I haven't documented things that I consider 'just bugs', like https://github.com/rust-lang/rust/issues/77732, but I have documented features that aren't implemented, like https://github.com/rust-lang/rust/issues/78800.
2021-03-01Update booksEric Huss-0/+0
2021-03-01Address review commentsJoshua Nelson-14/+21
- Move MISSING_CRATE_LEVEL_DOCS to rustdoc directly - Update documentation This also takes the opportunity to make the `no-crate-level-doc-lint` test more specific.
2021-03-01Change built-in kernel targets to be os = none throughoutJohn Ericson-2/+2
Whether for Rust's own `target_os`, LLVM's triples, or GNU config's, the OS-related have fields have been for code running *on* that OS, not code that is *part* of the OS. The difference is huge, as syscall interfaces are nothing like freestanding interfaces. Kernels are (hypervisors and other more exotic situations aside) freestanding programs that use the interfaces provided by the hardware. It's *those* interfaces, the ones external to the program being built and its software dependencies, that are the content of the target. For the Linux Kernel in particular, `target_env: "gnu"` is removed for the same reason: that `-gnu` refers to glibc or GNU/linux, neither of which applies to the kernel itself. Relates to #74247 Thanks @ojeda for catching some things.
2021-03-01Update supported platforms docJakub Kulik-2/+2
2021-02-28Auto merge of #82350 - ehuss:test-chapter, r=jyn514bors-1/+287
Add a chapter on the test harness. There isn't really any online documentation on the test harness, so this adds a chapter to the rustc book which provides information on how the harness works and details on the command-line options.
2021-02-27Remove the x86_64-rumprun-netbsd targetSimonas Kazlauskas-1/+0
Closes #81514
2021-02-27Rollup merge of #82396 - pickfire:patch-5, r=GuillaumeGomezDylan DPC-2/+2
Add Future trait for doc_spotlight feature doc
2021-02-27Add for example word to spotlight docIvan Tham-2/+2
As suggested by GuillaumeGomez
2021-02-25Rollup merge of #82463 - jrmuizel:patch-1, r=steveklabnikAaron Hill-1/+1
panic_bounds_checks should be panic_bounds_check
2021-02-24Use Oxform commaIvan Tham-1/+1
Co-authored-by: Nathan Nguyen <43092380+nhwn@users.noreply.github.com>
2021-02-23panic_bounds_checks should be panic_bounds_checkJeff Muizelaar-1/+1
2021-02-23Fix typo in sanitizer flag in unstable book.Corey Farwell-2/+2
2021-02-22Fix compile failure due to 2015 module system being weirdJoshua Nelson-1/+1
2021-02-23Rollup merge of #82166 - kaniini:s390x-musl-target, r=nagisaDylan DPC-0/+1
add s390x-unknown-linux-musl target This is the first step in bringup for Rust on s390x. The libc and std crates need modifications as well, but getting this upstream makes that work easier.
2021-02-23Rollup merge of #81154 - dylni:improve-design-of-assert-len, r=KodrAusDylan DPC-10/+0
Improve design of `assert_len` It was discussed in the [tracking issue](https://github.com/rust-lang/rust/issues/76393#issuecomment-761765448) that `assert_len`'s name and usage are confusing. This PR improves them based on a suggestion by ``@scottmcm`` in that issue. I also improved the documentation to make it clearer when you might want to use this method. Old example: ```rust let range = range.assert_len(slice.len()); ``` New example: ```rust let range = range.ensure_subset_of(..slice.len()); ``` Fixes #81157
2021-02-23Rollup merge of #79423 - camelid:smart-punct, r=jyn514Dylan DPC-5/+21
Enable smart punctuation Closes #76690.
2021-02-22Update for review comments.Eric Huss-9/+10
2021-02-22Add Future trait for doc_spotlight feature docIvan Tham-2/+2
2021-02-21Rollup merge of #81966 - deg4uss3r:degausser/aarch64_apple_ios_sim, r=shepmasterYuki Okushi-0/+1
Add new `rustc` target for Arm64 machines that can target the iphonesimulator This PR lands a new target (`aarch64-apple-ios-sim`) that targets arm64 iphone simulator, previously unreachable from Apple Silicon machines. resolves #81632 r? `@shepmaster`
2021-02-20Add a chapter on the test harness.Eric Huss-1/+286
2021-02-20iOS simulator: pick the target based on the environment variableJan-Erik Rediger-1/+1
LLVM picks the right things to put into the compiled object file based on the target deployment version. We need to communicate it through the target triple. Only with that LLVM will use the right commands in the file to make it look and behave like code compiled for the arm64 iOS simulator target.
2021-02-20Rollup merge of #82316 - ehuss:lto-doc-fix, r=GuillaumeGomezGuillaume Gomez-3/+3
Fix minor mistake in LTO docs. `-C lto=true` isn't a valid option.
2021-02-19Fix minor mistake in LTO docs.Eric Huss-3/+3
`-C lto=true` isn't a valid option.