]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoRollup merge of #79541 - GuillaumeGomez:doc-keyword-lint-pass, r=lcnr
Dylan DPC [Fri, 4 Dec 2020 02:30:19 +0000 (03:30 +0100)]
Rollup merge of #79541 - GuillaumeGomez:doc-keyword-lint-pass, r=lcnr

Doc keyword lint pass

`x.py test` doesn't seem to work locally for multiple reasons so simpler to just run CI...

3 years agoRollup merge of #77686 - camelid:rustdoc-render-search-results, r=GuillaumeGomez
Dylan DPC [Fri, 4 Dec 2020 02:30:17 +0000 (03:30 +0100)]
Rollup merge of #77686 - camelid:rustdoc-render-search-results, r=GuillaumeGomez

Render Markdown in search results

Fixes #32040.

Previously Markdown documentation was not rendered to HTML for search results,
which led to the output not being very readable, particularly for inline code.
This PR fixes that by rendering Markdown to HTML with the help of pulldown-cmark
(the library rustdoc uses to parse Markdown for the main text of documentation).
However, the text for the title attribute (the text shown when you hover over an
element) still uses the plain-text rendering since it is displayed in browsers
as plain-text.

Only these styles will be rendered; everything else is stripped away:

* *italics*
* **bold**
* `inline code`

3 years agoAdd missing feature flag
Camelid [Thu, 3 Dec 2020 21:08:40 +0000 (13:08 -0800)]
Add missing feature flag

Accidentally removed in rebase.

3 years agoAdd more rustdoc-js test cases
Camelid [Tue, 24 Nov 2020 19:18:45 +0000 (11:18 -0800)]
Add more rustdoc-js test cases

3 years agoAdd rustdoc-js test
Camelid [Tue, 24 Nov 2020 04:33:41 +0000 (20:33 -0800)]
Add rustdoc-js test

Finally!

3 years agoMake `length_limit` a `usize`
Camelid [Tue, 24 Nov 2020 03:26:15 +0000 (19:26 -0800)]
Make `length_limit` a `usize`

3 years agoUse `createElement` and `innerHTML` instead of `DOMParser`
Camelid [Tue, 17 Nov 2020 20:24:16 +0000 (12:24 -0800)]
Use `createElement` and `innerHTML` instead of `DOMParser`

@GuillaumeGomez was concerned about browser compatibility.

3 years agoRender Markdown in search results
Camelid [Mon, 5 Oct 2020 03:42:34 +0000 (20:42 -0700)]
Render Markdown in search results

Previously Markdown documentation was not rendered to HTML for search results,
which led to the output not being very readable, particularly for inline code.
This PR fixes that by rendering Markdown to HTML with the help of pulldown-cmark
(the library rustdoc uses to parse Markdown for the main text of documentation).
However, the text for the title attribute (the text shown when you hover over an
element) still uses the plain-text rendering since it is displayed in browsers
as plain-text.

Only these styles will be rendered; everything else is stripped away:

* *italics*
* **bold**
* `inline code`

3 years agoAuto merge of #79620 - JohnTitor:label-name-sugg, r=davidtwco
bors [Thu, 3 Dec 2020 18:55:01 +0000 (18:55 +0000)]
Auto merge of #79620 - JohnTitor:label-name-sugg, r=davidtwco

Tweak diagnostics on shadowing lifetimes/labels

Fixes #79610

Skip adding a new test assuming we have already sufficient tests.

3 years agoOnly deny doc_keyword in std and set it as "allow" by default
Guillaume Gomez [Thu, 3 Dec 2020 14:32:41 +0000 (15:32 +0100)]
Only deny doc_keyword in std and set it as "allow" by default

3 years agoAuto merge of #79613 - GuillaumeGomez:doc-keyword-checks, r=oli-obk
bors [Thu, 3 Dec 2020 14:34:20 +0000 (14:34 +0000)]
Auto merge of #79613 - GuillaumeGomez:doc-keyword-checks, r=oli-obk

Add checks for #[doc(keyword = "...")] attribute

The goal here is to extend check for `#[doc(keyword = "...")]`.

cc `@jyn514`
r? `@oli-obk`

3 years agoAdd test for EXISTING_DOC_KEYWORD internal lint
Guillaume Gomez [Thu, 3 Dec 2020 13:05:58 +0000 (14:05 +0100)]
Add test for EXISTING_DOC_KEYWORD internal lint

3 years agoAuto merge of #79586 - jyn514:crate-name, r=davidtwco
bors [Thu, 3 Dec 2020 12:14:29 +0000 (12:14 +0000)]
Auto merge of #79586 - jyn514:crate-name, r=davidtwco

Fix `unknown-crate` when using -Z self-profile with rustdoc

... by removing a duplicate `crate_name` field in `interface::Config`,
making it clear that rustdoc should be passing it to `config::Options` instead.

Unblocks https://github.com/rust-lang/rustc-perf/issues/797.

3 years agoAuto merge of #79594 - vn-ki:const-eval-intrinsic, r=oli-obk
bors [Thu, 3 Dec 2020 09:44:07 +0000 (09:44 +0000)]
Auto merge of #79594 - vn-ki:const-eval-intrinsic, r=oli-obk

add const_allocate intrinsic

r? `@oli-obk`

fixes #75390

3 years agoAdd lint pass for doc keyword
Guillaume Gomez [Sun, 29 Nov 2020 21:34:41 +0000 (22:34 +0100)]
Add lint pass for doc keyword

3 years agomove intrinsic to CTFE, add FIXME
Vishnunarayan K I [Thu, 3 Dec 2020 06:51:47 +0000 (12:21 +0530)]
move intrinsic to CTFE, add FIXME

3 years agoAuto merge of #79533 - sasurau4:feature/add-long-explanation-E0546, r=GuillaumeGomez
bors [Thu, 3 Dec 2020 05:18:36 +0000 (05:18 +0000)]
Auto merge of #79533 - sasurau4:feature/add-long-explanation-E0546, r=GuillaumeGomez

Add long explanation of E0546

Helps with #61137

3 years agoAuto merge of #79637 - spastorino:revert-trait-inheritance-self, r=Mark-Simulacrum
bors [Thu, 3 Dec 2020 02:00:46 +0000 (02:00 +0000)]
Auto merge of #79637 - spastorino:revert-trait-inheritance-self, r=Mark-Simulacrum

Revert "Auto merge of #79209

r? `@nikomatsakis`

This has caused some issues (#79560) so better to revert and try to come up with a proper fix without rush.

3 years agoAuto merge of #79539 - aDotInTheVoid:json-mvp, r=jyn514
bors [Wed, 2 Dec 2020 23:18:43 +0000 (23:18 +0000)]
Auto merge of #79539 - aDotInTheVoid:json-mvp, r=jyn514

Rustdoc: JSON backend experimental impl, with new tests.

Based on #75114 by `@P1n3appl3`

The first commit is all of #75114, but squased to 1 commit, as that was much easier to rebase onto master.

The git history is a mess, but I think I'll edit it after review, so it's obvious whats new.

## Still to do

- [ ] Update docs.
- [ ] Add bless option to tests.
- [ ] Add test option for multiple files in same crate.
- [ ] Decide if the tests should check for json to be equal or subset.
- [ ] Go through the rest of the review for the original pr. (This is open because the test system is done(ish), but stuff like [not using a hashmap](https://github.com/rust-lang/rust/pull/75114#discussion_r519474420) and [using `CRATE_DEF_INDEX` ](https://github.com/rust-lang/rust/pull/75114#discussion_r519470764) hasn't)

I'm also sure how many of these we need to do before landing on nightly, as it would be nice to get this in tree, so it isn't effected by churn like #79125, #79041, #79061

r? `@jyn514`

3 years agoNormalize windows path seperators.
Nixon Enraght-Moony [Wed, 2 Dec 2020 20:41:20 +0000 (20:41 +0000)]
Normalize windows path seperators.

3 years agoAuto merge of #79364 - nico-abram:unstable-or-pat-suggestion, r=matthewjasper
bors [Wed, 2 Dec 2020 20:33:55 +0000 (20:33 +0000)]
Auto merge of #79364 - nico-abram:unstable-or-pat-suggestion, r=matthewjasper

Fixes #79357 unstable or-pat suggestions

Fixes #79357

3 years agoRemove check keyword identifier check from rustdoc
Guillaume Gomez [Wed, 2 Dec 2020 09:44:19 +0000 (10:44 +0100)]
Remove check keyword identifier check from rustdoc

3 years agoAdd tests for #[doc(keyword = "...")] and update other doc attributes tests
Guillaume Gomez [Tue, 1 Dec 2020 22:42:07 +0000 (23:42 +0100)]
Add tests for #[doc(keyword = "...")] and update other doc attributes tests

3 years agoAuto merge of #69864 - LinkTed:master, r=Amanieu
bors [Wed, 2 Dec 2020 17:36:29 +0000 (17:36 +0000)]
Auto merge of #69864 - LinkTed:master, r=Amanieu

unix: Extend UnixStream and UnixDatagram to send and receive file descriptors

Add the functions `recv_vectored_fds` and `send_vectored_fds` to `UnixDatagram` and `UnixStream`. With this functions `UnixDatagram` and `UnixStream` can send and receive file descriptors, by using `recvmsg` and `sendmsg` system call.

3 years agoRevert "Auto merge of #79209 - spastorino:trait-inheritance-self, r=nikomatsakis"
Santiago Pastorino [Wed, 2 Dec 2020 15:19:38 +0000 (12:19 -0300)]
Revert "Auto merge of #79209 - spastorino:trait-inheritance-self, r=nikomatsakis"

This reverts commit 349b3b324dade7ca638091db93ba08bbc443c63d, reversing
changes made to b776d1c3e3db8befabb123ebb1e46c3531eaed46.

3 years agoAuto merge of #79547 - erikdesjardins:byval, r=nagisa
bors [Wed, 2 Dec 2020 15:17:32 +0000 (15:17 +0000)]
Auto merge of #79547 - erikdesjardins:byval, r=nagisa

Pass arguments up to 2*usize by value

In https://github.com/rust-lang/rust/pull/77434#discussion_r498719533, `@eddyb` said:

> I wonder if it makes sense to limit this to returns [...]

Let's do a perf run and find out.

It seems the `extern "C"` ABI will pass arguments up to 2*usize in registers: https://godbolt.org/z/n8E6zc. (modified from https://github.com/rust-lang/rust/issues/26494#issuecomment-619506345)

r? `@nagisa`

3 years agorename MemoryKind::Heap to ConstHeap; bless test
Vishnunarayan K I [Wed, 2 Dec 2020 12:15:11 +0000 (17:45 +0530)]
rename MemoryKind::Heap to ConstHeap; bless test

3 years agoadd comment and bless some tests
Vishnunarayan K I [Wed, 2 Dec 2020 11:49:11 +0000 (17:19 +0530)]
add comment and bless some tests

3 years agoAdd rustc_lexer as dependency to rustc_passes
Guillaume Gomez [Tue, 1 Dec 2020 22:41:12 +0000 (23:41 +0100)]
Add rustc_lexer as dependency to rustc_passes

3 years agoAdd checks for #[doc(keyword = "...")] and move them into rustc_passes
Guillaume Gomez [Tue, 1 Dec 2020 13:19:53 +0000 (14:19 +0100)]
Add checks for #[doc(keyword = "...")] and move them into rustc_passes

3 years agoClean up doc attributes check before adding more
Guillaume Gomez [Tue, 1 Dec 2020 13:11:33 +0000 (14:11 +0100)]
Clean up doc attributes check before adding more

3 years agoAuto merge of #79606 - ThePuzzlemaker:issue-79458-fix, r=scottmcm
bors [Wed, 2 Dec 2020 07:37:40 +0000 (07:37 +0000)]
Auto merge of #79606 - ThePuzzlemaker:issue-79458-fix, r=scottmcm

Do not show negative polarity trait implementations in diagnostic messages for similar implementations

This fixes #79458.

Previously, this code:
```rust
#[derive(Clone)]
struct Foo<'a, T> {
    x: &'a mut T,
}
```
would have suggested that `<&mut T as Clone>` was an implementation that was found. This is due to the fact that the standard library now has `impl<'_, T> !Clone for &'_ mut T`, and explicit negative polarity implementations were not filtered out in diagnostic output when suggesting similar implementations.

This PR fixes this issue by filtering out negative polarity trait implementations in `find_similar_impl_candidates` within `rustc_trait_selection::traits::error_reporting::InferCtxtPrivExt<'tcx>`. It also adds a UI regression test for this issue and fixes UI tests that had incorrectly been modified to expect the invalid output.

r? `@scottmcm`

3 years agoAuto merge of #79235 - ortem:fix-btreemap-gdb-pretty-printer, r=Mark-Simulacrum
bors [Wed, 2 Dec 2020 04:12:33 +0000 (04:12 +0000)]
Auto merge of #79235 - ortem:fix-btreemap-gdb-pretty-printer, r=Mark-Simulacrum

Fix zero-sized BTreeMap gdb pretty-printer

`gdb.parse_and_eval("()")` is needed because GDB treats "()" as a Rust array of two characters, not as a unit

Based on https://github.com/intellij-rust/intellij-rust/pull/6356

3 years agoTweak diagnostics on shadowing lifetimes/labels
Yuki Okushi [Wed, 2 Dec 2020 02:39:42 +0000 (11:39 +0900)]
Tweak diagnostics on shadowing lifetimes/labels

3 years agoAuto merge of #78864 - Mark-Simulacrum:warn-on-forbids, r=pnkfelix
bors [Wed, 2 Dec 2020 02:07:45 +0000 (02:07 +0000)]
Auto merge of #78864 - Mark-Simulacrum:warn-on-forbids, r=pnkfelix

Use true previous lint level when detecting overriden forbids

Previously, cap-lints was ignored when checking the previous forbid level, which
meant that it was a hard error to do so. This is different from the normal
behavior of lints, which are silenced by cap-lints; if the forbid would not take
effect regardless, there is not much point in complaining about the fact that we
are reducing its level.

It might be considered a bug that even `--cap-lints deny` would suffice to
silence the error on overriding forbid, depending on if one cares about failing
the build or precisely forbid being set. But setting cap-lints to deny is quite
odd and not really done in practice, so we don't try to handle it specially.

This also unifies the code paths for nested and same-level scopes. However, the
special case for CLI lint flags is left in place (introduced by #70918) to fix
the regression noted in #70819. That means that CLI flags do not lint on forbid
being overridden by a non-forbid level. It is unclear whether this is a bug or a
desirable feature, but it is certainly inconsistent. CLI flags are a
sufficiently different "type" of place though that this is deemed out of scope
for this commit.

r? `@pnkfelix` perhaps?

cc #77713 -- not marking as "Fixes" because of the lack of proper unused attribute handling in this PR

3 years agoAuto merge of #79614 - GuillaumeGomez:rollup-15usd7e, r=GuillaumeGomez
bors [Tue, 1 Dec 2020 23:44:25 +0000 (23:44 +0000)]
Auto merge of #79614 - GuillaumeGomez:rollup-15usd7e, r=GuillaumeGomez

Rollup of 3 pull requests

Successful merges:

 - #79508 (Warn if `dsymutil` returns an error code)
 - #79509 (Improve attribute message error spans)
 - #79600 (std::io: Use sendfile for UnixStream)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

3 years agoRollup merge of #79600 - nicokoch:kernel_copy_unixstream, r=m-ou-se
Guillaume Gomez [Tue, 1 Dec 2020 22:46:13 +0000 (23:46 +0100)]
Rollup merge of #79600 - nicokoch:kernel_copy_unixstream, r=m-ou-se

std::io: Use sendfile for UnixStream

`UnixStream` was forgotten in #75272 .

Benchmark yields the following results.
Before:
`running 1 test
test sys::unix::kernel_copy::tests::bench_file_to_uds_copy        ... bench:      54,399 ns/iter (+/- 6,817) = 2409 MB/s`

After:
`running 1 test
test sys::unix::kernel_copy::tests::bench_file_to_uds_copy        ... bench:      18,627 ns/iter (+/- 6,007) = 7036 MB/s`

3 years agoRollup merge of #79509 - GuillaumeGomez:improve-attr-spans, r=oli-obk
Guillaume Gomez [Tue, 1 Dec 2020 22:46:11 +0000 (23:46 +0100)]
Rollup merge of #79509 - GuillaumeGomez:improve-attr-spans, r=oli-obk

Improve attribute message error spans

I got the idea while working on https://github.com/rust-lang/rust/pull/79464

3 years agoRollup merge of #79508 - jryans:check-dsymutil-result, r=nagisa
Guillaume Gomez [Tue, 1 Dec 2020 22:46:09 +0000 (23:46 +0100)]
Rollup merge of #79508 - jryans:check-dsymutil-result, r=nagisa

Warn if `dsymutil` returns an error code

This checks the error code returned by `dsymutil` and warns if it failed. It
also provides the stdout and stderr logs from `dsymutil`, similar to the native
linker step.

I tried to think of ways to test this change, but so far I haven't found a good way, as you'd likely need to inject some nonsensical args into `dsymutil` to induce failure, which feels too artificial to me. Also, https://github.com/rust-lang/rust/issues/79361 suggests Rust is on the verge of disabling `dsymutil` by default, so perhaps it's okay for this change to be untested. In any case, I'm happy to add a test if someone sees a good approach.

Fixes https://github.com/rust-lang/rust/issues/78770

3 years agoAuto merge of #78684 - devsnek:inline-asm-wasm, r=Amanieu
bors [Tue, 1 Dec 2020 20:23:06 +0000 (20:23 +0000)]
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`

3 years agoAdd regression test for #79458
ThePuzzlemaker [Tue, 1 Dec 2020 19:29:03 +0000 (13:29 -0600)]
Add regression test for #79458

3 years agoFix UI tests for negative polarity implementations of traits
ThePuzzlemaker [Tue, 1 Dec 2020 19:04:08 +0000 (13:04 -0600)]
Fix UI tests for negative polarity implementations of traits

3 years agoIgnore trait implementations with negative polarity when suggesting trait implementat...
ThePuzzlemaker [Tue, 1 Dec 2020 18:57:19 +0000 (12:57 -0600)]
Ignore trait implementations with negative polarity when suggesting trait implementations in diagnostics

3 years agoDiscard `const_stability`
Nixon Enraght-Moony [Tue, 1 Dec 2020 18:43:24 +0000 (18:43 +0000)]
Discard `const_stability`

3 years agoAddress review comments.
Nixon Enraght-Moony [Mon, 30 Nov 2020 20:24:48 +0000 (20:24 +0000)]
Address review comments.

Go back to CRATE_DEF_INDEX

Minor niceness improvements

Don't output hidden items

Remove striped items from fields

Add $TEST_BASE_DIR

Small catch

3 years agoAdd tests for rustdoc json
Nixon Enraght-Moony [Sun, 29 Nov 2020 16:16:25 +0000 (16:16 +0000)]
Add tests for rustdoc json

Move rustdoc/rustdoc-json to rustdoc-json

Scaffold rustdoc-json test mode

Implement run_rustdoc_json_test

Fix up python

Make tidy happy

3 years agoAdd json backend
Joseph Ryan [Mon, 3 Aug 2020 17:45:27 +0000 (12:45 -0500)]
Add json backend

Respond to comments and start adding tests

Fix re-exports and extern-crate

Add expected output tests

Add restricted paths

Format

Fix: associated methods missing in output

Ignore stripped items

Mark stripped items

removing them creates dangling references

Fix tests and update conversions

Don't panic if JSON backend fails to create a file

Fix attribute error in JSON testsuite

Move rustdoc-json to rustdoc/

This way it doesn't have to build rustc twice. Eventually it should
probably get its own suite, like rustdoc-js, but that can be fixed in a
follow-up.

Small cleanups

Don't prettify json before printing

This fully halves the size of the emitted JSON.

Add comments

[BREAKING CHANGE] rename version -> crate_version

[BREAKING CHANGE] rename source -> span

Use exhaustive matches

Don't qualify imports for DefId

Rename clean::{ItemEnum -> ItemKind}, clean::Item::{inner -> kind}

Fix Visibility conversion

clean::Visability was changed here:
https://github.com/rust-lang/rust/pull/77820/files#diff-df9f90aae0b7769e1eb6ea6f1d73c1c3f649e1ac48a20e169662a8930eb427beL1467-R1509

More churn catchup

Format

3 years agoAdd wasm32 support to inline asm
Gus Caplan [Mon, 2 Nov 2020 20:59:45 +0000 (14:59 -0600)]
Add wasm32 support to inline asm

3 years agoFix `unknown-crate` when using self-profile with rustdoc
Joshua Nelson [Tue, 1 Dec 2020 03:54:20 +0000 (22:54 -0500)]
Fix `unknown-crate` when using self-profile with rustdoc

... by removing a duplicate `crate_name` field in `interface::Config`,
making it clear that rustdoc should be passing it to `config::Options`
instead.

3 years agoAdd documentation for name_value_literal_span methods
Guillaume Gomez [Tue, 1 Dec 2020 16:32:14 +0000 (17:32 +0100)]
Add documentation for name_value_literal_span methods

3 years agoImprove some attributes error spans
Guillaume Gomez [Sat, 28 Nov 2020 16:53:20 +0000 (17:53 +0100)]
Improve some attributes error spans

3 years agoCreated NestedMetaItem::name_value_literal_span method
Guillaume Gomez [Sat, 28 Nov 2020 15:11:25 +0000 (16:11 +0100)]
Created NestedMetaItem::name_value_literal_span method

3 years agobless stability-attribute-sanity ui test
Daiki Ihara [Sun, 29 Nov 2020 11:50:51 +0000 (20:50 +0900)]
bless stability-attribute-sanity ui test

3 years agoAdd long explanation of E0546
Daiki Ihara [Sun, 29 Nov 2020 11:48:17 +0000 (20:48 +0900)]
Add long explanation of E0546

3 years agoreview comment and one more test
Vishnunarayan K I [Tue, 1 Dec 2020 14:42:22 +0000 (20:12 +0530)]
review comment and one more test

3 years agoAuto merge of #74967 - Aaron1011:feature/incr-def-path-table, r=pnkfelix
bors [Tue, 1 Dec 2020 14:30:02 +0000 (14:30 +0000)]
Auto merge of #74967 - Aaron1011:feature/incr-def-path-table, r=pnkfelix

Implement lazy decoding of DefPathTable during incremental compilation

PR https://github.com/rust-lang/rust/pull/75813 implemented lazy decoding of the `DefPathTable` from crate metadata. However, it requires decoding the entire `DefPathTable` when incremental compilation is active, so that we can map a decoded `DefPathHash` to a `DefId` from an arbitrary crate.

This PR adds support for lazy decoding of dependency `DefPathTable`s when incremental compilation si active.

When we load the incremental cache and dep
graph, we need the ability to map a `DefPathHash` to a `DefId` in the
current compilation session (if the corresponding definition still
exists).

This is accomplished by storing the old `DefId` (that is, the `DefId`
from the previous compilation session) for each `DefPathHash` we need to
remap. Since a `DefPathHash` includes the owning crate, the old crate is
guaranteed to be the right one (if the definition still exists). We then
use the old `DefIndex` as an initial guess, which we validate by
comparing the expected and actual `DefPathHash`es. In most cases,
foreign crates will be completely unchanged, which means that we our
guess will be correct. If our guess is wrong, we fall back to decoding
the entire `DefPathTable` for the foreign crate. This still represents
an improvement over the status quo, since we can skip decoding the
entire `DefPathTable` for other crates (where all of our guesses were
correct).

3 years agoreview comments
Vishnunarayan K I [Tue, 1 Dec 2020 14:18:09 +0000 (19:48 +0530)]
review comments

3 years agoLeverage kernel copy for UnixStream
Nicolas Koch [Tue, 1 Dec 2020 13:45:36 +0000 (14:45 +0100)]
Leverage kernel copy for UnixStream

UDS can be a sendfile destination, just like TCP sockets.

3 years agoAdd benchmark for File to UnixStream copy
Nicolas Koch [Tue, 1 Dec 2020 13:44:40 +0000 (14:44 +0100)]
Add benchmark for File to UnixStream copy

3 years agoAuto merge of #79596 - m-ou-se:rollup-hujx3c7, r=m-ou-se
bors [Tue, 1 Dec 2020 12:15:10 +0000 (12:15 +0000)]
Auto merge of #79596 - m-ou-se:rollup-hujx3c7, r=m-ou-se

Rollup of 11 pull requests

Successful merges:

 - #79038 (Change ui test that are run-pass and that do not test the compiler to library tests)
 - #79184 (Stop adding '*' at the end of slice and str typenames for MSVC case)
 - #79227 (Remove const_fn_feature_flags test)
 - #79444 (Move const ip in ui test to unit test)
 - #79522 (Validate lint docs separately.)
 - #79525 (Add -Z normalize-docs and enable it for compiler docs)
 - #79527 (Move intra-doc link tests into a subdirectory)
 - #79548 (Show since when a function is const in stdlib)
 - #79568 (update Miri)
 - #79573 (Update with status for various NetBSD ports.)
 - #79583 (Update books)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

3 years agoRollup merge of #79583 - ehuss:update-books, r=ehuss
Mara Bos [Tue, 1 Dec 2020 10:50:26 +0000 (10:50 +0000)]
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)

3 years agoRollup merge of #79573 - he32:master, r=jonas-schievink
Mara Bos [Tue, 1 Dec 2020 10:50:25 +0000 (10:50 +0000)]
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.

3 years agoRollup merge of #79568 - RalfJung:miri, r=RalfJung
Mara Bos [Tue, 1 Dec 2020 10:50:23 +0000 (10:50 +0000)]
Rollup merge of #79568 - RalfJung:miri, r=RalfJung

update Miri

This update includes https://github.com/rust-lang/miri/pull/1617, the data race detector by ``@JCTyblaidd.`` :)

Cc ``@rust-lang/miri`` r? ``@ghost``

3 years agoRollup merge of #79548 - CraftSpider:76998, r=jyn514
Mara Bos [Tue, 1 Dec 2020 10:50:21 +0000 (10:50 +0000)]
Rollup merge of #79548 - CraftSpider:76998, r=jyn514

Show since when a function is const in stdlib

Fixes #76998

This makes it so that functions with the `#[rustc_const_stable()]` attribute now show from what version they were stably declared const, alongside what version they were declared stable. Example from `Result`:
![image](https://user-images.githubusercontent.com/13342132/100561194-1be60d00-3286-11eb-99ff-1e81201218a9.png)

r? ``@jyn514``

3 years agoRollup merge of #79527 - jyn514:intra-doc-tests, r=Manishearth
Mara Bos [Tue, 1 Dec 2020 10:50:19 +0000 (10:50 +0000)]
Rollup merge of #79527 - jyn514:intra-doc-tests, r=Manishearth

Move intra-doc link tests into a subdirectory

They were starting to get unwieldy.

r? ``@Manishearth``

3 years agoRollup merge of #79525 - jyn514:feature-gate-normalize, r=GuillaumeGomez
Mara Bos [Tue, 1 Dec 2020 10:50:18 +0000 (10:50 +0000)]
Rollup merge of #79525 - jyn514:feature-gate-normalize, r=GuillaumeGomez

Add -Z normalize-docs and enable it for compiler docs

Works around https://github.com/rust-lang/rust/issues/79459 by only enabling normalization for the compiler itself (and anyone who opts-in on nightly). Eventually I want to remove this and enable normalization by default, but that's turned out to be [really hard](https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/How.20do.20I.20normalize.20projection.20types.20to.20a.20single.20type.3F/near/218125195).

This uses a command line option instead of a feature gate so it's easier to pass it to all crates at once. Theoretically it's better to use a feature gate instead so that it's easier for people to use on docs.rs, but I'm also not terribly concerned with how easy it to use a temporary hack.

Addresses https://github.com/rust-lang/rust/issues/77459.

3 years agoRollup merge of #79522 - ehuss:lint-check-validate, r=Mark-Simulacrum
Mara Bos [Tue, 1 Dec 2020 10:50:16 +0000 (10:50 +0000)]
Rollup merge of #79522 - ehuss:lint-check-validate, r=Mark-Simulacrum

Validate lint docs separately.

This addresses some concerns raised in https://github.com/rust-lang/rust/pull/76549#issuecomment-727638552 about errors with the lint docs being confusing and cumbersome. Errors from validating the lint documentation were being generated during `x.py doc` (and `x.py dist`), since extraction and validation are being done in a single step. This changes it so that extraction and validation are separated, so that `x.py doc` will not error if there is a validation problem, and tests are moved to `x.py test src/tools/lint-docs`.

This includes the following changes:

* Separate validation to `x.py test`.
* Added some more documentation on how to more easily modify and test the docs.
* Added more help to the error messages to hopefully provide more information on how to fix things.

The first commit just moves the code around, so you may consider looking at the other commits for a smaller diff.

3 years agoRollup merge of #79444 - sasurau4:test/move-const-ip, r=matklad
Mara Bos [Tue, 1 Dec 2020 10:50:15 +0000 (10:50 +0000)]
Rollup merge of #79444 - sasurau4:test/move-const-ip, r=matklad

Move const ip in ui test to unit test

Helps with #76268

r? ``@matklad``

3 years agoRollup merge of #79227 - sasurau4:test/move-cell-test-to-lib-core, r=jyn514
Mara Bos [Tue, 1 Dec 2020 10:50:12 +0000 (10:50 +0000)]
Rollup merge of #79227 - sasurau4:test/move-cell-test-to-lib-core, r=jyn514

Remove const_fn_feature_flags test

## Overview

Helps with #76268

I found `const_fn_feature_flags` is targeting feature-gate and remove it.

r? ``@matklad``

3 years agoRollup merge of #79184 - nanguye2496:nanguye2496/fix_slice_and_str_type_name, r=varkor
Mara Bos [Tue, 1 Dec 2020 10:50:10 +0000 (10:50 +0000)]
Rollup merge of #79184 - nanguye2496:nanguye2496/fix_slice_and_str_type_name, r=varkor

Stop adding '*' at the end of slice and str typenames for MSVC case

When computing debug info for MSVC debuggers, Rust compiler emits C++ style type names for compatibility with .natvis visualizers. All Ref types are treated as equivalences of C++ pointers in this process, and, as a result, their type names end with a '\*'. Since Slice and Str are treated as Ref by the compiler, their type names also end with a '\*'. This causes the .natvis engine for WinDbg fails to display data of Slice and Str objects. We addressed this problem simply by removing the '*' at the end of type names for Slice and Str types.

Debug info in WinDbg before the fix:
![image](https://user-images.githubusercontent.com/74681961/99594120-9a4dcf80-29a7-11eb-8cce-aedaf1da6d21.png)

Debug info in WinDbg after the fix:
![image](https://user-images.githubusercontent.com/74681961/99597173-717c0900-29ac-11eb-861e-98143a9177cf.png)

This change has also been tested with debuggers for Visual Studio, VS Code C++ and VS Code LLDB to make sure that it does not affect the behavior of other kinds of debugger.

3 years agoRollup merge of #79038 - CDirkx:move-ui-tests, r=dtolnay
Mara Bos [Tue, 1 Dec 2020 10:50:02 +0000 (10:50 +0000)]
Rollup merge of #79038 - CDirkx:move-ui-tests, r=dtolnay

Change ui test that are run-pass and that do not test the compiler to library tests

Part of #76268, these are some of the relevant ui tests I found that can be replaced by library tests.

Note: this PR just moves the tests, I have not checked for any overlap between these tests and existing library tests. The only test I changed is `env_home_dir`, where I added code to restore the old home dir after testing.

All moved tests:

| ui test | library test file | test |
| --- | --- | --- |
| `const\ascii_ctype.rs` | `core\tests\ascii.rs` | `ascii_ctype_const` |
| `const\const-str-ptr.rs` | `alloc\tests\str.rs` | `const_str_ptr` |
| `assert-eq-trailing-comma.rs` | `core\tests\macros.rs` | `assert_eq_trailing_comma` |
| `assert-escape.rs` | `core\tests\macros.rs` | `assert_escape` |
| `assert-ne-trailing-comma.rs` | `core\tests\macros.rs` | `assert_ne_trailing_comma` |
| `atomic-access-bool.rs` | `core\tests\atomic.rs` | `atomic_access_bool` |
| `atomic-alignment.rs` | `core\tests\atomic.rs` | `atomic_alignment` |
| `atomic-compare_exchange.rs` | `core\tests\atomic.rs` | `atomic_compare_exchange` |
| ~~`atomic-print.rs`~~ | ~~`std\tests\process.rs`~~ | ~~`atomic_print`~~ |
| `bool.rs` | `core\tests\bool.rs` | `test_bool` |
| `bool_not.rs` | `core\tests\bool.rs` | `test_bool_not` |
| `char_unicode.rs` | `core\tests\unicode.rs` | `version` |
| `cmp-default.rs` | `core\tests\cmp.rs` | `cmp_default` |
| `deref-mut-on-ref.rs` | `core\tests\ops.rs` | `deref_mut_on_ref` |
| `deref-on-ref.rs` | `core\tests\ops.rs` | `deref_on_ref` |
| `env-home-dir.rs` | `std\tests\env.rs` | `env_home_dir` |
| ~~`env-vars.rs`~~ | ~~`std\tests\env.rs`~~ | ~~`env_vars`~~ |
| `extend-for-unit.rs` | `core\tests\iter.rs` | `extend_for_unit` |
| `offset_from.rs` | `core\tests\ptr.rs` | `offset_from` |
| `option-ext.rs` | `core\tests\option.rs` | `option_ext` |
| `result-opt-conversions.rs` | `core\tests\result.rs` | `result_opt_conversions` |
| `sleep.rs` | `std\tests\thread.rs` | `sleep` |
| ~~`try-wait.rs`~~ | ~~`std\tests\process.rs`~~ | ~~`try_wait`~~ |
| `utf8.rs` | `alloc\tests\str.rs` | `utf8` |
| `utf8_chars.rs` | `alloc\tests\str.rs` | `utf8_chars` |
| `wrapping-int-api.rs` | `core\tests\num\wrapping.rs` | `wrapping_int_api` |

3 years agoadd const_allocate intrisic
Vishnunarayan K I [Tue, 1 Dec 2020 10:09:25 +0000 (15:39 +0530)]
add const_allocate intrisic

3 years agoAuto merge of #78876 - GuillaumeGomez:better-setting-keyboard-ux, r=jyn514
bors [Tue, 1 Dec 2020 09:58:59 +0000 (09:58 +0000)]
Auto merge of #78876 - GuillaumeGomez:better-setting-keyboard-ux, r=jyn514

Make keyboard interactions in the settings menu more pleasant

#78868 improved the keyboard interactions with the settings page. This PR goes a bit further by allowing more than just "space" to toggle the checkboxes.

r? `@jyn514`

3 years agoAuto merge of #78725 - sexxi-goose:fix-78720, r=nikomatsakis
bors [Tue, 1 Dec 2020 07:00:41 +0000 (07:00 +0000)]
Auto merge of #78725 - sexxi-goose:fix-78720, r=nikomatsakis

Remove extra call to upvar_tys

We already visit the tuple of upvar_tys, we don't need to visit each individual type.

Fixes #78720

r? `@ghost`

3 years agoAuto merge of #78142 - operutka:armv5te-unknown-linux-uclibcgnueabi-target, r=petroch...
bors [Tue, 1 Dec 2020 04:53:38 +0000 (04:53 +0000)]
Auto merge of #78142 - operutka:armv5te-unknown-linux-uclibcgnueabi-target, r=petrochenkov

Add built-in support for the armv5te-unknown-linux-uclibcgnueabi target

Hi!

I'd like to add built-in support for the `armv5te-unknown-linux-uclibcgnueabi` target. It's a pretty common target used by many devices like routers and IP cameras. It's mostly a copy-paste of `armv5te-unknown-linux-gnueabi`. I've tested it on a quite complex application that uses tokio, openssl and a lot of other stuff and everything seems to be working fine.

I'm not sure about the `post_link_args` but the point is that my linker fails when `-ldl` isn't specified. Maybe there is a better place where to put this option...

It's my first contribution to Rust itself, so feel free to wash my head :smile:

_Note: The app mentioned above was built with this in my `.cargo/config`:_
```
[unstable]
build-std = ["core", "std", "alloc", "proc_macro", "panic_abort"]
build-std-features = ["panic_immediate_abort"]
```

3 years agoAuto merge of #77875 - poliorcetics:more-intra-doc-links, r=jyn514
bors [Tue, 1 Dec 2020 02:45:26 +0000 (02:45 +0000)]
Auto merge of #77875 - poliorcetics:more-intra-doc-links, r=jyn514

More intra doc links

Helps with #75080.

I did a commit by group of file, I can squash if wanted.

`@rustbot` modify labels: T-doc, A-intra-doc-links

r? `@jyn514`

3 years agoUpdate books
Eric Huss [Tue, 1 Dec 2020 01:25:23 +0000 (17:25 -0800)]
Update books

3 years agoStop adding '*' at the end of type names for Ref and Slice when computing debug info...
Nam Nguyen [Wed, 18 Nov 2020 21:42:36 +0000 (13:42 -0800)]
Stop adding '*' at the end of type names for Ref and Slice when computing debug info for MSVC debuggers

3 years agoFix several broken links in doc that used the wrong qualifier or Self::
Alexis Bourget [Mon, 30 Nov 2020 20:21:15 +0000 (21:21 +0100)]
Fix several broken links in doc that used the wrong qualifier or Self::

3 years agoBack to #method for links on char
Alexis Bourget [Thu, 19 Nov 2020 13:55:57 +0000 (14:55 +0100)]
Back to #method for links on char

3 years agoptr links
Alexis Bourget [Tue, 13 Oct 2020 06:59:45 +0000 (08:59 +0200)]
ptr links

3 years agoUse core::primitive module instead of prim@
Alexis Bourget [Tue, 13 Oct 2020 06:52:48 +0000 (08:52 +0200)]
Use core::primitive module instead of prim@

3 years agoUse Self:: in links
Alexis Bourget [Tue, 13 Oct 2020 06:49:16 +0000 (08:49 +0200)]
Use Self:: in links

3 years agoIntra doc links for iterator adapters
Alexis Bourget [Mon, 12 Oct 2020 22:52:13 +0000 (00:52 +0200)]
Intra doc links for iterator adapters

3 years agoIntra doc links for f32/f64
Alexis Bourget [Mon, 12 Oct 2020 22:52:01 +0000 (00:52 +0200)]
Intra doc links for f32/f64

3 years agoIntra doc links for the pointer primitive
Alexis Bourget [Mon, 12 Oct 2020 22:40:40 +0000 (00:40 +0200)]
Intra doc links for the pointer primitive

3 years agoIntra doc links for str/mod.rs
Alexis Bourget [Mon, 12 Oct 2020 22:24:09 +0000 (00:24 +0200)]
Intra doc links for str/mod.rs

3 years agoIntra doc links for the char primitive
Alexis Bourget [Mon, 12 Oct 2020 22:18:41 +0000 (00:18 +0200)]
Intra doc links for the char primitive

3 years agoIntra doc links for cell.rs
Alexis Bourget [Mon, 12 Oct 2020 22:18:28 +0000 (00:18 +0200)]
Intra doc links for cell.rs

3 years agoUpdate with status for various NetBSD ports.
Havard Eidnes [Mon, 30 Nov 2020 18:18:21 +0000 (19:18 +0100)]
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.

3 years agoupdate Miri
Ralf Jung [Mon, 30 Nov 2020 15:37:40 +0000 (16:37 +0100)]
update Miri

3 years agoWarn if `dsymutil` returns an error code
J. Ryan Stinnett [Sat, 28 Nov 2020 15:09:18 +0000 (15:09 +0000)]
Warn if `dsymutil` returns an error code

This checks the error code returned by `dsymutil` and warns if it failed. It
also provides the stdout and stderr logs from `dsymutil`, similar to the native
linker step.

Fixes https://github.com/rust-lang/rust/issues/78770

3 years agoAuto merge of #76467 - jyn514:intra-link-self, r=Manishearth
bors [Mon, 30 Nov 2020 09:00:52 +0000 (09:00 +0000)]
Auto merge of #76467 - jyn514:intra-link-self, r=Manishearth

Fix intra-doc links for `Self` on cross-crate items and primitives

- Remove the difference between `parent_item` and `current_item`; these
  should never have been different.
- Remove `current_item` from `resolve` and `variant_field` so that
  `Self` is only substituted in one place at the very start.
- Resolve the current item as a `DefId`, not a `HirId`. This is what
  actually fixed the bug.

Hacks:
- `clean` uses `TypedefItem` when it _really_ should be
  `AssociatedTypeItem`. I tried fixing this without success and hacked
  around it instead (see comments)
- This second-guesses the `to_string()` impl since it wants
  fully-qualified paths. Possibly there's a better way to do this.

3 years agoAdd built-in support for the armv5te-unknown-linux-uclibceabi target
Ondrej Perutka [Mon, 30 Nov 2020 08:47:09 +0000 (09:47 +0100)]
Add built-in support for the armv5te-unknown-linux-uclibceabi target

3 years agomake test work in llvm 9
Erik Desjardins [Mon, 30 Nov 2020 06:21:47 +0000 (01:21 -0500)]
make test work in llvm 9

3 years agoAdd support for stable-const-since in docs on items (standalone or assoc)
Rune Tynan [Mon, 30 Nov 2020 02:00:14 +0000 (21:00 -0500)]
Add support for stable-const-since in docs on items (standalone or assoc)

3 years agoMake ui test that are run-pass and do not test the compiler itself library tests
Christiaan Dirkx [Sun, 22 Nov 2020 08:08:04 +0000 (09:08 +0100)]
Make ui test that are run-pass and do not test the compiler itself library tests

3 years agoAuto merge of #79329 - camelid:int-lit-suffix-error, r=davidtwco
bors [Mon, 30 Nov 2020 01:42:14 +0000 (01:42 +0000)]
Auto merge of #79329 - camelid:int-lit-suffix-error, r=davidtwco

Update error to reflect that integer literals can have float suffixes

For example, `1` is parsed as an integer literal, but it can be turned
into a float with the suffix `f32`. Now the error calls them "numeric
literals" and notes that you can add a float suffix since they can be
either integers or floats.

3 years agoPass arguments up to 2*usize by value
Erik Desjardins [Mon, 30 Nov 2020 00:49:41 +0000 (19:49 -0500)]
Pass arguments up to 2*usize by value

3 years agoBe cautious of calling upvar_tys before mir
Aman Arora [Sat, 7 Nov 2020 06:04:27 +0000 (01:04 -0500)]
Be cautious of calling upvar_tys before mir