Commit graph

134409 commits

Author SHA1 Message Date
Dylan DPC
0a52b43b24
Rollup merge of #79631 - RalfJung:miri-const_str_ptr, r=oli-obk
disable a ptr equality test on Miri

This test relies on deduplication of constants. I do not think that this is a *guarantee* that Rust currently makes, and indeed Miri does not deduplicate constants the same way that rustc does, leading to different behavior in this test.

For now, I propose we simply disable this test in Miri.
2020-12-04 03:30:32 +01:00
Dylan DPC
aef5edddc6
Rollup merge of #79627 - ehuss:update-cargo, r=ehuss
Update cargo

12 commits in bfca1cd22bf514d5f2b6c1089b0ded0ba7dfaa6e..63d0fe43449adcb316d34d98a982b597faca4178
2020-11-24 16:33:21 +0000 to 2020-12-02 01:44:30 +0000
- Add "--workspace" to update command (rust-lang/cargo#8725)
- Add an FAQ for "Why is my crate rebuilt?" (rust-lang/cargo#8927)
- Set docs.rs as the default extern-map for crates.io (rust-lang/cargo#8877)
- remove extra whitespace when running cargo -Z help (rust-lang/cargo#8924)
- Remove version from dev-dependencies to make it easier to publish. (rust-lang/cargo#8920)
- update dependency queue to consider cost for each node (rust-lang/cargo#8908)
- Fix some rustdoc warnings. (rust-lang/cargo#8911)
- Bump miow dependency to not invalidly assume memory layout (rust-lang/cargo#8909)
- Remove unnecessary trailing semicolons (rust-lang/cargo#8906)
- Fix custom_target_dependency test. (rust-lang/cargo#8907)
- fix: we don't ignore `version` for `git`/`path` deps now (rust-lang/cargo#8900)
- doc (book): add "Getting Started" subsection: "Essential Terminology" (rust-lang/cargo#8855)
2020-12-04 03:30:30 +01:00
Dylan DPC
14895ea78b
Rollup merge of #79623 - jyn514:ident, r=GuillaumeGomez
Pass around Symbols instead of Idents in doctree

The span was unused.

Vaguely related to https://github.com/rust-lang/rust/pull/78082 - currently working on converting `visit_ast` to use `hir::intravisit` and this makes that a little easier.

r? ``@GuillaumeGomez``
2020-12-04 03:30:29 +01:00
Dylan DPC
88f0c72dc6
Rollup merge of #79611 - poliorcetics:use-std-in-docs, r=jyn514
Use more std:: instead of core:: in docs for consistency

``@rustbot`` label T-doc

Some cleanup work to use `std::` instead of `core::` in docs as much as possible. This helps with terminology and consistency, especially for newcomers from other languages that have often heard of `std` to describe the standard library but not of `core`.

Edit: I also added more intra doc links when I saw the opportunity.
2020-12-04 03:30:27 +01:00
Dylan DPC
6b42900e40
Rollup merge of #79602 - jethrogb:sgx-fix-79038, r=Mark-Simulacrum
Fix SGX CI

Broken in #79038
2020-12-04 03:30:25 +01:00
Dylan DPC
f4060521a9
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...
2020-12-04 03:30:19 +01:00
Dylan DPC
6f2fbc1613
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`
2020-12-04 03:30:17 +01:00
Camelid
376507f47b Add missing feature flag
Accidentally removed in rebase.
2020-12-03 14:11:37 -08:00
Camelid
f0cf5a974e Add more rustdoc-js test cases 2020-12-03 14:11:37 -08:00
Camelid
b9035194c0 Add rustdoc-js test
Finally!
2020-12-03 14:11:37 -08:00
Camelid
07e9426efb Make length_limit a usize 2020-12-03 14:11:37 -08:00
Camelid
e178030ea4 Use createElement and innerHTML instead of DOMParser
@GuillaumeGomez was concerned about browser compatibility.
2020-12-03 14:11:37 -08:00
Camelid
5d4a7128d9 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`
2020-12-03 14:11:37 -08:00
bors
5be3f9f10e 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.
2020-12-03 18:55:01 +00:00
Guillaume Gomez
50eb3a89f8 Only deny doc_keyword in std and set it as "allow" by default 2020-12-03 16:48:17 +01:00
bors
1f95c91c88 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`
2020-12-03 14:34:20 +00:00
Guillaume Gomez
0105e4a54b Add test for EXISTING_DOC_KEYWORD internal lint 2020-12-03 14:05:58 +01:00
bors
220352781c 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.
2020-12-03 12:14:29 +00:00
bors
d015f0d921 Auto merge of #79594 - vn-ki:const-eval-intrinsic, r=oli-obk
add const_allocate intrinsic

r? `@oli-obk`

fixes #75390
2020-12-03 09:44:07 +00:00
Guillaume Gomez
56c64f871e Add lint pass for doc keyword 2020-12-03 10:42:15 +01:00
Vishnunarayan K I
bc6eb6fa5d move intrinsic to CTFE, add FIXME 2020-12-03 12:21:47 +05:30
bors
c7cff213e9 Auto merge of #79533 - sasurau4:feature/add-long-explanation-E0546, r=GuillaumeGomez
Add long explanation of E0546

Helps with #61137
2020-12-03 05:18:36 +00:00
bors
b4def89d76 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.
2020-12-03 02:00:46 +00:00
bors
7dc1e852d4 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`
2020-12-02 23:18:43 +00:00
Nixon Enraght-Moony
d619271f2b Normalize windows path seperators. 2020-12-02 21:24:42 +00:00
bors
f4db9ffb22 Auto merge of #79364 - nico-abram:unstable-or-pat-suggestion, r=matthewjasper
Fixes #79357 unstable or-pat suggestions

Fixes #79357
2020-12-02 20:33:55 +00:00
Guillaume Gomez
15f9453a26 Remove check keyword identifier check from rustdoc 2020-12-02 20:01:06 +01:00
Guillaume Gomez
9866136bec Add tests for #[doc(keyword = "...")] and update other doc attributes tests 2020-12-02 20:01:06 +01:00
bors
af69066aa6 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.
2020-12-02 17:36:29 +00:00
Santiago Pastorino
37354ebc97
Revert "Auto merge of #79209 - spastorino:trait-inheritance-self, r=nikomatsakis"
This reverts commit 349b3b324d, reversing
changes made to b776d1c3e3.
2020-12-02 12:19:38 -03:00
bors
a094ff9590 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`
2020-12-02 15:17:32 +00:00
Ralf Jung
7e74b72d13 break formatting so rustfmt is happy 2020-12-02 14:09:36 +01:00
Ralf Jung
67a67d827a disable a ptr equality test on Miri 2020-12-02 13:49:33 +01:00
Vishnunarayan K I
899a59e7ca rename MemoryKind::Heap to ConstHeap; bless test 2020-12-02 17:45:11 +05:30
Vishnunarayan K I
1b7fe09025 add comment and bless some tests 2020-12-02 17:19:11 +05:30
Guillaume Gomez
8a35b93c4d Add rustc_lexer as dependency to rustc_passes 2020-12-02 10:42:50 +01:00
Guillaume Gomez
dc10ccfe89 Add checks for #[doc(keyword = "...")] and move them into rustc_passes 2020-12-02 10:42:50 +01:00
Guillaume Gomez
5a228263b8 Clean up doc attributes check before adding more 2020-12-02 10:42:50 +01:00
bors
d37afad0cc 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`
2020-12-02 07:37:40 +00:00
Eric Huss
500979828a Update cargo 2020-12-01 22:32:56 -08:00
Joshua Nelson
88c6cf8884 Pass around Symbols instead of Idents in doctree
The span was unused.
2020-12-01 23:18:46 -05:00
bors
92e4fb0732 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
2020-12-02 04:12:33 +00:00
Yuki Okushi
cdcce11504 Tweak diagnostics on shadowing lifetimes/labels 2020-12-02 11:39:42 +09:00
bors
eb4860c7e1 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
2020-12-02 02:07:45 +00:00
bors
18aa5ee209 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
2020-12-01 23:44:25 +00:00
Alexis Bourget
4eb76fcc8e Use more std:: instead of core:: in docs for consistency, add more intra doc links 2020-12-02 00:41:53 +01:00
Guillaume Gomez
9e26fc60b1
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`
2020-12-01 23:46:13 +01:00
Guillaume Gomez
3d631b094b
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
2020-12-01 23:46:11 +01:00
Guillaume Gomez
8b0c31d492
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
2020-12-01 23:46:09 +01: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