about summary refs log tree commit diff
path: root/src/doc
AgeCommit message (Collapse)AuthorLines
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-09Update cmake version in prerequisites.md (#1077)Wesley Wiser-1/+1
LLVM requires at least cmake 3.13.4. https://www.llvm.org/docs/CMake.html
2021-03-09Fix typo: suceed -> succeedChayim Refael Friedman-1/+1
2021-03-09Add article on using WPA to profile rustc memory usage on Windows (#1074)Wesley Wiser-0/+113
Document how to use WPA to profile rustc and what the normal workflow should be for investigating bootstrap memory usage issues. Co-authored-by: Ryan Levick <ryan.levick@gmail.com>
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-07Use more accurate estimate of generated LLVM IR with llvm-linesTomasz Miąsko-27/+41
The `--emit=llvm-ir` emits an optimized LLVM IR. For optimized builds it will be highly inaccurate estimate of the amount IR generated initially. While the inaccuracy can be somewhat reduce after disabling the optimization, that in turn has other unintended consequences, since opt-level controls the emission of lifetime markers, sharing of generics between crates, instantiation of inline functions, etc. Use `-Csave-temps` and `no-opt` bitcode as a basis for more accurate estimate of initial work handed of to the LLVM.
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-28Cleanup rustdoc chapters a bitCamelid-12/+9
* Rename "The walking tour of rustdoc" to "Rustdoc overview", which I think is a more accurate name * Use same name in sidebar TOC as in chapter text * Make links between the two chapters prominent * Convert a few `.html` links to `.md` Probably we should just merge the chapters, but leaving that for later.
2021-02-28Fix broken linksYuki Okushi-3/+3
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-26Document how to enable CI LLVM without using `x.py setup`Camelid-0/+8
2021-02-26Remove some unrelated changesCamelid-2/+2
2021-02-26Fix typosCamelid-5/+5
2021-02-26Restore instructions for using system LLVMCamelid-0/+28
They were removed in #1030, but are still useful.
2021-02-26Update some out-of-date informationCamelid-20/+18
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-24Fixes typo in getting started guideDaniel Santos-1/+1
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-22Fix formatting of more date references (#1067)Camelid-27/+38
2021-02-21Fix broken links in query.md (#1068)Hirochika Matsumoto-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-20Update docs from date triage for 2021-02 (#1048)Camelid-24/+56
The biggest change was updating the list of rustdoc passes. Several new ones have been added since that documentation was written, so I added those, and I also sorted the list so it is roughly alphabetical (except for the part for the `strip-*` passes, which I left in the same order since one of the list items has two passes so there's no "correct" order).
2021-02-20Fix date-check comment formatting (#1066)Camelid-10/+10
I realized that the format I had been previously using for date-checks (as of January 2021 <!-- date: 2021-01 -->) left a space before the closing parenthesis in the rendered output, which looks weird. I could fix this by removing the space between `2021` and `<!-- ...`, but that looks weird in the source. So I ended up deciding on changing it to (as of <!-- date: 2021-01 --> January 2021)
2021-02-20Add a chapter on the test harness.Eric Huss-1/+286