Commit graph

157649 commits

Author SHA1 Message Date
Matthias Krüger
d6f12f7630
Rollup merge of #89942 - JohnTitor:reorder-widening_impl, r=dtolnay
Reorder `widening_impl`s to make the doc clearer

Fixes #88736
This moves `{widening,carrying}_mul`s to the bottom to place consts on the top.
2021-11-05 21:12:28 +01:00
Leonora Tindall
768554af79 Add a chapter on reading Rustdoc output
Includes documentation for:
 - general page structure
 - navigation
 - searching
 - themes
 - deep-linking

Doesn't include docs on the settings page.
2021-11-05 14:44:23 -05:00
Josh Stone
767471edeb Update LLVM comments around NoAliasMutRef 2021-11-05 12:22:51 -07:00
Hans Kratz
9db9811ddf Properly register text_direction_codepoint_in_comment lint. 2021-11-05 20:12:40 +01:00
David Tolnay
1f9807799c
Add test to confirm fnn_unsuffixed does not emit exponent notation 2021-11-05 12:06:49 -07:00
bors
0d1754e8bf Auto merge of #90583 - willcrichton:example-analyzer, r=jyn514
Fix ICE when rustdoc is scraping examples inside of a proc macro

This PR provides a clearer semantics for how --scrape-examples interacts with macros. If an expression's span AND it's enclosing item's span both are not `from_expansion`, then the example will be scraped. The added test case `rustdoc-scrape-examples-macros` shows a variety of situations.

* A macro-rules macro that takes a function call as input: good
* A macro-rules macro that generates a function call as output: bad
* A proc-macro that generates a function call as output: bad
* An attribute macro that generates a function call as output: bad
* An attribute macro that takes a function call as input: good, if the proc macro is designed to propagate the input spans

I ran this updated rustdoc on pyo3 and confirmed that it successfully scrapes examples from inside a proc macro, eg

<img width="1013" alt="Screen Shot 2021-11-04 at 1 11 28 PM" src="https://user-images.githubusercontent.com/663326/140412691-81a3bb6b-a448-4a1b-a293-f7a795553634.png">

(cc `@mejrs)`

Additionally, this PR fixes an ordering bug in the highlighting logic.

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

r? `@jyn514`
2021-11-05 19:05:36 +00:00
Josh Stone
aa35158383 Update the documented default of -Zmutable-noalias 2021-11-05 12:01:59 -07:00
Yuki Okushi
0b3a002805
Reorder widening_impls to make the doc clearer 2021-11-05 11:55:51 -07:00
Josh Stone
c9567e2424 Move outline-atomics to aarch64-linux target definitions 2021-11-05 10:28:12 -07:00
Josh Stone
1d04577ee0 Remove some minor checks for LLVM < 12 2021-11-05 10:26:16 -07:00
Tomasz Miąsko
5a09e12135 Initialize LLVM time trace profiler on each code generation thread
In https://reviews.llvm.org/D71059 LLVM 11, the time trace profiler was
extended to support multiple threads.

`timeTraceProfilerInitialize` creates a thread local profiler instance.
When a thread finishes `timeTraceProfilerFinishThread` moves a thread
local instance into a global collection of instances. Finally when all
codegen work is complete `timeTraceProfilerWrite` writes data from the
current thread local instance and the instances in global collection
of instances.

Previously, the profiler was intialized on a single thread only. Since
this thread performs no code generation on its own, the resulting
profile was empty.

Update LLVM codegen to initialize & finish time trace profiler on each
code generation thread.
2021-11-05 17:47:11 +01:00
Niko Matsakis
4154e8acf0 apply suggestions from code review 2021-11-05 12:43:42 -04:00
Will Crichton
82b23be3c1 Fix rustdoc-scrape-examples-macros test not being cross-platform 2021-11-05 09:32:04 -07:00
bors
045612b8b9 Auto merge of #90616 - mathstuf:error_codes-comment-uniformity, r=GuillaumeGomez
error_codes: uniformly comment error codes
2021-11-05 16:00:23 +00:00
Ben Boeckel
863e5226d3 error_codes: uniformly comment error codes 2021-11-05 11:57:17 -04:00
bors
d22dd65835 Auto merge of #90604 - mbartlett21:iterator-reexports, r=kennytm
Re-export some iterators from `core` in `std`

These iterators seem to have been forgotten to be re-exported from `std` (through `alloc`)

These are stable:

`core::slice::{SplitInclusive, SplitInclusiveMut}`

This one is still unstable:

`core::slice::EscapeAscii` (cc #77174)
2021-11-05 12:22:13 +00:00
bors
489ec310d2 Auto merge of #90577 - matthiaskrgr:clippy_perf_nov, r=petrochenkov
clippy::perf fixes
2021-11-05 09:17:39 +00:00
mbartlett21
ed63c71d61
Fix str::SplitInclusive stabilisation date 2021-11-05 17:46:58 +10:00
mbartlett21
d606dbe256
Add feature to alloc so we can re-export. 2021-11-05 17:35:07 +10:00
mbartlett21
9ae92ad19a
Re-export core::slice::EscapeAscii 2021-11-05 17:14:57 +10:00
mbartlett21
03d1f24db8
Re-export core::slice::SplitInclusive[Mut] 2021-11-05 15:44:43 +10:00
bors
b99bd8f8be Auto merge of #90598 - JohnTitor:rollup-kz1qioz, r=JohnTitor
Rollup of 9 pull requests

Successful merges:

 - #90507 (Suggest `extern crate alloc` when using undeclared module `alloc`)
 - #90530 (Simplify js tester a bit)
 - #90533 (Add note about x86 instruction prefixes in asm! to unstable book)
 - #90537 (Update aarch64 `target_feature` list for LLVM 12.)
 - #90544 (Demote metadata load warning to "info".)
 - #90554 (Clean up some `-Z unstable-options` in tests.)
 - #90556 (Add more text and examples to `carrying_{add|mul}`)
 - #90563 (rustbot allow labels)
 - #90571 (Fix missing bottom border for headings in sidebar)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-11-05 04:35:13 +00:00
Will Crichton
c62817bfe2 Move rustdoc-scrape-examples-macros test to run-make-fulldeps 2021-11-04 18:52:59 -07:00
Yuki Okushi
3821ab231b
Rollup merge of #90571 - GuillaumeGomez:missing-bottom-border-sidebar, r=jsha
Fix missing bottom border for headings in sidebar

Fixes #90568.

r? ```@jsha```
2021-11-05 10:32:47 +09:00
Yuki Okushi
1aa8c01c29
Rollup merge of #90563 - joshtriplett:rustbot-allow-labels, r=Mark-Simulacrum
rustbot allow labels

`relnotes` was inspired by https://github.com/rust-lang/rust/pull/90521 , and by the various `must_use` PRs; in all of those cases, the submitter of the PR could know that `relnotes` applied, but couldn't apply it themselves.

For `needs-fcp`, I think people should be able to help triage by observing that a change needs an FCP before we can apply it.
2021-11-05 10:32:47 +09:00
Yuki Okushi
5aa6eaf4c0
Rollup merge of #90556 - scottmcm:carrying_comments, r=joshtriplett
Add more text and examples to `carrying_{add|mul}`

`feature(bigint_helper_methods)` tracking issue https://github.com/rust-lang/rust/issues/85532

cc `````@clarfonthey`````
2021-11-05 10:32:46 +09:00
Yuki Okushi
7ee926a852
Rollup merge of #90554 - ehuss:unstable-options-cleanup, r=joshtriplett
Clean up some `-Z unstable-options` in tests.

Several of these tests were for features that have been stabilized, or otherwise don't need `-Z unstable-options`.
2021-11-05 10:32:45 +09:00
Yuki Okushi
6964ec2f72
Rollup merge of #90544 - ehuss:demote-locator-warn, r=petrochenkov
Demote metadata load warning to "info".

There is a warn log message for whenever the crate loader fails to load metadata from a candidate file. I think this warning is too aggressive, as there are several situations where metadata information might not be found in a candidate file, which is normal. Also, this warning is somewhat confusing, and non-actionable in most cases for a user (most users will not know what it means).

If the crate loader ultimately does not find a valid crate, then an error will be reported (and hopefully #88368 will improve that error message).

If a rustc developer wants to debug a loader problem, they can still use `RUSTC_LOG=rustc_metadata=debug` and get the details.

There is more discussion of this particular warning at https://github.com/rust-lang/rust/issues/89795#issuecomment-940798190.

Fixes #90525
2021-11-05 10:32:44 +09:00
Yuki Okushi
a5802d0731
Rollup merge of #90537 - adamgemmell:dev/aarch64-target-feature, r=Amanieu
Update aarch64 `target_feature` list for LLVM 12.

Many of these feature are now available on all valid LLVM versions.

I've also added a few new ones to the list.

r? `@Amanieu`
2021-11-05 10:32:42 +09:00
Yuki Okushi
dbaf2de0bb
Rollup merge of #90533 - Smittyvb:patch-1, r=joshtriplett
Add note about x86 instruction prefixes in asm! to unstable book

Since rustc doesn't do the assembly parsing itself, it is unable to detect when inline assembly ends with an instruction prefix, which doesn't make sense since it would apply to instructions from the compiler. This fixes #82314 by mentioning that x86 instruction prefixes must not be used in inline assembly. AFAICT x86 is the only instruction set with instruction prefixes.
2021-11-05 10:32:41 +09:00
Yuki Okushi
282d696009
Rollup merge of #90530 - GuillaumeGomez:simplify-js-tester, r=notriddle
Simplify js tester a bit

r? `````@notriddle`````
2021-11-05 10:32:40 +09:00
Yuki Okushi
987797bfe1
Rollup merge of #90507 - TaKO8Ki:suggest-extern-crate-alloc, r=jackh726
Suggest `extern crate alloc` when using undeclared module `alloc`

closes #90136
2021-11-05 10:32:39 +09:00
SparrowLii
926892ddc0 Add feature trigger and enable is_struct check 2021-11-05 09:30:49 +08:00
bors
a6162f6c0f Auto merge of #90574 - notriddle:notriddle/doc-fold-stripped-conditional, r=camelid,GuillaumeGomez
rustdoc: Use conditional for _stripped fold

Followup: https://github.com/rust-lang/rust/pull/90475#discussion_r741405472
2021-11-05 01:29:41 +00:00
Niko Matsakis
fc8113d04e handle case of a variable not captured 2021-11-04 21:26:47 -04:00
Niko Matsakis
76bc02715e rework diagnostic reporting to be more structured 2021-11-04 20:32:44 -04:00
Hans Kratz
39110beab0 Use one match instead of a staggered match. 2021-11-05 00:39:34 +01:00
Caleb Cartwright
a5f85058ac fix: handle external mods imported via external->inline load hierarchy 2021-11-04 18:35:38 -05:00
Hans Kratz
e339e4789f Remove now unused feature from rustc_parse 2021-11-04 23:40:59 +01:00
Hans Kratz
7885233df0 Optimize literal, doc comment lint as well, extract function. 2021-11-04 23:31:42 +01:00
Richard Lowe
dbc3bf48c4 treat illumos like solaris in failing ui tests which need it 2021-11-04 17:00:19 -05:00
bors
2cff30b17a Auto merge of #90536 - crlf0710:fix_vtable_hrtb, r=jackh726
Erase regions within `vtable_trait_first_method_offset`

Fixes #90177 .

r? `@jackh726`
2021-11-04 21:52:21 +00:00
Will Crichton
4846d102e2 Fix ICE when rustdoc is scraping examples inside of a proc macro 2021-11-04 13:57:39 -07:00
Will Crichton
3ad6d12827 Sort scraped call locations before serializing 2021-11-04 13:57:09 -07:00
Matthias Krüger
28ef4169cc clippy::perf fixes 2021-11-04 21:07:56 +01:00
Guillaume Gomez
aa17e1c47f Fix missing bottom border for headings in sidebar 2021-11-04 20:07:24 +01:00
Niko Matsakis
9c84ac86d1 introduce an enum for tracking the 2229 migration causes 2021-11-04 12:50:24 -04:00
Michael Howell
7f268838cd rustdoc: Use conditional for _stripped fold
Followup: https://github.com/rust-lang/rust/pull/90475#discussion_r741405472
2021-11-04 09:43:13 -07:00
Hans Kratz
a5b25a2cfa Create subslice as that leads to a smaller code size. 2021-11-04 17:03:13 +01:00
Smittyvb
773cc4f52b
Mention possible future rejections
Co-authored-by: Josh Triplett <josh@joshtriplett.org>
2021-11-04 11:31:03 -04:00