]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoAdd tests
est31 [Mon, 7 Dec 2020 00:44:04 +0000 (01:44 +0100)]
Add tests

3 years agoTurn quadratic time on number of impl blocks into linear time
est31 [Sat, 24 Oct 2020 08:42:40 +0000 (10:42 +0200)]
Turn quadratic time on number of impl blocks into linear time

Previously, if you had a lot of inherent impl blocks on a type like:

struct Foo;

impl Foo { fn foo_1() {} }
...
impl Foo { fn foo_100_000() {} }

The compiler would be very slow at processing it, because
an internal algorithm would run in O(n^2), where n is the number
of impl blocks. Now, we add a new algorithm that allocates but
is faster asymptotically.

If there is an overlap between multiple impl blocks in terms of
identifiers, we still run a O(m^2) algorithm on groups of impl
blocks that have overlaps, but that m refers to the size of the
connected component, which is hopefully smaller than the n
that refers to the sum of all connected components.

3 years agoMove hygienic comparison into own function
est31 [Sat, 24 Oct 2020 13:37:03 +0000 (15:37 +0200)]
Move hygienic comparison into own function

3 years agoAuto merge of #79680 - Nadrieril:fix-regression-79284, r=jonas-schievink
bors [Fri, 4 Dec 2020 11:21:35 +0000 (11:21 +0000)]
Auto merge of #79680 - Nadrieril:fix-regression-79284, r=jonas-schievink

Fix perf regression caused by #79284

https://github.com/rust-lang/rust/pull/79284 only moved code around but this changed inlining and caused a large perf regression. This fixes it for me, though I'm less confident than usual because the regression was not observable with my usual (i.e. incremental) compilation settings.

r? `@Mark-Simulacrum`

3 years agoAuto merge of #78177 - benjaminp:cleanups, r=jyn514
bors [Fri, 4 Dec 2020 07:11:41 +0000 (07:11 +0000)]
Auto merge of #78177 - benjaminp:cleanups, r=jyn514

A few miscellaneous comment fixes and a tiny code clarification.

3 years agoWriteback walks the HIR not the AST.
Benjamin Peterson [Wed, 21 Oct 2020 04:22:43 +0000 (23:22 -0500)]
Writeback walks the HIR not the AST.

3 years agoThe details of higher-rank sub are in the rustc book not a doc module.
Benjamin Peterson [Wed, 21 Oct 2020 04:22:34 +0000 (23:22 -0500)]
The details of higher-rank sub are in the rustc book not a doc module.

3 years agoUnnest some .chain calls, so it's clearer what's going on.
Benjamin Peterson [Wed, 21 Oct 2020 04:10:47 +0000 (23:10 -0500)]
Unnest some .chain calls, so it's clearer what's going on.

3 years agoFix comment that refers to dead enforce_object_limitations function.
Benjamin Peterson [Sun, 20 Sep 2020 15:40:30 +0000 (10:40 -0500)]
Fix comment that refers to dead enforce_object_limitations function.

3 years agoAuto merge of #79686 - Dylan-DPC:rollup-leama5f, r=Dylan-DPC
bors [Fri, 4 Dec 2020 04:51:49 +0000 (04:51 +0000)]
Auto merge of #79686 - Dylan-DPC:rollup-leama5f, r=Dylan-DPC

Rollup of 11 pull requests

Successful merges:

 - #77686 (Render Markdown in search results)
 - #79541 (Doc keyword lint pass)
 - #79602 (Fix SGX CI)
 - #79611 (Use more std:: instead of core:: in docs for consistency)
 - #79623 (Pass around Symbols instead of Idents in doctree)
 - #79627 (Update cargo)
 - #79631 (disable a ptr equality test on Miri)
 - #79638 (Use `item_name` instead of pretty printing for resolving `Self` on intra-doc links)
 - #79646 (rustc_metadata: Remove some dead code)
 - #79664 (move interpret::MemoryKind::Heap to const eval)
 - #79678 (Fix some clippy lints)

Failed merges:

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

3 years agoAuto merge of #79109 - richkadel:llvm-coverage-counters-2.0.5, r=tmandry
bors [Fri, 4 Dec 2020 02:31:11 +0000 (02:31 +0000)]
Auto merge of #79109 - richkadel:llvm-coverage-counters-2.0.5, r=tmandry

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.

3 years agoRollup merge of #79678 - jyn514:THE-PAPERCLIP-COMETH, r=varkor
Dylan DPC [Fri, 4 Dec 2020 02:30:39 +0000 (03:30 +0100)]
Rollup merge of #79678 - jyn514:THE-PAPERCLIP-COMETH, r=varkor

Fix some clippy lints

Happy to revert these if you think they're less readable, but personally I like them better now (especially the `else { if { ... } }` to `else if { ... }` change).

3 years agoRollup merge of #79664 - vn-ki:move-memkind-heap, r=oli-obk
Dylan DPC [Fri, 4 Dec 2020 02:30:37 +0000 (03:30 +0100)]
Rollup merge of #79664 - vn-ki:move-memkind-heap, r=oli-obk

move interpret::MemoryKind::Heap to const eval

r? ``@oli-obk``

3 years agoRollup merge of #79646 - petrochenkov:inclean, r=davidtwco
Dylan DPC [Fri, 4 Dec 2020 02:30:36 +0000 (03:30 +0100)]
Rollup merge of #79646 - petrochenkov:inclean, r=davidtwco

rustc_metadata: Remove some dead code

Follow up to https://github.com/rust-lang/rust/pull/74967

3 years agoRollup merge of #79638 - jyn514:intra-link-self-raw, r=Manishearth
Dylan DPC [Fri, 4 Dec 2020 02:30:34 +0000 (03:30 +0100)]
Rollup merge of #79638 - jyn514:intra-link-self-raw, r=Manishearth

Use `item_name` instead of pretty printing for resolving `Self` on intra-doc links

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.

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

r? `@Manishearth`

3 years agoRollup merge of #79631 - RalfJung:miri-const_str_ptr, r=oli-obk
Dylan DPC [Fri, 4 Dec 2020 02:30:32 +0000 (03:30 +0100)]
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.

3 years agoRollup merge of #79627 - ehuss:update-cargo, r=ehuss
Dylan DPC [Fri, 4 Dec 2020 02:30:30 +0000 (03:30 +0100)]
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)

3 years agoRollup merge of #79623 - jyn514:ident, r=GuillaumeGomez
Dylan DPC [Fri, 4 Dec 2020 02:30:29 +0000 (03:30 +0100)]
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``

3 years agoRollup merge of #79611 - poliorcetics:use-std-in-docs, r=jyn514
Dylan DPC [Fri, 4 Dec 2020 02:30:27 +0000 (03:30 +0100)]
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.

3 years agoRollup merge of #79602 - jethrogb:sgx-fix-79038, r=Mark-Simulacrum
Dylan DPC [Fri, 4 Dec 2020 02:30:25 +0000 (03:30 +0100)]
Rollup merge of #79602 - jethrogb:sgx-fix-79038, r=Mark-Simulacrum

Fix SGX CI

Broken in #79038

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 agoInline `is_covered_by`
Nadrieril [Thu, 3 Dec 2020 22:22:57 +0000 (22:22 +0000)]
Inline `is_covered_by`

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 agoFix some clippy lints
Joshua Nelson [Thu, 3 Dec 2020 22:06:58 +0000 (17:06 -0500)]
Fix some clippy lints

3 years agoTweak to Makefile to overcome MacOS make corruption bug
Rich Kadel [Thu, 3 Dec 2020 20:00:33 +0000 (12:00 -0800)]
Tweak to Makefile to overcome MacOS make corruption bug

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 agoFixed cross-crate generic call test to compile lib and bin separately
Rich Kadel [Wed, 2 Dec 2020 23:39:40 +0000 (15:39 -0800)]
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.

3 years agoWorkaround for inconsistent order of llvm-cov results on Windows
Rich Kadel [Wed, 2 Dec 2020 17:43:46 +0000 (09:43 -0800)]
Workaround for inconsistent order of llvm-cov results on Windows

3 years agoAddressed feedback from 2020-12-01
Rich Kadel [Wed, 2 Dec 2020 07:01:26 +0000 (23:01 -0800)]
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.

3 years agoCombination of commits
Rich Kadel [Tue, 1 Dec 2020 07:58:08 +0000 (23:58 -0800)]
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.

3 years agoRemoved -base from run-make-fulldeps/coverage-*-base
Rich Kadel [Tue, 1 Dec 2020 07:37:49 +0000 (23:37 -0800)]
Removed -base from run-make-fulldeps/coverage-*-base

In preparation for removing the -deadcode variants

3 years agoCoverage tests for remaining TerminatorKinds and async, improve Assert
Rich Kadel [Mon, 16 Nov 2020 17:14:28 +0000 (09:14 -0800)]
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.

3 years agomove interpret::MemoryKind::Heap to const eval
Vishnunarayan K I [Thu, 3 Dec 2020 15:39:39 +0000 (21:09 +0530)]
move interpret::MemoryKind::Heap to const eval

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 agorustc_metadata: Remove some dead code
Vadim Petrochenkov [Wed, 2 Dec 2020 20:39:05 +0000 (23:39 +0300)]
rustc_metadata: Remove some dead code

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 agoUse `item_name` instead of pretty printing
Joshua Nelson [Wed, 2 Dec 2020 15:07:29 +0000 (10:07 -0500)]
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.

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 agobreak formatting so rustfmt is happy
Ralf Jung [Wed, 2 Dec 2020 13:09:36 +0000 (14:09 +0100)]
break formatting so rustfmt is happy

3 years agodisable a ptr equality test on Miri
Ralf Jung [Wed, 2 Dec 2020 12:49:33 +0000 (13:49 +0100)]
disable a ptr equality test on Miri

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 agoUpdate cargo
Eric Huss [Wed, 2 Dec 2020 06:32:56 +0000 (22:32 -0800)]
Update cargo

3 years agoPass around Symbols instead of Idents in doctree
Joshua Nelson [Wed, 2 Dec 2020 04:18:46 +0000 (23:18 -0500)]
Pass around Symbols instead of Idents in doctree

The span was unused.

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 agoUse more std:: instead of core:: in docs for consistency, add more intra doc links
Alexis Bourget [Tue, 1 Dec 2020 22:09:03 +0000 (23:09 +0100)]
Use more std:: instead of core:: in docs for consistency, add more intra doc links

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 agoFix SGX CI
Jethro Beekman [Tue, 1 Dec 2020 14:36:14 +0000 (15:36 +0100)]
Fix SGX CI

Broken in #79038

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.