Commit graph

142211 commits

Author SHA1 Message Date
Yuki Okushi
9ada731c65
Rollup merge of #84444 - notriddle:num-docs-from-undocumented-items-toggle, r=yaahc
doc: Get rid of "[+] show undocumented items" toggle on numeric From impls

On most From implementations, the docstring is attached to the function. This is also how people have been [recommended] to do it.

Screenshots:

* [before](https://user-images.githubusercontent.com/1593513/115767662-323c5480-a35e-11eb-9918-98aba83e9183.png)
* [after](https://user-images.githubusercontent.com/1593513/115767675-35374500-a35e-11eb-964f-c28eeb6c807a.png)

[recommended]: https://github.com/rust-lang/rust/issues/51430#issuecomment-398322434
2021-04-24 03:44:12 +09:00
Yuki Okushi
a50f502766
Rollup merge of #84433 - GuillaumeGomez:search-input-blur, r=jsha
Prevent control, shift and alt keys to make search input lose focus

Part of #84384.

r? ````@jsha````
2021-04-24 03:44:11 +09:00
Yuki Okushi
a050a49ca3
Rollup merge of #84430 - dvdhrm:rw/uefidoc, r=Amanieu
doc/platform-support: clarify UEFI support

Add missing information on what standard-library features are supported by the UEFI targets.

All current UEFI targets (which is i686 and x86_64) only support no_std cross-compilations. `std` support has not been worked on and is unlikely to emerge anytime soon, due to the much restricted environment that UEFI provides.
2021-04-24 03:44:10 +09:00
Yuki Okushi
ace3bd4f8b
Rollup merge of #84387 - CDirkx:poison, r=m-ou-se
Move `sys_common::poison` to `sync::poison`

`sys_common` should not contain publicly exported types, only platform-independent abstractions on top of `sys`, which `sys_common::poison` is not. There is thus no reason for the module to not live under `sync`.

Part of #84187.
2021-04-24 03:44:09 +09:00
Yuki Okushi
8de00b3cbf
Rollup merge of #84374 - CDirkx:gitignore, r=Mark-Simulacrum
Clean up .gitignore

Categorizes entries in the `.gitignore` file.

Other changes:
- added `desktop.ini` (Windows equivalent of `.DS_Store`)
- removed `.hg/` and `.hgignore`
2021-04-24 03:44:08 +09:00
Yuki Okushi
05588067fa
Rollup merge of #84359 - lnicola:rust-analyzer-2021-04-20, r=jonas-schievink
⬆️ rust-analyzer
2021-04-24 03:44:06 +09:00
Yuki Okushi
d05e28df15
Rollup merge of #84321 - Swatinem:subvariant-details, r=GuillaumeGomez
rustdoc: Convert sub-variant toggle to HTML

Instead of creating a JS toggle, this injects details/summary for
sub-variants of enums. This also fixes the CSS so that the toggle button
does not jump when expanding/collapsing.

Takes inspiration from #83337 and should be considered part of #83332. Not quite sure if the `.sub-variant` selectors could be further simplified? AFAICS it is only used in that place, and that does not seem to allow any recursion.
2021-04-24 03:44:05 +09:00
Yuki Okushi
5b7c98676f
Rollup merge of #84248 - calebsander:refactor/vec-functions, r=Amanieu
Remove duplicated fn(Box<[T]>) -> Vec<T>

`<[T]>::into_vec()` does the same thing as `Vec::from::<Box<[T]>>()`, so they can be implemented in terms of each other. This was the previous implementation of `Vec::from()`, but was changed in #78461. I'm not sure what the rationale was for that change, but it seems preferable to maintain a single implementation.
2021-04-24 03:44:04 +09:00
Yuki Okushi
dcb4083ed9
Rollup merge of #80805 - camelid:iter-by_ref-example, r=steveklabnik
Improve `Iterator::by_ref` example

I split the example into two: one that fails to compile, and one that
works. I also made them identical except for the addition of `by_ref`
so we don't confuse readers with random differences.

cc `@steveklabnik,` who is the one that added the previous version of this example
2021-04-24 03:44:02 +09:00
Arpad Borsos
85879fe83d
improve wording 2021-04-23 18:13:06 +02:00
bors
484c61943f Auto merge of #84457 - jyn514:cleanup-crate, r=GuillaumeGomez
rustdoc: Remove most fields from ExternalCrate

Once https://github.com/rust-lang/rust/issues/84304 is fixed, I can get rid of ExternCrate altogether in favor of CrateNum, but in the meantime, this shrinks ExternalCrate quite a lot.

This might hurt compile-times; if it does, I can add `primitive` and `keyword` queries. I expect this to improve compilemem.

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

r? GuillaumeGomez
2021-04-23 15:45:52 +00:00
bors
9a35232611 Auto merge of #84445 - jyn514:hidden, r=<try>
rustdoc: Hide `#text` in doc-tests

Since `#![attr]` and `#[attr]` are the only valid syntax that start with `#`, we can just special case those two tokens.

Fixes https://github.com/rust-lang/rust/issues/83284.
2021-04-23 13:28:04 +00:00
bors
236580bc5b Auto merge of #83425 - durin42:llvm-update, r=nagisa
RustWrapper: work around unification of diagnostic handlers

This lets me build against llvm/main as of March 23rd, 2021. I'm not
entirely sure this is _correct_, but it appears to be functionally
identical to what was done in LLVM: existing callsites of
setInlineAsmDiagnosticHandler were moved to SetDiagnosticHandler() on
the context object, which we already set up in both places that we
called setInlineAsmDiagnosticHandler().
2021-04-23 05:29:12 +00:00
bors
cb81dc535c Auto merge of #82585 - TrolledWoods:master, r=dtolnay
Added CharIndices::offset function

The CharIndices iterator has a field internally called front_offset, that I think would be very useful to have access to.

You can already do something like ``char_indices.next().map(|(offset, _)| offset)``, but that is wordy, in addition to not handling the case where the iterator has ended, where you'd want the offset to be equal to the length.

I'm very new to the open source world and the rust repository, so I'm sorry if I missed a step or did something weird.
2021-04-23 02:48:13 +00:00
bors
f4a8cf0a00 Auto merge of #78681 - m-ou-se:binary-heap-retain, r=Amanieu
Improve rebuilding behaviour of BinaryHeap::retain.

This changes `BinaryHeap::retain` such that it doesn't always fully rebuild the heap, but only rebuilds the parts for which that's necessary.

This makes use of the fact that retain gives out `&T`s and not `&mut T`s.

Retaining every element or removing only elements at the end results in no rebuilding at all. Retaining most elements results in only reordering the elements that got moved (those after the first removed element), using the same logic as was already used for `append`.

cc `@KodrAus` `@sfackler` - We briefly discussed this possibility in the meeting last week while we talked about stabilization of this function (#71503).
2021-04-23 00:07:19 +00:00
Joshua Nelson
6c6bd88ab3 Remove keywords from ExternCrate 2021-04-22 19:16:41 -04:00
Joshua Nelson
d1d1739673 Get rid of ExternCrate::primitives 2021-04-22 19:10:22 -04:00
Joshua Nelson
3bef65ffaf Remove name field from ExternalCrate 2021-04-22 19:02:09 -04:00
Joshua Nelson
5407a69aa4 Remove src field from ExternCrate 2021-04-22 18:54:59 -04:00
Joshua Nelson
af6c3201fc rustdoc: Hide #text in doc-tests
Since `#![attr]` and `#[attr]` are the only valid syntax that start with `#`, we can just special case those two tokens.
2021-04-22 18:43:16 -04:00
bors
7f4afdf025 Auto merge of #84420 - workingjubilee:microvec, r=Mark-Simulacrum
Use arrayvec 0.7, drop smallvec 0.6

With the arrival of min const generics, many alt-vec libraries have
updated to use it in some way and arrayvec is no exception. Use the
latest with minor refactoring.

Also, rustc_workspace_hack is the only user of smallvec 0.6 in the
entire tree, so drop it.
2021-04-22 21:01:24 +00:00
Augie Fackler
fc2a74c640 RustWrapper: work around unification of diagnostic handlers
This lets me build against llvm/main as of March 23rd, 2021. I'm not
entirely sure this is _correct_, but it appears to be functionally
identical to what was done in LLVM: existing callsites of
setInlineAsmDiagnosticHandler were moved to SetDiagnosticHandler() on
the context object, which we already set up in both places that we
called setInlineAsmDiagnosticHandler().
2021-04-22 15:46:47 -04:00
Michael Howell
c247055032 Get rid of "[+] show undocumented items" toggle on numeric From impls
On most From implementations, the docstring is attached to the
function. This is also how people have been [recommended] to do it.

Screenshots:

* [before](https://user-images.githubusercontent.com/1593513/115767662-323c5480-a35e-11eb-9918-98aba83e9183.png)
* [after](https://user-images.githubusercontent.com/1593513/115767675-35374500-a35e-11eb-964f-c28eeb6c807a.png)

[recommended]: https://github.com/rust-lang/rust/issues/51430#issuecomment-398322434
2021-04-22 11:51:05 -07:00
bors
5f1aeb52c2 Auto merge of #84440 - Dylan-DPC:rollup-0xjb8oi, r=Dylan-DPC
Rollup of 7 pull requests

Successful merges:

 - #84343 (Remove `ScopeTree::closure_tree`)
 - #84376 (Uses flex to fix formatting of h1 at any width)
 - #84377 (Followup to #83944)
 - #84396 (Update LLVM submodule)
 - #84402 (Move `sys_common::rwlock::StaticRWLock` etc. to `sys::unix::rwlock`)
 - #84404 (Check for intrinsics before coercing to a function pointer)
 - #84413 (Remove `sys::args::Args::inner_debug` and use `Debug` instead)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-04-22 18:17:23 +00:00
Dylan DPC
d1f5fc6017
Rollup merge of #84413 - CDirkx:args_inner_debug, r=m-ou-se
Remove `sys::args::Args::inner_debug` and use `Debug` instead

This removes the method `sys::args::Args::inner_debug` on all platforms and implements `Debug` for `Args` instead.

I believe this creates a more natural API for the different platforms under `sys`: export a type `Args: Debug + Iterator + ...` vs. `Args: Iterator + ...` and with a method `inner_debug`.
2021-04-22 18:14:43 +02:00
Dylan DPC
f180c1e05d
Rollup merge of #84404 - tmiasko:intrinsics-in-coercion-lub, r=Mark-Simulacrum
Check for intrinsics before coercing to a function pointer

Return an error if coercing function items / non-capturing closures
to a common function pointer type would require reifying an intrinsic.

Turns ICE reported in #84297 into a proper error.
2021-04-22 18:14:42 +02:00
Dylan DPC
aac5125da4
Rollup merge of #84402 - CDirkx:rwlock, r=dtolnay
Move `sys_common::rwlock::StaticRWLock` etc. to `sys::unix::rwlock`

This moves `sys_common::rwlock::StaticRwLock`, `RWLockReadGuard` and `RWLockWriteGuard` to `sys::unix::rwlock`. They are already `#[cfg(unix)]` and don't need to be in `sys_common`.
2021-04-22 18:14:41 +02:00
Dylan DPC
54af84b7ef
Rollup merge of #84396 - Amanieu:fix_compiler_builtins_llvm, r=cuviper
Update LLVM submodule

Fixes #83467
2021-04-22 18:14:40 +02:00
Dylan DPC
9b432e0234
Rollup merge of #84377 - jackh726:binder-refactor-fix, r=nikomatsakis
Followup to #83944

Some cleanups requested by ``@nikomatsakis``

r? ``@nikomatsakis``
2021-04-22 18:14:39 +02:00
Dylan DPC
7b6fd616c9
Rollup merge of #84376 - torhovland:issue-84534, r=GuillaumeGomez
Uses flex to fix formatting of h1 at any width

Fixes #84354.
2021-04-22 18:14:37 +02:00
Dylan DPC
2f438e31f5
Rollup merge of #84343 - camsteffen:closure-tree, r=varkor
Remove `ScopeTree::closure_tree`

Seems to be dead code since #50649.
2021-04-22 18:14:32 +02:00
bors
ccf171242b Auto merge of #77704 - AnthonyMikh:slice_index_with_ops_bound_pair, r=m-ou-se
Implement indexing slices with pairs of core::ops::Bound<usize>

Closes #49976.

I am not sure about code duplication between `check_range` and `into_maybe_range`. Should be former implemented in terms of the latter? Also this PR doesn't address code duplication between `impl SliceIndex for Range*`.
2021-04-22 15:36:27 +00:00
Mara Bos
f5d72ab69b Add better test for BinaryHeap::retain. 2021-04-22 14:24:30 +02:00
Mara Bos
62226eecb6 Improve BinaryHeap::retain.
It now doesn't fully rebuild the heap, but only the parts that are
necessary.
2021-04-22 14:24:30 +02:00
Guillaume Gomez
a03cba38f1 Prevent control, shift and alt keys to make search input lose focus 2021-04-22 13:50:23 +02:00
bors
25c15cdbe0 Auto merge of #71511 - hi-rustin:rustin-patch-rename-assoc, r=eddyb,varkor
Rename AssociatedItems to AssocItems

Signed-off-by: Rustin-Liu <rustin.liu@gmail.com>

Part of https://github.com/rust-lang/rust/issues/60163#issuecomment-605308641
2021-04-22 11:32:50 +00:00
David Rheinsberg
bfbf4ce363 doc/platform-support: clarify UEFI support
Add missing information on what standard-library features are supported
by the UEFI targets.

All current UEFI targets (which is i686 and x86_64) only support no_std
cross-compilations. `std` support has not been worked on and is unlikely
to emerge anytime soon, due to the much restricted environment that UEFI
provides.
2021-04-22 12:09:30 +02:00
Christiaan Dirkx
c0d05d2162 Remove "Version control" 2021-04-22 11:36:12 +02:00
Christiaan Dirkx
3794fc9ce9 Clean up .gitignore 2021-04-22 11:33:19 +02:00
Christiaan Dirkx
1a6de8450e Remove sys::args::Args::inner_debug and use Debug instead 2021-04-22 11:04:29 +02:00
Christiaan Dirkx
9cabbd0afc Move sys_common::poison to sync::poison 2021-04-22 10:27:21 +02:00
bors
88b99dec2a Auto merge of #84289 - andersk:bootstrap-bulk-dir, r=Mark-Simulacrum
bootstrap: Restore missing --bulk-dirs for rust-docs, rustc-docs

The `--bulk-dirs` argument was removed for rust-docs in commit c768ce1384 and rustc-docs in commit 8ca46fc7a8 (#79788), presumably by mistake; that slowed down installation of rust-docs from under a second to some twenty *minutes*.  Restoring `--bulk-dirs` reverses this slowdown.

Fixes #80684.

Cc `@pietroalbini.`
2021-04-22 07:47:06 +00:00
Jubilee Young
e8eb691c1f Use arrayvec 0.7, drop smallvec 0.6
With the arrival of min const generics, many alt-vec libraries have
updated to use it in some way and arrayvec is no exception. Use the
latest with minor refactoring.

Also, rustc_workspace_hack is the only user of smallvec 0.6 in the
entire tree, so drop it.
2021-04-21 22:39:08 -07:00
bors
71965ab4d0 Auto merge of #84411 - m-ou-se:rollup-9btsp2t, r=m-ou-se
Rollup of 12 pull requests

Successful merges:

 - #84013 (Replace all `fmt.pad` with `debug_struct`)
 - #84119 (Move `sys::vxworks` code to `sys::unix`)
 - #84212 (Replace `Void` in `sys` with never type)
 - #84251 (fix 'const-stable since' for NonZeroU*::new_unchecked)
 - #84301 (Document that `index` and `index_mut` can panic)
 - #84365 (Improve the docstrings of the `Lto` struct.)
 - #84378 (Fix broken doc link)
 - #84379 (Add GAT related tests)
 - #84380 (Write Rustdoc titles like "x in crate::mod - Rust")
 - #84390 (Format `Struct { .. }` on one line even with `{:#?}`.)
 - #84393 (Support `x.py doc std --open`)
 - #84406 (Remove `delete` alias from `mem::drop`.)

Failed merges:

 - #84387 (Move `sys_common::poison` to `sync::poison`)

r? `@ghost`
`@rustbot` modify labels: rollup
2021-04-22 05:01:30 +00:00
Caleb Sander
f505d619c4 Remove duplicated fn(Box<[T]>) -> Vec<T> 2021-04-21 23:32:10 -04:00
bors
c757729701 Auto merge of #84407 - the8472:update-jobserver, r=Mark-Simulacrum
bump jobserver dependency

the newest jobserver version should slightly reduce context switches
in highly parallel build environments on linux kernels >= 5.6
2021-04-22 02:20:29 +00:00
Mara Bos
268d29d75d
Rollup merge of #84406 - m-ou-se:drop-delete-alias, r=dtolnay
Remove `delete` alias from `mem::drop`.

See https://github.com/rust-lang/rust/pull/81988#issuecomment-824168459 and https://github.com/rust-lang/rust/pull/81988#issuecomment-824213843
2021-04-21 23:06:24 +02:00
Mara Bos
0749ea7cb8
Rollup merge of #84393 - GuillaumeGomez:better-open-handling, r=jyn514
Support `x.py doc std --open`

I usually run this command:

```
./x.py doc std --stage 1 --jobs 8
```

Then I gave a try to `--open` and realized it wasn't working. I finally realized it was simply because it was only handling paths starting with `library`. This PR allows to handle both kinds of paths.

cc ``@jyn514``
r? ``@Mark-Simulacrum``
2021-04-21 23:06:23 +02:00
Mara Bos
49a5c80a3b
Rollup merge of #84390 - m-ou-se:make-debug-non-exhaustive-without-fields-a-little-bit-less-verbose, r=kennytm
Format `Struct { .. }` on one line even with `{:#?}`.

The result of `debug_struct("A").finish_non_exhaustive()` before this change:
```
A {
    ..
}
```
And after this change:
```
A { .. }
```

If there's any fields, the result stays unchanged:
```
A {
    field: value,
    ..
}
2021-04-21 23:06:21 +02:00
Mara Bos
2cddda3af1
Rollup merge of #84380 - Smittyvb:rdoc-title-order, r=jsha
Write Rustdoc titles like "x in crate::mod - Rust"

This makes Rustdoc titles for items be like "Widget in cratename::blah::foo - Rust". Titles for modules and other non-items are unchanged, and still read like "cratename::blah::foo - Rust". This makes managing several open Rustdoc tabs easier.

![A screenshot of several open Rustdoc tabs](https://user-images.githubusercontent.com/10530973/115457675-d608f180-a1f2-11eb-87a8-838a32b4e3f7.png)

This also adds some tests for the new title behavior.

Closes #84371.
2021-04-21 23:06:20 +02:00