about summary refs log tree commit diff
path: root/src/doc
AgeCommit message (Collapse)AuthorLines
2021-01-17Feature-gate `pointer` and `reference` in intra-doc linksJoshua Nelson-0/+15
- Only feature gate associated items - Add docs to unstable book
2021-01-14Rollup merge of #80973 - ehuss:update-books, r=ehussMara Bos-0/+0
Update books ## nomicon 2 commits in a5a48441d411f61556b57d762b03d6874afe575d..a8584998eacdea7106a1dfafcbf6c1c06fcdf925 2020-12-06 10:39:41 +0900 to 2021-01-06 12:49:49 -0500 - Update vector code examples - Remove outdated information about `jemalloc` ## reference 13 commits in b278478b766178491a8b6f67afa4bcd6b64d977a..50af691f838937c300b47812d0507c6d88c14f97 2020-12-21 18:18:03 -0800 to 2021-01-12 21:19:20 -0800 - Update grammar for parser unification. (rust-lang/reference#927) - Define constraining an implementation (rust-lang/reference#928) - Document extra behavior of #[no_mangle] (rust-lang/reference#930) - Add a float examle without a `.`. (rust-lang/reference#929) - Add more details about const generics. (rust-lang/reference#921) - Fix footnotes. (rust-lang/reference#926) - Add "Logic errors" as behavior not considered unsafe (rust-lang/reference#919) - Update grammar for order of parameters/arguments. (rust-lang/reference#920) - Fix formatting in the tuple section (rust-lang/reference#923) - document const generics (rust-lang/reference#901) - Update mdbook (rust-lang/reference#918) - linkage.md: update link to FFI section of the Book. (rust-lang/reference#917) - Document array expression with a const. (rust-lang/reference#914) ## book 8 commits in 5bb44f8b5b0aa105c8b22602e9b18800484afa21..ac57a0ddd23d173b26731ccf939f3ba729753275 2020-12-18 20:07:31 -0500 to 2021-01-09 14:18:45 -0500 - Update version of mdbook we're testing with to 0.4.5 (rust-lang/book#2561) - Fix grammar in ch13-01-closures.md (rust-lang/book#2534) - Merge remote-tracking branch 'origin/pr/2527' - Clarify code example ch6.3 (rust-lang/book#2485) - Fix link added in rust-lang/book#2495 to be relative and at the bottom - Merge remote-tracking branch 'origin/pr/2495' - Update output to match the updated poem punctuation - Fix rust-lang/book#2539 - Remove fancy apostrophes from poem for Windows ## rust-by-example 3 commits in 1cce0737d6a7d3ceafb139b4a206861fb1dcb2ab..03e23af01f0b4f83a3a513da280e1ca92587f2ec 2020-12-21 17:36:29 -0300 to 2021-01-09 10:20:28 -0300 - Replace for loop with iteration (rust-lang/rust-by-example#1404) - Update mdbook (rust-lang/rust-by-example#1402) - Add note for match guards to include catch-all (rust-lang/rust-by-example#1401) ## embedded-book 1 commits in ba34b8a968f9531d38c4dc4411d5568b7c076bfe..ceec19e873be87c6ee5666b030c6bb612f889a96 2020-11-17 00:20:43 +0000 to 2021-01-03 13:13:10 +0000 - book.toml: add link to GitHub repo (rust-embedded/book#276)
2021-01-13Update tests for extern block lintingMark Rousskov-1/+1
2021-01-12Update booksEric Huss-0/+0
2021-01-10Fix relative linksJoshua Nelson-8/+8
Co-authored-by: Camelid <camelidcamel@gmail.com>
2021-01-10Fix typoJoshua Nelson-1/+1
Co-authored-by: Camelid <camelidcamel@gmail.com>
2021-01-10Address review commentsJoshua Nelson-25/+41
- Improve wording - Use relative links - Use a proper list instead of a wall of text - Improve examples
2021-01-10Document differences from markdownJoshua Nelson-0/+3
2021-01-10Update intra-doc link documentation to match the implementationJoshua Nelson-8/+56
2021-01-10Fix typo in source-based-code-coverage.mdIkko Ashimine-1/+1
preceeding -> preceding
2020-12-31Merge remote-tracking branch 'origin/master' into frewsxcv-sanCorey Farwell-26/+33
2020-12-29Fix typo in ffi-pure.mdIkko Ashimine-1/+1
accesing -> accessing
2020-12-28Rollup merge of #80410 - MarcoIeni:patch-1, r=jonas-schievinkMara Bos-1/+1
rustdoc book: fix example `lib.rs` file is created only if `--lib` flag is specified
2020-12-28Rollup merge of #80393 - ehuss:doc-git-link, r=jyn514Mara Bos-0/+6
Add links to the source for the rustc and rustdoc books. This adds a little icon in the upper-right corner of the books so that readers can find the source if they want to make changes or file issues. This is already included in several of the other books.
2020-12-27rustdoc book: fix exampleMarco Ieni-1/+1
2020-12-27Auto merge of #79642 - ijackson:default-theme-stab, r=jyn514bors-0/+20
rustdoc: stabilise --default-theme command line option As discussed in #77213, this seems like it has bedded in and can be safely and usefully made stable. (rustdoc already has other stable options that interact quite intimately with the rustdoc-supplied CSS, and also an option for supplying entirely different CSS, so exposing the theme names this way seems a very minor step.) There is also a commit to do some minor grammar fixes to the help message.
2020-12-26Fix missing deny-by-default.md file.Eric Huss-0/+3
2020-12-26Add links to the source for the rustc and rustdoc books.Eric Huss-0/+6
2020-12-25Auto merge of #80296 - ↵bors-3/+0
wesleywiser:revert_missing_fragment_specifier_hard_error, r=Mark-Simulacrum Revert missing fragment specifier hard error Closes #76605 Reopens #40107 r? `@Mark-Simulacrum`
2020-12-22Revert "Remove missing_fragment_specifier lint"Wesley Wiser-3/+0
This reverts commit 5ba961018c482e050af908de60e4f8bd1a00f0ae.
2020-12-21Update booksEric Huss-0/+0
2020-12-13Fix `cargo-binutils` linkEFanZh-3/+3
2020-12-10Rollup merge of #79858 - sasurau4:doc/update-unstable-book-const-fn, r=oli-obkTyler Mandry-21/+2
Update const-fn doc in unstable-book Fix #79691 I couldn't find suitable examples. It seems that `const_fn` feature-gate used only following place. https://github.com/rust-lang/rust/blob/810324d1f31eb8d75e8f0044df720652986ef133/compiler/rustc_ast_passes/src/feature_gate.rs#L560-L562 And example like following emits [E0379](https://doc.rust-lang.org/error-index.html#E0379). ```rust #![feature(const_fn)] trait Foo { const fn bar() -> Self; } ``` Any other suitable example exists, please let me know.
2020-12-10Update sanitizer supported docs to reflect realityCorey Farwell-2/+26
2020-12-10Update const-fn doc in unstable-bookDaiki Ihara-21/+2
Update src/doc/unstable-book/src/language-features/const-fn.md Co-authored-by: Ivan Tham <pickfire@riseup.net>
2020-12-07Fixes to Rust coverageRich Kadel-4/+87
Fixes: #79725 Some macros can create a situation where `fn_sig_span` and `body_span` map to different files. New documentation on coverage tests incorrectly assumed multiple test binaries could just be listed at the end of the `llvm-cov` command, but it turns out each binary needs a `--object` prefix. This PR fixes the bug and updates the documentation to correct that issue. It also fixes a few other minor issues in internal implementation comments, and adds documentation on getting coverage results for doc tests.
2020-12-03Addressed feedback from 2020-12-01Rich Kadel-0/+2
Added one more test (two files) showing coverage of generics and unused functions across crates. Created and referenced new Issues, as requested. Added comments. Added a note about the possible effects of compiler options on LLVM coverage maps.
2020-12-03Combination of commitsRich Kadel-14/+89
Fixes multiple issue with counters, with simplification Includes a change to the implicit else span in ast_lowering, so coverage of the implicit else no longer spans the `then` block. Adds coverage for unused closures and async function bodies. Fixes: #78542 Adding unreachable regions for known MIR missing from coverage map Cleaned up PR commits, and removed link-dead-code requirement and tests Coverage no longer depends on Issue #76038 (`-C link-dead-code` is no longer needed or enforced, so MSVC can use the same tests as Linux and MacOS now) Restrict adding unreachable regions to covered files Improved the code that adds coverage for uncalled functions (with MIR but not-codegenned) to avoid generating coverage in files not already included in the files with covered functions. Resolved last known issue requiring --emit llvm-ir workaround Fixed bugs in how unreachable code spans were added.
2020-12-03Coverage tests for remaining TerminatorKinds and async, improve AssertRich Kadel-3/+1
Tested and validate results for panic unwind, panic abort, assert!() macro, TerminatorKind::Assert (for example, numeric overflow), and async/await. Implemented a previous documented idea to change Assert handling to be the same as FalseUnwind and Goto, so it doesn't get its own BasicCoverageBlock anymore. This changed a couple of coverage regions, but I validated those changes are not any worse than the prior results, and probably help assure some consistency (even if some people might disagree with how the code region is consistently computed). Fixed issue with async/await. AggregateKind::Generator needs to be handled like AggregateKind::Closure; coverage span for the outer async function should not "cover" the async body, which is actually executed in a separate "closure" MIR.
2020-12-03fix typo in src/doc/rustdoc/src/command-line-arguments.mdIan Jackson-1/+1
Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
2020-12-03rustdoc: document --default-theme option in command line docIan Jackson-0/+20
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2020-12-01Auto merge of #78684 - devsnek:inline-asm-wasm, r=Amanieubors-0/+5
Add wasm32 support to inline asm There is some contention around inline asm and wasm, and I really only made this to figure out the process of hacking on rustc, but I figured as long as the code existed, it was worth uploading. cc `@Amanieu`
2020-12-01Add wasm32 support to inline asmGus Caplan-0/+5
2020-12-01Rollup merge of #79583 - ehuss:update-books, r=ehussMara Bos-0/+0
Update books ## nomicon 1 commits in 23c49f1d5ce4720bc5b7e3a920f47eccc8da6b63..d8383b65f7948c2ca19191b3b4bd709b403aaf45 2020-11-05 13:30:53 +0900 to 2020-11-22 10:24:42 -0500 - Clarify that any alignment is valid for ZSTs ## reference 5 commits in a7de763c213292f5b44bf10acb87ffa38724814d..a8afdca5d0715b2257b6f8b9a032fd4dd7dae855 2020-11-11 19:13:21 -0800 to 2020-11-30 06:44:46 -0800 - Describe relationship between reference and optimizers (rust-lang/reference#902) - A simple missing space (rust-lang/reference#909) - Cleanup formatting (rust-lang/reference#907) - Use `doc`, not `test` for fn item inner attr example (rust-lang/reference#906) - Update where our chat is. (rust-lang/reference#903) ## book 1 commits in 13e1c05420bca86ecc79e4ba5b6d02de9bd53c62..a190438d77d28041f24da4f6592e287fab073a61 2020-10-20 14:57:32 -0500 to 2020-11-16 10:44:08 -0600 - Change SipHash not found (404) link to SipHash in Wikipedia (rust-lang/book#2503) ## rust-by-example 4 commits in 1886fda6981b723e4de637074455558f8bc1e83c..236c734a2cb323541b3394f98682cb981b9ec086 2020-10-28 13:46:54 -0500 to 2020-11-30 14:05:49 -0300 - Update old invalid link (rust-lang/rust-by-example#1392) - Moved "See also" link to the correct page. (rust-lang/rust-by-example#1389) - Fix some markdown lint warnings (rust-lang/rust-by-example#1388) - Minor grammar suggestion (rust-lang/rust-by-example#1386) ## embedded-book 1 commits in ca8169e69b479f615855d0eece7e318138fcfc00..ba34b8a968f9531d38c4dc4411d5568b7c076bfe 2020-10-15 15:06:35 +0000 to 2020-11-17 00:20:43 +0000 - Clarify CAS availability (rust-embedded/book#273)
2020-12-01Rollup merge of #79573 - he32:master, r=jonas-schievinkMara Bos-4/+4
Update with status for various NetBSD ports. The NetBSD ports of rust to aarch64, armv7*, i686, and powerpc** all both build and run. Status is as of rust 1.47.0. *) Natively requires repeated successive build attempts (`rustc` is such a resource pig VM-consumption-wise), or run in a chroot on an aarch64 host where the available VM space is 4GB instead of the native 2GB. **) Powerpc either requires `-latomic` in a directory searched by default by `ld` or to be built within pkgsrc which has a patch and support package to tackle this issue.
2020-11-30Update booksEric Huss-0/+0
2020-11-30Update with status for various NetBSD ports.Havard Eidnes-4/+4
The NetBSD ports of rust to aarch64, armv7*, i686, and powerpc** all both build and run. *) Natively requires repeated successive build attempts (rustc is such a resource pig VM-consumption-wise), or run in a chroot on an aarch64 host where the available VM space is 4GB instead of the native 2GB. **) Powerpc either requires -latomic in a directory searched by default by 'ld' or to be built within pkgsrc which has a patch to tackle this.
2020-11-30Add built-in support for the armv5te-unknown-linux-uclibceabi targetOndrej Perutka-0/+1
2020-11-26Add to platform-support.mdBenedikt Terhechte-1/+1
2020-11-26Add support for Arm64 Catalyst on ARM MacsBenedikt Terhechte-0/+1
2020-11-25Auto merge of #79336 - camelid:rename-feature-oibit-to-auto, r=oli-obkbors-3/+3
Rename `optin_builtin_traits` to `auto_traits` They were originally called "opt-in, built-in traits" (OIBITs), but people realized that the name was too confusing and a mouthful, and so they were renamed to just "auto traits". The feature flag's name wasn't updated, though, so that's what this PR does. There are some other spots in the compiler that still refer to OIBITs, but I don't think changing those now is worth it since they are internal and not particularly relevant to this PR. Also see <https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/opt-in.2C.20built-in.20traits.20(auto.20traits).20feature.20name>. r? `@oli-obk` (feel free to re-assign if you're not the right reviewer for this)
2020-11-24Rollup merge of #76858 - rcvalle:rust-lang-exploit-mitigations, r=steveklabnikJonas Schievink-0/+694
Add exploit mitigations chapter to the rustc book This section documents the exploit mitigations applicable to the Rust compiler when building programs for the Linux operating system on the AMD64 architecture and equivalent. This was done for a project I'm currently working on, and I hope it'll also be helpful to others.
2020-11-23Add exploit mitigations chapter to the rustc bookRamon de C Valle-0/+694
This section documents the exploit mitigations applicable to the Rust compiler when building programs for the Linux operating system on the AMD64 architecture and equivalent.
2020-11-23Rename `optin_builtin_traits` to `auto_traits`Camelid-3/+3
They were originally called "opt-in, built-in traits" (OIBITs), but people realized that the name was too confusing and a mouthful, and so they were renamed to just "auto traits". The feature flag's name wasn't updated, though, so that's what this PR does. There are some other spots in the compiler that still refer to OIBITs, but I don't think changing those now is worth it since they are internal and not particularly relevant to this PR. Also see <https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/opt-in.2C.20built-in.20traits.20(auto.20traits).20feature.20name>.
2020-11-22Drop support for cloudabi targetsLzu Tao-4/+0
2020-11-16Rollup merge of #78714 - m-ou-se:simplify-local-streams, r=KodrAusMara Bos-6/+1
Simplify output capturing This is a sequence of incremental improvements to the unstable/internal `set_panic` and `set_print` mechanism used by the `test` crate: 1. Remove the `LocalOutput` trait and use `Arc<Mutex<dyn Write>>` instead of `Box<dyn LocalOutput>`. In practice, all implementations of `LocalOutput` were just `Arc<Mutex<..>>`. This simplifies some logic and removes all custom `Sink` implementations such as `library/test/src/helpers/sink.rs`. Also removes a layer of indirection, as the outermost `Box` is now gone. It also means that locking now happens per `write_fmt`, not per individual `write` within. (So `"{} {}\n"` now results in one `lock()`, not four or more.) 2. Since in all cases the `dyn Write`s were just `Vec<u8>`s, replace the type with `Arc<Mutex<Vec<u8>>>`. This simplifies things more, as error handling and flushing can be removed now. This also removes the hack needed in the default panic handler to make this work with `::realstd`, as (unlike `Write`) `Vec<u8>` is from `alloc`, not `std`. 3. Replace the `RefCell`s by regular `Cell`s. The `RefCell`s were mostly used as `mem::replace(&mut *cell.borrow_mut(), something)`, which is just `Cell::replace`. This removes an unecessary bookkeeping and makes the code a bit easier to read. 4. Merge `set_panic` and `set_print` into a single `set_output_capture`. Neither the test crate nor rustc (the only users of this feature) have a use for using these separately. Merging them simplifies things even more. This uses a new function name and feature name, to make it clearer this is internal and not supposed to be used by other crates. Might be easier to review per commit.
2020-11-11Update booksEric Huss-0/+0
2020-11-10Merge set_panic and set_print into set_output_capture.Mara Bos-6/+1
There were no use cases for setting them separately. Merging them simplifies some things.
2020-11-09Rollup merge of #78746 - pietroalbini:i686-freebsd, r=Mark-SimulacrumDylan DPC-1/+1
Demote i686-unknown-freebsd to tier 2 compiler target While technically the `i686-unknown-freebsd` target has been a tier 2 development platform for a long time, with full toolchain tarballs available on static.rust-lang.org, due to a bug in the manifest generation the target was never available for download through rustup. The infrastructure team privately inquired the FreeBSD package maintainers, and they weren't relying on those tarballs either, so it's a fair assumption to say practically nobody is using those tarballs. This PR then removes the CI builder that produces full tarballs for the target, and moves the compilation of `rust-std` for the target in `dist-various-2`. The `x86_64-unknown-freebsd` target is *not* affected. cc `@rust-lang/infra` `@rust-lang/compiler` `@rust-lang/release` r? `@Mark-Simulacrum`
2020-11-09Add `#[cfg(panic = "...")]`David Hewitt-0/+38