Commit Graph

139726 Commits

Author SHA1 Message Date
Guillaume Gomez f74231fd27
Rollup merge of #82765 - oli-obk:polymorphization_regression, r=davidtwco
Fix polymorphization ICE on associated types in trait decls using const generics in bounds

r? `@davidtwco`

only the last commit actually changes something
2021-03-04 21:56:35 +01:00
Guillaume Gomez e89276baba
Rollup merge of #82752 - JohnTitor:gat-ice-test, r=jackh726
Add a regression test for issue-81712

Fixes #81712, also fixes #79768 as duplicate.
r? `@jackh726`
2021-03-04 21:56:34 +01:00
Guillaume Gomez 2a5ecb2927
Rollup merge of #82690 - jyn514:remove-pass-docs, r=Manishearth
Update rustdoc documentation

- Remove most of the information about passes. Passes are deprecated.
- Add `--document-private-items`; it was missing before.
- Update `--output-format json`; it was very outdated.
- Note that `--input-format` is deprecated.
- Move deprecated options to the very end.

Closes https://github.com/rust-lang/rust/issues/82675.

r? `@Manishearth`
2021-03-04 21:56:33 +01:00
Guillaume Gomez 2f28361936
Rollup merge of #82088 - Nicholas-Baron:shorten_html_render, r=GuillaumeGomez
Shorten html::render

The `mod.rs` for librustdoc's `html::render` was over 3,000 lines. This PR reduces it to around 2,300 by
1. Moving `Context` and associated `impl`s to a separate file
2. Moving the `print_item` function and its helpers to a separate file
3. Moving `write_shared` and `write_minify` to their own file

Related to issue #60302.
Edit 1: `SharedContext` and related `impl`s is only 72 lines and so will not be moved.
2021-03-04 21:56:27 +01:00
Guillaume Gomez 95bbc7ef33
Rollup merge of #76716 - GuillaumeGomez:stop-complains-on-doc-hidden, r=jyn514
Don't warn for `missing_doc_examples` when item is #[doc(hidden)]

r? `@jyn514`
2021-03-04 21:56:27 +01:00
Guillaume Gomez 55cec9079d Also use INVALID_DOC_ATTRIBUTE for "unknown doc attribute" warnings 2021-03-04 21:48:07 +01:00
Mara Bos 80fcdef3b5 Add tracking issue for assert_matches. 2021-03-04 21:33:31 +01:00
Guillaume Gomez 85c3d102bb Add tests for #[doc(test(...)] check 2021-03-04 21:24:35 +01:00
Guillaume Gomez a66bf524c2 Add extra check for #[doc(test(...)] attribute 2021-03-04 21:24:35 +01:00
Guillaume Gomez 6f32e3e187 Add new edition 2021 link: INVALID_DOC_ATTRIBUTE 2021-03-04 21:24:35 +01:00
Guillaume Gomez 1683cb12e4 Use cache access levels 2021-03-04 21:22:44 +01:00
Guillaume Gomez e4287992a7 No more need for borrow call 2021-03-04 21:22:44 +01:00
Guillaume Gomez ad30c39918 Pass TyCtxt directly instead of DocContext in librustdoc::visit_ast::inherits_doc_hidden 2021-03-04 21:22:43 +01:00
Guillaume Gomez 186f13914a Move visibility check inside the should_have_doc_example function 2021-03-04 21:22:43 +01:00
Guillaume Gomez 91095b1be5 Update missing code example test 2021-03-04 21:22:43 +01:00
Guillaume Gomez 4b30625094 Don't warn for `missing_doc_examples` when item is #[doc(hidden)] 2021-03-04 21:22:42 +01:00
bors 45b3c28518 Auto merge of #82747 - JohnTitor:pin-es-check-version, r=Mark-Simulacrum
Pin es-check version to prevent unrelated CI failures

es-check v5.2.1 causes a lot of unrelated CI failures on mingw-check, e.g. https://github.com/rust-lang/rust/pull/80723#issuecomment-790294196.
es-check v5.2.2 fixes it but let's pin its version to prevent further failures.
2021-03-04 19:24:21 +00:00
Joshua Nelson dbdaa12486 Update rustdoc documentation
- Remove most of the information about passes. Passes are deprecated.
- Add `--document-private-items`; it was missing before.
- Update `--output-format json`; it was very outdated.
- Note that `--input-format` is deprecated.
- Move deprecated options to the very end.
- Move `passes.html` to the end of the table of contents. Ideally it
  would be removed altogether, but that causes mdbook not to generate the
  docs.
2021-03-04 14:07:34 -05:00
Mara Bos f223affd7a Don't consume the expression in assert_matches!()'s failure case. 2021-03-04 19:36:36 +01:00
Nicholas-Baron afb8220d0a Corrected imports for render tests and mod files
Due to a rebase, some edits were needed in the mod file.
2021-03-04 10:25:00 -08:00
Nicholas-Baron fd14e38612 Moved `write_shared` to its own file 2021-03-04 10:24:56 -08:00
Mateusz Gacek 58d6f80f96 Fix comment with path to `symbols!` macro 2021-03-04 10:14:56 -08:00
Mateusz Gacek a5951d4b23 Add diagnostic item to `Default` trait
Required to resolve #6562 rust-clippy issue.
2021-03-04 10:14:48 -08:00
Nicholas-Baron 14983b9812 Moved the `make_item_keywords` function to `context.rs` as it is only used there 2021-03-04 10:01:22 -08:00
Nicholas-Baron 6c7d7a6bf4 Moved `print_item` and helpers to a separate file 2021-03-04 10:01:22 -08:00
Nicholas-Baron 48167c499a Moved Context and its impls to a separate file 2021-03-04 10:01:22 -08:00
Mara Bos 5bd1204fc2 Fix assert_matches doc examples. 2021-03-04 18:41:43 +01:00
Mara Bos 0a8e401188 Add debug_assert_matches macro. 2021-03-04 18:12:33 +01:00
Mara Bos cfce60ea37 Allow for multiple patterns and a guard in assert_matches. 2021-03-04 18:12:26 +01:00
Mara Bos eb18746bc6 Add assert_matches!(expr, pat). 2021-03-04 18:07:20 +01:00
Joshua Nelson 675edd0231 Remove RefCell around module_trait_cache 2021-03-04 11:53:40 -05:00
Joshua Nelson b3c4e25e17 Don't require a `DocContext` for `report_diagnostic`
This is needed for the next commit, which needs access to the `cx` from
within the `decorate` closure.

- Change `as_local_hir_id` to an associated function, since it only
  needs a `TyCtxt`
- Change `source_span_for_markdown_range` to only take a `TyCtxt`
2021-03-04 11:30:38 -05:00
Mara Bos eddd4f0501 Add tracking issue for map_try_insert. 2021-03-04 16:54:28 +01:00
Mara Bos 1aedb4c3a3 Remove unnecessary bound from HashMap::try_insert. 2021-03-04 16:46:41 +01:00
Oli Scherer 29f4aa753f Fixes -Zpolymorphize for src/test/ui/const-generics/auxiliary/crayte.rs 2021-03-04 15:45:31 +00:00
Oli Scherer 67a61b9a01 Typo 2021-03-04 15:45:31 +00:00
Oli Scherer 63af264d62 Spread tracing instrumentation into the polymorphization logic 2021-03-04 15:45:31 +00:00
Mara Bos da01455813 Ignore file length tidy warning in hash/map.rs. 2021-03-04 16:25:24 +01:00
bors 409920873c Auto merge of #81451 - nikic:llvm-12, r=nagisa
Upgrade to LLVM 12

This implements the necessary adjustments to make rustc work with LLVM 12. I didn't encounter any major issues so far.

r? `@cuviper`
2021-03-04 15:16:44 +00:00
Mara Bos d85d82ab22 Implement Error for OccupiedError. 2021-03-04 15:58:50 +01:00
Mara Bos 69d95e232a Improve Debug implementations of OccupiedError. 2021-03-04 15:58:50 +01:00
Mara Bos f6fe24aab3 Add HashMap::try_insert and hash_map::OccupiedError. 2021-03-04 15:58:50 +01:00
Mara Bos 09cbcdc2c3 Add BTreeMap::try_insert and btree_map::OccupiedError. 2021-03-04 15:58:50 +01:00
Ian Jackson 8e4433ab3e ExitStatus tests: Make less legible to satisfy "tidy"
I strongly disagree with tidy in this case but AIUI there is no way to
override it.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2021-03-04 12:44:19 +00:00
Ian Jackson a240ff5a77 ExitStatus unknown wait status test: Make it Linux only
If different unices have different bit patterns for WIFSTOPPED and
WIFCONTINUED then simply being glibc is probably not good enough for
this rather ad-hoc test to work.  Do it on Linux only.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2021-03-04 12:26:27 +00:00
Oli Scherer 0559e50a6c Remove a dead code path 2021-03-04 12:21:36 +00:00
Ian Jackson 67cfc22ee2 ExitStatus stop signal display test: Make it Linux only
MacOS uses a different representation.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2021-03-04 12:18:04 +00:00
bors ec7f258d54 Auto merge of #82756 - JohnTitor:rollup-e4ij7h6, r=JohnTitor
Rollup of 8 pull requests

Successful merges:

 - #80527 (Make rustdoc lints a tool lint instead of built-in)
 - #82310 (Load rustdoc's JS search index on-demand.)
 - #82315 (Improve page load performance in rustdoc)
 - #82564 (Revert `Vec::spare_capacity_mut` impl to prevent pointers invalidation)
 - #82697 (Fix stabilization version of move_ref_pattern)
 - #82717 (Account for macros when suggesting adding lifetime)
 - #82740 (Fix commit detected when using `download-rustc`)
 - #82744 (Pass `CrateNum` by value instead of by reference)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-03-04 11:02:13 +00:00
Yuki Okushi 06630f7b5f
Rollup merge of #82744 - camelid:cratenum-byval, r=GuillaumeGomez
Pass `CrateNum` by value instead of by reference

It's more idiomatic to pass a small Copy type by value and `CrateNum` is
half the size of `&CrateNum` on 64-bit systems. The memory use change is
almost certainly insignificant, but why not!
2021-03-04 20:01:12 +09:00
Yuki Okushi 17121f2959
Rollup merge of #82740 - jyn514:proper-history, r=Mark-Simulacrum
Fix commit detected when using `download-rustc`

On reflection on the issue in https://github.com/rust-lang/rust/pull/79540#discussion_r572572280, I think the bug was actually using the `compiler/` filter, not using `--author=bors`. 9a1d6174c9 has no CI artifacts because it was merged as part of a rollup:
```
$ curl -I https://ci-artifacts.rust-lang.org/rustc-builds/96e843ce6ae42e0aa519ba45e148269de347fd84/rust-std-nightly-x86_64-unknown-linux-gnu.tar.xz
HTTP/2 404
```
So 9a1d6174c9 is the correct commit to download, and that's what `--author=bors` does:

$ git log --author=bors 4aec8a5da5
commit 9a1d6174c9

Ideally it would look for "the most recent bors commit not followed by a change to `compiler/`", which would exclude things like documentation changes and avoid redownloading more than necessary, but
- Redownloading isn't the end of the world,
- That metric is hard to implement, and
- Documentation-only or library-only changes are very rare anyway since they're usually rolled up with changes to the compiler.

Helps with https://github.com/rust-lang/rust/issues/81930.

r? `@Mark-Simulacrum`
2021-03-04 20:01:10 +09:00