Commit graph

134470 commits

Author SHA1 Message Date
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
Arlie Davis 957061bb97 Fix src/test/ui/env-vars.rs on 128-core machines on Windows
On Windows, the environment variable NUMBER_OF_PROCESSORS has special
meaning. Unfortunately, you can get different answers, depending on
whether you are enumerating all environment variables or querying a
specific variable. This was causing the src/test/ui/env-vars.rs test
to fail on machines with more than 64 processors when run on Windows.
2020-12-03 18:07:29 -08:00
Nadrieril 793c40e0bd Inline is_covered_by 2020-12-04 01:45:34 +00: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
Joshua Nelson 0ad3dce83a Fix some clippy lints 2020-12-03 17:08:19 -05:00
Rich Kadel dc4bd9067e Tweak to Makefile to overcome MacOS make corruption bug 2020-12-03 12:00:33 -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
Rich Kadel f101fd8ff6 Fixed cross-crate generic call test to compile lib and bin separately
The original test produced a single crate with two mods, which was not
the goal of the test.
2020-12-03 09:50:12 -08:00
Rich Kadel b0c140a55b Workaround for inconsistent order of llvm-cov results on Windows 2020-12-03 09:50:11 -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 f6c9c1a576 Removed -base from run-make-fulldeps/coverage-*-base
In preparation for removing the -deadcode variants
2020-12-03 09:50:09 -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
Vishnunarayan K I ff0ebd27a4 move interpret::MemoryKind::Heap to const eval 2020-12-03 21:42:11 +05:30
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
Bastian Kauschke 4b23f403e5 extend the docs for WithOptConstParam 2020-12-03 12:28:28 +01: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
The8472 a9b1381b8d fix copy specialization not updating Take wrappers 2020-12-03 00:02:01 +01:00
The8472 9b390e73db update test to check Take limits after copying 2020-12-02 23:34:59 +01:00
Nixon Enraght-Moony d619271f2b Normalize windows path seperators. 2020-12-02 21:24:42 +00:00
Vadim Petrochenkov 908bf5a310 rustc_metadata: Remove some dead code 2020-12-03 00:05:24 +03: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
Joshua Nelson 4e7a2dcabb Use item_name instead of pretty printing
Pretty printing would add a `r#` prefix to raw identifiers, which was
not correct. In general I think this change makes sense -
pretty-printing is for showing to the *user*, `item_name` is suitable to
pass to resolve.
2020-12-02 10:25:16 -05: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