Commit Graph

5680 Commits

Author SHA1 Message Date
Miguel Ojeda 755b3fc722 rustdoc: Support argument files
Factors out the `rustc_driver` logic that handles argument files
so that rustdoc supports them as well, e.g.:

    rustdoc @argfile

This is needed to be able to generate docs for projects that
already use argument files when compiling them, e.g. projects
that pass a huge number of `--cfg` arguments.

The feature was stabilized for `rustc` in #66172.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2021-02-19 02:32:45 +01:00
Yuki Okushi 135a05c5ae
Rollup merge of #82202 - kraj:kraj/riscv-musl, r=estebank
add specs for riscv32/riscv64 musl targets

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-02-18 15:57:28 +09:00
Eric Huss 5715f79b37 Update books 2021-02-16 17:19:28 -08:00
Khem Raj 8b38a5020f Add riscv32 and riscv64 musl to supported platform targets
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-02-16 16:44:39 -08:00
Eric Huss ec77574d13 Update link for extern prelude. 2021-02-14 19:38:40 -08:00
dylni f6111a256e Remove unnecessary documentation page 2021-02-12 22:01:04 -05:00
dylni cb647f3e8e Fix possible soundness issue in `ensure_subset_of` 2021-02-12 22:01:04 -05:00
dylni 9d29793614 Improve design of `assert_len` 2021-02-12 22:01:04 -05:00
Tri Vo 9c34c140a7 HWASan documentation 2021-02-08 00:24:45 -08:00
Camelid e4b83fcad4 Document smart punctuation 2021-02-07 20:19:16 -08:00
Jeremy Fitzhardinge 82ccb6582a Add `--extern-loc` to augment unused crate dependency diagnostics
This allows a build system to indicate a location in its own dependency
specification files (eg Cargo's `Cargo.toml`) which can be reported
along side any unused crate dependency.

This supports several types of location:
 - 'json' - provide some json-structured data, which is included in the json diagnostics
     in a `tool_metadata` field
 - 'raw' - emit the provided string into the output. This also appears as a json string in
     `tool_metadata`.

If no `--extern-location` is explicitly provided then a default json entry of the form
`"tool_metadata":{"name":<cratename>,"path":<cratepath>}` is emitted.
2021-02-07 14:54:20 -08:00
Jonas Schievink e143159e75
Rollup merge of #81766 - jyn514:task-lists, r=GuillaumeGomez
Enable 'task list' markdown extension

Closes https://github.com/rust-lang/rust/issues/71183.
2021-02-06 17:01:50 +01:00
Joshua Nelson 9653b601b2 Enable 'task list' markdown extension
- Add documentation about task lists
2021-02-06 00:08:21 -05:00
Eric Huss 900648cfd6 Adjust global_asm doc test to work on all platforms.
The cfg isn't actually necessary, since `--emit=metadata` does not
actually do enough validation for it to fail on any platform. However,
I feel a little more comfortable leaving it in.

Unhide the feature flag, since I think that is important to display.
2021-02-04 09:41:15 -08:00
Eric Huss dc7746f334 Elaborate on rustdoc example reason for being ignored. 2021-02-04 09:01:50 -08:00
Eric Huss bb22eaf39e tidy: Run tidy style against markdown files. 2021-02-04 09:01:50 -08:00
bors b593389edb Auto merge of #81346 - hug-dev:nonsecure-call-abi, r=jonas-schievink
Add a new ABI to support cmse_nonsecure_call

This adds support for the `cmse_nonsecure_call` feature to be able to perform non-secure function call.

See the discussion on Zulip [here](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Support.20for.20callsite.20attributes/near/223054928).

This is a followup to #75810 which added `cmse_nonsecure_entry`. As for that PR, I assume that the changes are small enough to not have to go through a RFC but I don't mind doing one if needed 😃
I did not yet create a tracking issue, but if most of it is fine, I can create one and update the various files accordingly (they refer to the other tracking issue now).

On the Zulip chat, I believe `@jonas-schievink` volunteered to be a reviewer 💯
2021-02-03 06:00:43 +00:00
Jack Huey 399c0a8e52
Rollup merge of #81455 - Amanieu:aarch64_ilp32, r=sanxiyn
Add AArch64 big-endian and ILP32 targets

This PR adds 3 new AArch64 targets:
- `aarch64_be-unknown-linux-gnu`
- `aarch64-unknown-linux-gnu_ilp32`
- `aarch64_be-unknown-linux-gnu_ilp32`

It also fixes some ABI issues on big-endian ARM and AArch64.
2021-02-02 16:01:35 -05:00
Hugues de Valon ce9818f2b7 Add a new ABI to support cmse_nonsecure_call
This commit adds a new ABI to be selected via `extern
"C-cmse-nonsecure-call"` on function pointers in order for the compiler to
apply the corresponding cmse_nonsecure_call callsite attribute.
For Armv8-M targets supporting TrustZone-M, this will perform a
non-secure function call by saving, clearing and calling a non-secure
function pointer using the BLXNS instruction.

See the page on the unstable book for details.

Signed-off-by: Hugues de Valon <hugues.devalon@arm.com>
2021-02-02 13:04:31 +00:00
Jonas Schievink 99f2f5a830
Rollup merge of #80404 - JulianKnodt:arr_ref, r=oli-obk
Remove const_in_array_repeat

Fixes #80371. Fixes #81315. Fixes #80767. Fixes #75682.

I thought there might be some issue with `Repeats(_, 0)`, but if you increase the items in the array it still ICEs. I'm not sure if this is the best fix but it does fix the given issue.
2021-01-31 16:36:42 +01:00
kadmin 6946534d84 Remove const_in_array_rep_expr 2021-01-30 23:20:24 +00:00
Yuki Okushi d9e56f48c5
Rollup merge of #79570 - alexcrichton:split-debuginfo, r=bjorn3
rustc: Stabilize `-Zrun-dsymutil` as `-Csplit-debuginfo`

This commit adds a new stable codegen option to rustc,
`-Csplit-debuginfo`. The old `-Zrun-dsymutil` flag is deleted and now
subsumed by this stable flag. Additionally `-Zsplit-dwarf` is also
subsumed by this flag but still requires `-Zunstable-options` to
actually activate. The `-Csplit-debuginfo` flag takes one of
three values:

* `off` - This indicates that split-debuginfo from the final artifact is
  not desired. This is not supported on Windows and is the default on
  Unix platforms except macOS. On macOS this means that `dsymutil` is
  not executed.

* `packed` - This means that debuginfo is desired in one location
  separate from the main executable. This is the default on Windows
  (`*.pdb`) and macOS (`*.dSYM`). On other Unix platforms this subsumes
  `-Zsplit-dwarf=single` and produces a `*.dwp` file.

* `unpacked` - This means that debuginfo will be roughly equivalent to
  object files, meaning that it's throughout the build directory
  rather than in one location (often the fastest for local development).
  This is not the default on any platform and is not supported on Windows.

Each target can indicate its own default preference for how debuginfo is
handled. Almost all platforms default to `off` except for Windows and
macOS which default to `packed` for historical reasons.

Some equivalencies for previous unstable flags with the new flags are:

* `-Zrun-dsymutil=yes` -> `-Csplit-debuginfo=packed`
* `-Zrun-dsymutil=no` -> `-Csplit-debuginfo=unpacked`
* `-Zsplit-dwarf=single` -> `-Csplit-debuginfo=packed`
* `-Zsplit-dwarf=split` -> `-Csplit-debuginfo=unpacked`

Note that `-Csplit-debuginfo` still requires `-Zunstable-options` for
non-macOS platforms since split-dwarf support was *just* implemented in
rustc.

There's some more rationale listed on #79361, but the main gist of the
motivation for this commit is that `dsymutil` can take quite a long time
to execute in debug builds and provides little benefit. This means that
incremental compile times appear that much worse on macOS because the
compiler is constantly running `dsymutil` over every single binary it
produces during `cargo build` (even build scripts!). Ideally rustc would
switch to not running `dsymutil` by default, but that's a problem left
to get tackled another day.

Closes #79361
2021-01-29 09:17:20 +09:00
Alex Crichton a124043fb0 rustc: Stabilize `-Zrun-dsymutil` as `-Csplit-debuginfo`
This commit adds a new stable codegen option to rustc,
`-Csplit-debuginfo`. The old `-Zrun-dsymutil` flag is deleted and now
subsumed by this stable flag. Additionally `-Zsplit-dwarf` is also
subsumed by this flag but still requires `-Zunstable-options` to
actually activate. The `-Csplit-debuginfo` flag takes one of
three values:

* `off` - This indicates that split-debuginfo from the final artifact is
  not desired. This is not supported on Windows and is the default on
  Unix platforms except macOS. On macOS this means that `dsymutil` is
  not executed.

* `packed` - This means that debuginfo is desired in one location
  separate from the main executable. This is the default on Windows
  (`*.pdb`) and macOS (`*.dSYM`). On other Unix platforms this subsumes
  `-Zsplit-dwarf=single` and produces a `*.dwp` file.

* `unpacked` - This means that debuginfo will be roughly equivalent to
  object files, meaning that it's throughout the build directory
  rather than in one location (often the fastest for local development).
  This is not the default on any platform and is not supported on Windows.

Each target can indicate its own default preference for how debuginfo is
handled. Almost all platforms default to `off` except for Windows and
macOS which default to `packed` for historical reasons.

Some equivalencies for previous unstable flags with the new flags are:

* `-Zrun-dsymutil=yes` -> `-Csplit-debuginfo=packed`
* `-Zrun-dsymutil=no` -> `-Csplit-debuginfo=unpacked`
* `-Zsplit-dwarf=single` -> `-Csplit-debuginfo=packed`
* `-Zsplit-dwarf=split` -> `-Csplit-debuginfo=unpacked`

Note that `-Csplit-debuginfo` still requires `-Zunstable-options` for
non-macOS platforms since split-dwarf support was *just* implemented in
rustc.

There's some more rationale listed on #79361, but the main gist of the
motivation for this commit is that `dsymutil` can take quite a long time
to execute in debug builds and provides little benefit. This means that
incremental compile times appear that much worse on macOS because the
compiler is constantly running `dsymutil` over every single binary it
produces during `cargo build` (even build scripts!). Ideally rustc would
switch to not running `dsymutil` by default, but that's a problem left
to get tackled another day.

Closes #79361
2021-01-28 08:51:11 -08:00
Amanieu d'Antras 69e6326564 Add new aarch64 targets to platform-support.md 2021-01-27 23:08:54 +00:00
Yuki Okushi 9da36082c2
Rollup merge of #81399 - ehuss:update-books, r=ehuss
Update books

## nomicon

7 commits in a8584998eacdea7106a1dfafcbf6c1c06fcdf925..bbf06ad39d1f45654047e9596b750cc6e6d1b693
2021-01-06 12:49:49 -0500 to 2021-01-22 07:07:31 -0800
- Fix alloc link in exotic-sizes for local docs (rust-lang-nursery/nomicon#255)
- Remove TODO
- Fix small punctuation error
- Arc revisions (Clone atomic explanation) (pt2/3(+?))
- Fix Arc Clone
- Arc revisions (pt1/2(+?))
- Simple Arc implementation (without Weak refs)

## reference

5 commits in 50af691f838937c300b47812d0507c6d88c14f97..f02b09eb6e8af340ad1256a54adb7aae2ff3163e
2021-01-12 21:19:20 -0800 to 2021-01-22 01:53:02 -0800
- Fix missing space (rust-lang-nursery/reference#941)
- Start documenting name resolution. (rust-lang-nursery/reference#937)
- Fix plural and delete spurious words in comparison ops (rust-lang-nursery/reference#932)
- Document execution order (rust-lang-nursery/reference#888)
- Compound operator expressions (rust-lang-nursery/reference#915)

## book

3 commits in ac57a0ddd23d173b26731ccf939f3ba729753275..e724bd826580ff95df48a8533af7dec1080693d4
2021-01-09 14:18:45 -0500 to 2021-01-20 08:19:49 -0600
- Fixes rust-lang/book#2417. Get the index from user input instead of a const. (rust-lang/book#2566)
- Turn off the playground in a bunch more lib.rs inclusions (rust-lang/book#2569)
- Merge pull request rust-lang/book#2567 from rust-lang/rust-1.49

## rust-by-example

1 commits in 03e23af01f0b4f83a3a513da280e1ca92587f2ec..f633769acef68574427a6fae6c06f13bc2199573
2021-01-09 10:20:28 -0300 to 2021-01-13 20:58:25 -0300
- Fixed styling on closure example (rust-lang/rust-by-example#1405)
2021-01-27 04:43:32 +09:00
Eric Huss fdd592acd0 Update books 2021-01-25 15:10:10 -08:00
Eric Huss 1c0a52d304 rustdoc: Document CommonMark extensions. 2021-01-25 11:03:15 -08:00
Joshua Nelson fc53594756 Feature-gate `pointer` and `reference` in intra-doc links
- Only feature gate associated items
- Add docs to unstable book
2021-01-17 15:27:35 -05:00
Mara Bos 3fe37c3830
Rollup merge of #80973 - ehuss:update-books, r=ehuss
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-14 18:00:20 +00:00
Mark Rousskov 8a3edb1d66 Update tests for extern block linting 2021-01-13 07:49:16 -05:00
Eric Huss 6bfd987aa0 Update books 2021-01-12 21:20:21 -08:00
Joshua Nelson 44c72f65d6
Fix relative links
Co-authored-by: Camelid <camelidcamel@gmail.com>
2021-01-10 23:10:05 -05:00
Joshua Nelson 21717f0c17
Fix typo
Co-authored-by: Camelid <camelidcamel@gmail.com>
2021-01-10 16:31:37 -05:00
Joshua Nelson db0b416656 Address review comments
- Improve wording
- Use relative links
- Use a proper list instead of a wall of text
- Improve examples
2021-01-10 16:00:18 -05:00
Joshua Nelson d5392d1962 Document differences from markdown 2021-01-10 10:20:36 -05:00
Joshua Nelson 02717911fd Update intra-doc link documentation to match the implementation 2021-01-10 09:30:28 -05:00
Ikko Ashimine 9ca80a29ec
Fix typo in source-based-code-coverage.md
preceeding -> preceding
2021-01-10 22:17:51 +09:00
Corey Farwell d482de30ea Merge remote-tracking branch 'origin/master' into frewsxcv-san 2020-12-31 23:27:33 -05:00
Ikko Ashimine 02db77c2d1
Fix typo in ffi-pure.md
accesing -> accessing
2020-12-29 13:37:21 +09:00
Mara Bos 7800c70fab
Rollup merge of #80410 - MarcoIeni:patch-1, r=jonas-schievink
rustdoc book: fix example

`lib.rs` file is created only if `--lib` flag is specified
2020-12-28 19:09:29 +00:00
Mara Bos bae6475443
Rollup merge of #80393 - ehuss:doc-git-link, r=jyn514
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-28 19:09:22 +00:00
Marco Ieni f57152f640
rustdoc book: fix example 2020-12-27 14:10:00 +01:00
bors dc6121ca68 Auto merge of #79642 - ijackson:default-theme-stab, r=jyn514
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-27 09:55:51 +00:00
Eric Huss 6dab9265c8 Fix missing deny-by-default.md file. 2020-12-26 13:53:10 -08:00
Eric Huss 142764f79e Add links to the source for the rustc and rustdoc books. 2020-12-26 13:22:33 -08:00
bors 1832bdd7de Auto merge of #80296 - 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-25 14:09:08 +00:00
Wesley Wiser 9414f0b833 Revert "Remove missing_fragment_specifier lint"
This reverts commit 5ba961018c.
2020-12-22 08:35:52 -05:00
Eric Huss 1339c81390 Update books 2020-12-21 19:00:49 -08:00
EFanZh 7662626f77
Fix `cargo-binutils` link 2020-12-13 19:23:16 +08:00
Tyler Mandry 8709ac81d3
Rollup merge of #79858 - sasurau4:doc/update-unstable-book-const-fn, r=oli-obk
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. 810324d1f3/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-10 21:33:12 -08:00
Corey Farwell 7ee606f514 Update sanitizer supported docs to reflect reality 2020-12-10 19:11:58 -05:00
Daiki Ihara caab16fa20 Update const-fn doc in unstable-book
Update src/doc/unstable-book/src/language-features/const-fn.md

Co-authored-by: Ivan Tham <pickfire@riseup.net>
2020-12-10 22:29:43 +09:00
Rich Kadel 95c268f64d Fixes to Rust coverage
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-07 17:56:19 -08:00
Rich Kadel d96f351fa3 Addressed feedback from 2020-12-01
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-03 09:50:10 -08:00
Rich Kadel def932ca86 Combination of commits
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-03 09:50:10 -08:00
Rich Kadel c45ee4bb29 Coverage tests for remaining TerminatorKinds and async, improve Assert
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-03 09:50:09 -08:00
Ian Jackson 63f3876b85
fix typo in src/doc/rustdoc/src/command-line-arguments.md
Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
2020-12-03 10:22:57 +00:00
Ian Jackson c21b275d35 rustdoc: document --default-theme option in command line doc
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2020-12-03 00:50:37 +00:00
bors 6645da366e Auto merge of #78684 - devsnek:inline-asm-wasm, r=Amanieu
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-01 20:23:06 +00:00
Gus Caplan d9f237caa6
Add wasm32 support to inline asm 2020-12-01 12:18:21 -06:00
Mara Bos c06a00e21d
Rollup merge of #79583 - ehuss:update-books, r=ehuss
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-01 10:50:26 +00:00
Mara Bos 2891f3ff3d
Rollup merge of #79573 - he32:master, r=jonas-schievink
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-12-01 10:50:25 +00:00
Eric Huss 9ba8d6e234 Update books 2020-11-30 17:25:23 -08:00
Havard Eidnes 1c367c0a70 Update with status for various NetBSD ports.
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-30 19:18:21 +01:00
Ondrej Perutka b2ad73e8a4 Add built-in support for the armv5te-unknown-linux-uclibceabi target 2020-11-30 09:47:09 +01:00
Benedikt Terhechte 836d43933d Add to platform-support.md 2020-11-26 11:33:38 +01:00
Benedikt Terhechte 96779647c4 Add support for Arm64 Catalyst on ARM Macs 2020-11-26 11:31:59 +01:00
bors ec039bd075 Auto merge of #79336 - camelid:rename-feature-oibit-to-auto, r=oli-obk
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-25 07:25:19 +00:00
Jonas Schievink 8fde4be7d0
Rollup merge of #76858 - rcvalle:rust-lang-exploit-mitigations, r=steveklabnik
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-24 13:17:28 +01:00
Ramon de C Valle 5b1cb0eb8a 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.
2020-11-23 19:25:59 -08:00
Camelid 810324d1f3 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>.
2020-11-23 14:14:06 -08:00
Lzu Tao 6bfe27a3e0 Drop support for cloudabi targets 2020-11-22 17:11:41 -05:00
Mara Bos 11ce918c75
Rollup merge of #78714 - m-ou-se:simplify-local-streams, r=KodrAus
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-16 17:26:27 +01:00
Eric Huss a8bc9545eb Update books 2020-11-11 19:35:50 -08:00
Mara Bos aff7bd66e8 Merge set_panic and set_print into set_output_capture.
There were no use cases for setting them separately.
Merging them simplifies some things.
2020-11-10 21:58:13 +01:00
Dylan DPC 4e0695b79f
Rollup merge of #78746 - pietroalbini:i686-freebsd, r=Mark-Simulacrum
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-09 19:06:57 +01:00
David Hewitt 8d43b3cbb9 Add `#[cfg(panic = "...")]` 2020-11-09 15:30:49 +00:00
Dylan DPC 50086afb5d
Rollup merge of #78228 - pietroalbini:finally, r=Mark-Simulacrum
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-09 01:13:33 +01:00
bors a601302ff0 Auto merge of #75778 - AndyGauge:75521-rustdoc-book-improvements, r=jyn514
75521 rustdoc book improvements

Added some guidelines about documenting with rustdoc
Fixes #75521
2020-11-06 19:01:10 +00:00
Yuki Okushi 707988ae2a
Rollup merge of #78726 - GuillaumeGomez:back-link-to-main-website, 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-07 01:02:18 +09:00
Pietro Albini 1274faed1a
doc/rustc: promote aarch64-unknown-linux-gnu to tier 1
This also adds a note about missing stack probes support, per the
discussion on RFC 2959.
2020-11-05 11:54:30 +01:00
Guillaume Gomez 9d114506c6 Rename lint to non_autolinks 2020-11-05 10:22:08 +01:00
Guillaume Gomez fce2be0ea7 Update URLs used in the lint example 2020-11-05 10:22:08 +01:00
Guillaume Gomez 60caf51b0d Rename automatic_links to url_improvements 2020-11-05 10:22:08 +01:00
Guillaume Gomez 7f839b2ece Improve automatic_links globally 2020-11-05 10:22:08 +01:00
Guillaume Gomez f467b8d77c Extend automatic_links lint to take into account URLs without link syntax 2020-11-05 10:22:08 +01:00
Guillaume Gomez a54f043733 Add documentation for automatic_links lint 2020-11-05 10:22:08 +01:00
Andrew Gauger 881820aa06 Added Rustdoc book sections for linting and embedding more examples
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-11-04 17:47:50 -08:00
Pietro Albini 53c1eb7a26
ci: 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.
2020-11-04 18:38:49 +01:00
Guillaume Gomez 8db2bf2b0c Add link to rust website 2020-11-04 11:06:42 +01:00
Mara Bos 52405f7c0c
Rollup merge of #77950 - arlosi:sha256, r=eddyb
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-03 19:32:26 +01:00
Yuki Okushi 1cb137b3e9
Rollup merge of #78676 - kiffie:embedded-bare-mipsr2, r=jonas-schievink
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-03 15:27:21 +09:00
Yuki Okushi 416dd6757b
Rollup merge of #78616 - richkadel:unstable-book-instr-cov, r=tmandry
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-03 15:27:13 +09:00
Stephan 5130f2e777 add mipsel-unknown-none target 2020-11-02 23:31:15 +01:00
Rich Kadel 6d949112f6 addressed feedback 2020-11-02 12:05:00 -08:00
Rich Kadel a8dfb26b62 Document -Zinstrument-coverage 2020-11-01 20:13:28 -08:00
Yuki Okushi 218af6f714
Rollup merge of #78492 - ehuss:update-books, r=ehuss
Update books

## nomicon

7 commits in 6e57e64501f61873ab80cb78a07180a22751a5d6..69333eddb1de92fd17e272ce4677cc983d3bd71d
2020-09-14 11:40:23 -0400 to 2020-10-17 15:44:12 -0700
- Tweak GHA config (rust-lang-nursery/nomicon#240)
- Fix link for `[T]` (rust-lang-nursery/nomicon#239)
- Update casts.md (rust-lang-nursery/nomicon#232)
- [WIP] Add more links (rust-lang-nursery/nomicon#180)
- Data Race definition should be more precise (rust-lang-nursery/nomicon#219)
- Update the diagnostic of `error[E0597]` in dropck.md (rust-lang-nursery/nomicon#157)
- fix typo in Lifetimes mutable reference aliasing section (rust-lang-nursery/nomicon#225)

## reference

3 commits in 1b78182e71709169dc0f1c3acdc4541b6860e1c4..10c16caebe475d0d11bec0531b95d7697856c13c
2020-10-11 13:53:47 -0700 to 2020-10-25 20:51:26 -0700
- Add `unsafe` for `mod` and `extern`. (rust-lang-nursery/reference#898)
- mention how unions interact with dropping (rust-lang-nursery/reference#897)
- Add `move_ref_pattern` docs (rust-lang-nursery/reference#881)

## book

2 commits in 451a1e30f2dd137aa04e142414eafb8d05f87f84..13e1c05420bca86ecc79e4ba5b6d02de9bd53c62
2020-10-05 09:11:18 -0500 to 2020-10-20 14:57:32 -0500
- Referencing to Appendix B (rust-lang/book#2481)
- Use GITHUB_PATH instead of add-path (rust-lang/book#2477)

## rust-by-example

2 commits in 152475937a8d8a1f508d8eeb57db79139bc803d9..99eafee0cb14e6ec641bf02a69d7b30f6058349a
2020-10-09 09:29:50 -0300 to 2020-10-21 14:21:55 -0300
- Formatting footer items. (rust-lang/rust-by-example#1385)
- Add partial moves example for `move_ref_pattern` stabilization (rust-lang/rust-by-example#1377)

## edition-guide

3 commits in 81f16863014de60b53de401d71ff904d163ee030..7bc9b7a5e800f79df62947cb7d566fd2fbaf19fe
2020-08-27 13:56:31 -0700 to 2020-10-23 18:31:23 -0500
- A few small updates. (rust-lang/edition-guide#221)
- Clarify the limitation of ? in main and tests (rust-lang/edition-guide#219)
- Update deprecated GitHub Actions commands. (rust-lang/edition-guide#220)
2020-10-29 12:09:01 +09:00
Eric Huss 23167cbfe9 Update books 2020-10-28 10:53:15 -07:00
Guillaume Gomez f553c226c1
Fix typo "compiltest" 2020-10-28 15:51:26 +01:00
Santiago Pastorino 1b7d0b22c0
Fix unstable-book doc tests 2020-10-27 14:45:35 -03:00