about summary refs log tree commit diff
path: root/src/doc
AgeCommit message (Collapse)AuthorLines
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
2020-11-09Rollup merge of #78228 - pietroalbini:finally, r=Mark-SimulacrumDylan DPC-1/+7
Promote aarch64-unknown-linux-gnu to Tier 1 This PR promotes the `aarch64-unknown-linux-gnu` target to Tier 1, as proposed by [RFC 2959]: * The `aarch64-gnu` CI job is moved from `auto-fallible` to `auto`. * The platform support documentation is updated, uplifting the target to Tiert 1 with a note about missing stack probes support. * Building the documentation is enabled for the target, as we produce the `rust-docs` component for all Tier 1 platforms. [RFC 2959]: https://github.com/rust-lang/rfcs/pull/2959
2020-11-06Auto merge of #75778 - AndyGauge:75521-rustdoc-book-improvements, r=jyn514bors-31/+282
75521 rustdoc book improvements Added some guidelines about documenting with rustdoc Fixes #75521
2020-11-07Rollup merge of #78726 - GuillaumeGomez:back-link-to-main-website, ↵Yuki Okushi-1/+2
r=steveklabnik Add link to rust website Fixes #30838 This doesn't fix the issue as suggested but it at least adds a link to allow to go back to the rust website. r? `@steveklabnik`
2020-11-05doc/rustc: promote aarch64-unknown-linux-gnu to tier 1Pietro Albini-1/+7
This also adds a note about missing stack probes support, per the discussion on RFC 2959.
2020-11-05Rename lint to non_autolinksGuillaume Gomez-2/+2
2020-11-05Update URLs used in the lint exampleGuillaume Gomez-14/+15
2020-11-05Rename automatic_links to url_improvementsGuillaume Gomez-1/+1
2020-11-05Improve automatic_links globallyGuillaume Gomez-10/+3
2020-11-05Extend automatic_links lint to take into account URLs without link syntaxGuillaume Gomez-9/+13
2020-11-05Add documentation for automatic_links lintGuillaume Gomez-0/+40
2020-11-04Added Rustdoc book sections for linting and embedding more examplesAndrew Gauger-31/+282
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-11-04ci: demote i686-unknown-freebsd to tier 2 compiler targetPietro Albini-1/+1
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.
2020-11-04Add link to rust websiteGuillaume Gomez-1/+2
2020-11-03Rollup merge of #77950 - arlosi:sha256, r=eddybMara Bos-1/+1
Add support for SHA256 source file hashing Adds support for `-Z src-hash-algorithm sha256`, which became available in LLVM 11. Using an older version of LLVM will cause an error `invalid checksum kind` if the hash algorithm is set to sha256. r? `@eddyb` cc #70401 `@est31`
2020-11-03Rollup merge of #78676 - kiffie:embedded-bare-mipsr2, r=jonas-schievinkYuki Okushi-0/+1
add mipsel-unknown-none target This adds a target for bare MIPS32r2, little endian, softfloat. This target can be used for PIC32 microcontrollers (or possibly for other devices that have a MIPS MCU core such as the M4K core). Tried to find a name for the target that is in line with the naming scheme apparently used for the other MIPS targets. r? `@jonas-schievink`
2020-11-03Rollup merge of #78616 - richkadel:unstable-book-instr-cov, r=tmandryYuki Okushi-0/+169
Document -Zinstrument-coverage r? ``@tmandry`` FYI ``@wesleywiser`` Here is my proposed document for LLVM source-based code coverage. I based it on the `profile.md` page, in the same directory, and on the Clang guide for LLVM source-based coverage.
2020-11-02add mipsel-unknown-none targetStephan-0/+1
2020-11-02addressed feedbackRich Kadel-15/+24