]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoFix up/ignore failing ui tests on fuchsia
Tyler Mandry [Fri, 30 Apr 2021 04:02:05 +0000 (04:02 +0000)]
Fix up/ignore failing ui tests on fuchsia

3 years agoSupport multi target-rustcflags for -Zpanic-abort-tests
Tyler Mandry [Fri, 30 Apr 2021 04:01:04 +0000 (04:01 +0000)]
Support multi target-rustcflags for -Zpanic-abort-tests

I just need this until rustbuild supports -Cpanic=abort std directly.

3 years agoAdd needs-unwind to tests
Tyler Mandry [Thu, 29 Apr 2021 17:04:16 +0000 (17:04 +0000)]
Add needs-unwind to tests

3 years agocompiletest: Add --target-panic, needs-unwind
Tyler Mandry [Thu, 29 Apr 2021 16:57:58 +0000 (16:57 +0000)]
compiletest: Add --target-panic, needs-unwind

3 years agoAuto merge of #84490 - JohnTitor:rollup-wrdj4ko, r=JohnTitor
bors [Fri, 23 Apr 2021 21:03:57 +0000 (21:03 +0000)]
Auto merge of #84490 - JohnTitor:rollup-wrdj4ko, r=JohnTitor

Rollup of 11 pull requests

Successful merges:

 - #80805 (Improve `Iterator::by_ref` example)
 - #84248 (Remove duplicated fn(Box<[T]>) -> Vec<T>)
 - #84321 (rustdoc: Convert sub-variant toggle to HTML)
 - #84359 (:arrow_up: rust-analyzer)
 - #84374 (Clean up .gitignore)
 - #84387 (Move `sys_common::poison` to `sync::poison`)
 - #84430 (doc/platform-support: clarify UEFI support)
 - #84433 (Prevent control, shift and alt keys to make search input lose focus)
 - #84444 (doc: Get rid of "[+] show undocumented items" toggle on numeric From impls)
 - #84456 (Fix ICE if original_span(fn_sig) returns a span not in body sourcefile)
 - #84469 (Update comment on `PrimTy::name_str`)

Failed merges:

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

3 years agoRollup merge of #84469 - jyn514:dead-code, r=Mark-Simulacrum
Yuki Okushi [Fri, 23 Apr 2021 18:44:15 +0000 (03:44 +0900)]
Rollup merge of #84469 - jyn514:dead-code, r=Mark-Simulacrum

Update comment on `PrimTy::name_str`

It's no longer used by rustdoc.

3 years agoRollup merge of #84456 - richkadel:issue-84421, r=tmandry
Yuki Okushi [Fri, 23 Apr 2021 18:44:13 +0000 (03:44 +0900)]
Rollup merge of #84456 - richkadel:issue-84421, r=tmandry

Fix ICE if original_span(fn_sig) returns a span not in body sourcefile

Fixes: #84421
r? ````@tmandry````

fyi: ````@wesleywiser```` ````@sdroege```` ````@rajivshah3````

3 years agoRollup merge of #84444 - notriddle:num-docs-from-undocumented-items-toggle, r=yaahc
Yuki Okushi [Fri, 23 Apr 2021 18:44:12 +0000 (03:44 +0900)]
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

3 years agoRollup merge of #84433 - GuillaumeGomez:search-input-blur, r=jsha
Yuki Okushi [Fri, 23 Apr 2021 18:44:11 +0000 (03:44 +0900)]
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````

3 years agoRollup merge of #84430 - dvdhrm:rw/uefidoc, r=Amanieu
Yuki Okushi [Fri, 23 Apr 2021 18:44:10 +0000 (03:44 +0900)]
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.

3 years agoRollup merge of #84387 - CDirkx:poison, r=m-ou-se
Yuki Okushi [Fri, 23 Apr 2021 18:44:09 +0000 (03:44 +0900)]
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.

3 years agoRollup merge of #84374 - CDirkx:gitignore, r=Mark-Simulacrum
Yuki Okushi [Fri, 23 Apr 2021 18:44:08 +0000 (03:44 +0900)]
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`

3 years agoRollup merge of #84359 - lnicola:rust-analyzer-2021-04-20, r=jonas-schievink
Yuki Okushi [Fri, 23 Apr 2021 18:44:06 +0000 (03:44 +0900)]
Rollup merge of #84359 - lnicola:rust-analyzer-2021-04-20, r=jonas-schievink

:arrow_up: rust-analyzer

3 years agoRollup merge of #84321 - Swatinem:subvariant-details, r=GuillaumeGomez
Yuki Okushi [Fri, 23 Apr 2021 18:44:05 +0000 (03:44 +0900)]
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.

3 years agoRollup merge of #84248 - calebsander:refactor/vec-functions, r=Amanieu
Yuki Okushi [Fri, 23 Apr 2021 18:44:04 +0000 (03:44 +0900)]
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.

3 years agoRollup merge of #80805 - camelid:iter-by_ref-example, r=steveklabnik
Yuki Okushi [Fri, 23 Apr 2021 18:44:02 +0000 (03:44 +0900)]
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

3 years agoAuto merge of #84339 - alexcrichton:llvm-fptoint-sat, r=nagisa
bors [Fri, 23 Apr 2021 18:35:49 +0000 (18:35 +0000)]
Auto merge of #84339 - alexcrichton:llvm-fptoint-sat, r=nagisa

rustc: Use LLVM's new saturating float-to-int intrinsics

This commit updates rustc, with an applicable LLVM version, to use
LLVM's new `llvm.fpto{u,s}i.sat.*.*` intrinsics to implement saturating
floating-point-to-int conversions. This results in a little bit tighter
codegen for x86/x86_64, but the main purpose of this is to prepare for
upcoming changes to the WebAssembly backend in LLVM where wasm's
saturating float-to-int instructions will now be implemented with these
intrinsics.

This change allows simplifying a good deal of surrounding code, namely
removing a lot of wasm-specific behavior. WebAssembly no longer has any
special-casing of saturating arithmetic instructions and the need for
`fptoint_may_trap` is gone and all handling code for that is now
removed. This means that the only wasm-specific logic is in the
`fpto{s,u}i` instructions which only get used for "out of bounds is
undefined behavior". This does mean that for the WebAssembly target
specifically the Rust compiler will no longer be 100% compatible with
pre-LLVM 12 versions, but it seems like that's unlikely to be relied on
by too many folks.

Note that this change does immediately regress the codegen of saturating
float-to-int casts on WebAssembly due to the specialization of the LLVM
intrinsic not being present in our LLVM fork just yet. I'll be following
up with an LLVM update to pull in those patches, but affects a few other
SIMD things in flight for WebAssembly so I wanted to separate this change.

Eventually the entire `cast_float_to_int` function can be removed when
LLVM 12 is the minimum version, but that will require sinking the
complexity of it into other backends such as Cranelfit.

3 years agoimprove wording
Arpad Borsos [Mon, 19 Apr 2021 20:59:23 +0000 (22:59 +0200)]
improve wording

3 years agoUpdate wasm test assertions
Alex Crichton [Fri, 23 Apr 2021 15:59:49 +0000 (08:59 -0700)]
Update wasm test assertions

3 years agoAuto merge of #84457 - jyn514:cleanup-crate, r=GuillaumeGomez
bors [Fri, 23 Apr 2021 15:45:52 +0000 (15:45 +0000)]
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

3 years agoDisable LLVM's new fptoint intrinsics on riscv64
Alex Crichton [Thu, 22 Apr 2021 21:33:45 +0000 (14:33 -0700)]
Disable LLVM's new fptoint intrinsics on riscv64

Looks like this platform still isn't quite working yet due to
https://bugs.llvm.org/show_bug.cgi?id=50083

3 years agoAuto merge of #84445 - jyn514:hidden, r=<try>
bors [Fri, 23 Apr 2021 13:28:04 +0000 (13:28 +0000)]
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.

3 years agoAuto merge of #83425 - durin42:llvm-update, r=nagisa
bors [Fri, 23 Apr 2021 05:29:12 +0000 (05:29 +0000)]
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().

3 years agoUpdate comment on `PrimTy::name_str`
Joshua Nelson [Fri, 23 Apr 2021 03:19:46 +0000 (23:19 -0400)]
Update comment on `PrimTy::name_str`

3 years agoAuto merge of #82585 - TrolledWoods:master, r=dtolnay
bors [Fri, 23 Apr 2021 02:48:13 +0000 (02:48 +0000)]
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.

3 years agoAuto merge of #78681 - m-ou-se:binary-heap-retain, r=Amanieu
bors [Fri, 23 Apr 2021 00:07:19 +0000 (00:07 +0000)]
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).

3 years agoRemove `keywords` from ExternCrate
Joshua Nelson [Thu, 22 Apr 2021 23:16:41 +0000 (19:16 -0400)]
Remove `keywords` from ExternCrate

3 years agoGet rid of ExternCrate::primitives
Joshua Nelson [Thu, 22 Apr 2021 23:10:22 +0000 (19:10 -0400)]
Get rid of ExternCrate::primitives

3 years agoRemove `name` field from ExternalCrate
Joshua Nelson [Thu, 22 Apr 2021 23:02:09 +0000 (19:02 -0400)]
Remove `name` field from ExternalCrate

3 years agoRemove src field from ExternCrate
Joshua Nelson [Thu, 22 Apr 2021 22:54:48 +0000 (18:54 -0400)]
Remove src field from ExternCrate

3 years agoFix ICE if original_span(fn_sig) returns a span not in body sourcefile
Rich Kadel [Thu, 22 Apr 2021 22:49:13 +0000 (15:49 -0700)]
Fix ICE if original_span(fn_sig) returns a span not in body sourcefile

Fixes: #84421
3 years agorustdoc: Hide `#text` in doc-tests
Joshua Nelson [Thu, 22 Apr 2021 18:50:56 +0000 (14:50 -0400)]
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.

3 years agoAuto merge of #84420 - workingjubilee:microvec, r=Mark-Simulacrum
bors [Thu, 22 Apr 2021 21:01:24 +0000 (21:01 +0000)]
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.

3 years agoRustWrapper: work around unification of diagnostic handlers
Augie Fackler [Tue, 23 Mar 2021 22:23:28 +0000 (18:23 -0400)]
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().

3 years agoGet rid of "[+] show undocumented items" toggle on numeric From impls
Michael Howell [Thu, 22 Apr 2021 18:24:36 +0000 (11:24 -0700)]
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

3 years agoAuto merge of #84440 - Dylan-DPC:rollup-0xjb8oi, r=Dylan-DPC
bors [Thu, 22 Apr 2021 18:17:23 +0000 (18:17 +0000)]
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

3 years agoRollup merge of #84413 - CDirkx:args_inner_debug, r=m-ou-se
Dylan DPC [Thu, 22 Apr 2021 16:14:43 +0000 (18:14 +0200)]
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`.

3 years agoRollup merge of #84404 - tmiasko:intrinsics-in-coercion-lub, r=Mark-Simulacrum
Dylan DPC [Thu, 22 Apr 2021 16:14:42 +0000 (18:14 +0200)]
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.

3 years agoRollup merge of #84402 - CDirkx:rwlock, r=dtolnay
Dylan DPC [Thu, 22 Apr 2021 16:14:41 +0000 (18:14 +0200)]
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`.

3 years agoRollup merge of #84396 - Amanieu:fix_compiler_builtins_llvm, r=cuviper
Dylan DPC [Thu, 22 Apr 2021 16:14:40 +0000 (18:14 +0200)]
Rollup merge of #84396 - Amanieu:fix_compiler_builtins_llvm, r=cuviper

Update LLVM submodule

Fixes #83467

3 years agoRollup merge of #84377 - jackh726:binder-refactor-fix, r=nikomatsakis
Dylan DPC [Thu, 22 Apr 2021 16:14:39 +0000 (18:14 +0200)]
Rollup merge of #84377 - jackh726:binder-refactor-fix, r=nikomatsakis

Followup to #83944

Some cleanups requested by ``@nikomatsakis``

r? ``@nikomatsakis``

3 years agoRollup merge of #84376 - torhovland:issue-84534, r=GuillaumeGomez
Dylan DPC [Thu, 22 Apr 2021 16:14:37 +0000 (18:14 +0200)]
Rollup merge of #84376 - torhovland:issue-84534, r=GuillaumeGomez

Uses flex to fix formatting of h1 at any width

Fixes #84354.

3 years agoRollup merge of #84343 - camsteffen:closure-tree, r=varkor
Dylan DPC [Thu, 22 Apr 2021 16:14:32 +0000 (18:14 +0200)]
Rollup merge of #84343 - camsteffen:closure-tree, r=varkor

Remove `ScopeTree::closure_tree`

Seems to be dead code since #50649.

3 years agoAuto merge of #77704 - AnthonyMikh:slice_index_with_ops_bound_pair, r=m-ou-se
bors [Thu, 22 Apr 2021 15:36:27 +0000 (15:36 +0000)]
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*`.

3 years agoAdd better test for BinaryHeap::retain.
Mara Bos [Mon, 2 Nov 2020 19:40:12 +0000 (20:40 +0100)]
Add better test for BinaryHeap::retain.

3 years agoImprove BinaryHeap::retain.
Mara Bos [Mon, 2 Nov 2020 19:39:30 +0000 (20:39 +0100)]
Improve BinaryHeap::retain.

It now doesn't fully rebuild the heap, but only the parts that are
necessary.

3 years agoPrevent control, shift and alt keys to make search input lose focus
Guillaume Gomez [Thu, 22 Apr 2021 11:50:23 +0000 (13:50 +0200)]
Prevent control, shift and alt keys to make search input lose focus

3 years agoAuto merge of #71511 - hi-rustin:rustin-patch-rename-assoc, r=eddyb,varkor
bors [Thu, 22 Apr 2021 11:32:50 +0000 (11:32 +0000)]
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

3 years agodoc/platform-support: clarify UEFI support
David Rheinsberg [Thu, 22 Apr 2021 10:09:30 +0000 (12:09 +0200)]
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.

3 years agoRemove "Version control"
Christiaan Dirkx [Tue, 20 Apr 2021 20:22:35 +0000 (22:22 +0200)]
Remove "Version control"

3 years agoClean up .gitignore
Christiaan Dirkx [Tue, 20 Apr 2021 19:40:32 +0000 (21:40 +0200)]
Clean up .gitignore

3 years agoRemove `sys::args::Args::inner_debug` and use `Debug` instead
Christiaan Dirkx [Wed, 21 Apr 2021 21:51:28 +0000 (23:51 +0200)]
Remove `sys::args::Args::inner_debug` and use `Debug` instead

3 years agoMove `sys_common::poison` to `sync::poison`
Christiaan Dirkx [Wed, 21 Apr 2021 08:05:11 +0000 (10:05 +0200)]
Move `sys_common::poison` to `sync::poison`

3 years agoAuto merge of #84289 - andersk:bootstrap-bulk-dir, r=Mark-Simulacrum
bors [Thu, 22 Apr 2021 07:47:06 +0000 (07:47 +0000)]
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 c768ce138427b1844c1f6594daba9c0e33928032 and rustc-docs in commit 8ca46fc7a83734c9622f11f25d16b82316f44bcc (#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.`

3 years agoUse arrayvec 0.7, drop smallvec 0.6
Jubilee Young [Thu, 22 Apr 2021 04:40:29 +0000 (21:40 -0700)]
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.

3 years agoAuto merge of #84411 - m-ou-se:rollup-9btsp2t, r=m-ou-se
bors [Thu, 22 Apr 2021 05:01:30 +0000 (05:01 +0000)]
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

3 years agoRemove duplicated fn(Box<[T]>) -> Vec<T>
Caleb Sander [Fri, 16 Apr 2021 16:27:48 +0000 (12:27 -0400)]
Remove duplicated fn(Box<[T]>) -> Vec<T>

3 years agoAuto merge of #84407 - the8472:update-jobserver, r=Mark-Simulacrum
bors [Thu, 22 Apr 2021 02:20:29 +0000 (02:20 +0000)]
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

3 years agoRollup merge of #84406 - m-ou-se:drop-delete-alias, r=dtolnay
Mara Bos [Wed, 21 Apr 2021 21:06:24 +0000 (23:06 +0200)]
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

3 years agoRollup merge of #84393 - GuillaumeGomez:better-open-handling, r=jyn514
Mara Bos [Wed, 21 Apr 2021 21:06:23 +0000 (23:06 +0200)]
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``

3 years agoRollup merge of #84390 - m-ou-se:make-debug-non-exhaustive-without-fields-a-little...
Mara Bos [Wed, 21 Apr 2021 21:06:21 +0000 (23:06 +0200)]
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,
    ..
}

3 years agoRollup merge of #84380 - Smittyvb:rdoc-title-order, r=jsha
Mara Bos [Wed, 21 Apr 2021 21:06:20 +0000 (23:06 +0200)]
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.

3 years agoRollup merge of #84379 - marmeladema:test-for-issue-79949, r=jackh726
Mara Bos [Wed, 21 Apr 2021 21:06:19 +0000 (23:06 +0200)]
Rollup merge of #84379 - marmeladema:test-for-issue-79949, r=jackh726

Add GAT related tests

Closes #79949
Closes #79636
Closes #78671
Closes #70303
Closes #70304
Closes #71176

3 years agoRollup merge of #84378 - starthal:patch-1, r=jyn514
Mara Bos [Wed, 21 Apr 2021 21:06:18 +0000 (23:06 +0200)]
Rollup merge of #84378 - starthal:patch-1, r=jyn514

Fix broken doc link

3 years agoRollup merge of #84365 - vext01:improve-lto-docstrings, r=petrochenkov
Mara Bos [Wed, 21 Apr 2021 21:06:17 +0000 (23:06 +0200)]
Rollup merge of #84365 - vext01:improve-lto-docstrings, r=petrochenkov

Improve the docstrings of the `Lto` struct.

This change is the result of [this zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Making.20sense.20of.20LTO.20modes.20in.20rustc).

Hopefully it makes things a little clearer. What do you think?

3 years agoRollup merge of #84301 - r00ster91:patch-1, r=kennytm
Mara Bos [Wed, 21 Apr 2021 21:06:16 +0000 (23:06 +0200)]
Rollup merge of #84301 - r00ster91:patch-1, r=kennytm

Document that `index` and `index_mut` can panic

I thought this was noteworthy and I think a bit more explicitness does no harm.

3 years agoRollup merge of #84251 - RalfJung:non-zero-const-since, r=kennytm
Mara Bos [Wed, 21 Apr 2021 21:06:15 +0000 (23:06 +0200)]
Rollup merge of #84251 - RalfJung:non-zero-const-since, r=kennytm

fix 'const-stable since' for NonZeroU*::new_unchecked

For the unsigned `NonZero` types, `new_unchecked` was const-stable from the start with https://github.com/rust-lang/rust/pull/50808. Fix the docs to accurately reflect that.

I think this `since` is also incorrect:
```rust
            #[stable(feature = "from_nonzero", since = "1.31.0")]
            impl From<$Ty> for $Int {
```
The signed nonzero types were only stabilized in 1.34, so that `From` impl certainly didn't exist before. But I had enough of digging through git histories after I figured out when `new_unchecked` became const-stable...^^

3 years agoRollup merge of #84212 - CDirkx:void, r=m-ou-se
Mara Bos [Wed, 21 Apr 2021 21:06:14 +0000 (23:06 +0200)]
Rollup merge of #84212 - CDirkx:void, r=m-ou-se

Replace `Void` in `sys` with never type

This PR replaces several occurrences in `sys` of the type `enum Void {}` with the Rust never type (`!`).
The name `Void` is unfortunate because in other languages (C etc.) it refers to a unit type, not an uninhabited type.

Note that the previous stabilization of the never type was reverted, however all uses here are implementation details and not publicly visible.

3 years agoRollup merge of #84119 - CDirkx:vxworks, r=m-ou-se
Mara Bos [Wed, 21 Apr 2021 21:06:12 +0000 (23:06 +0200)]
Rollup merge of #84119 - CDirkx:vxworks, r=m-ou-se

Move `sys::vxworks` code to `sys::unix`

Follow-up to #77666, `sys::vxworks` is almost identical to `sys::unix`, the only differences are the `rand`, `thread_local_dtor`, and `process` implementation. Since `vxworks` is `target_family = unix` anyway, there is no reason for the code not to live inside of `sys::unix` like all the other unix-OSes.

https://github.com/rust-lang/rust/blob/e41f378f825488a537b024fc3ed599d9c12fda96/compiler/rustc_target/src/spec/vxworks_base.rs#L12

``@rustbot`` label: +T-libs-impl

3 years agoRollup merge of #84013 - CDirkx:fmt, r=m-ou-se
Mara Bos [Wed, 21 Apr 2021 21:06:11 +0000 (23:06 +0200)]
Rollup merge of #84013 - CDirkx:fmt, r=m-ou-se

Replace all `fmt.pad` with `debug_struct`

This replaces any occurrence of:
- `f.pad("X")` with `f.debug_struct("X").finish()`
- `f.pad("X { .. }")` with `f.debug_struct("X").finish_non_exhaustive()`

This is in line with existing formatting code such as
https://github.com/rust-lang/rust/blob/125505306744a0a5bb01d62337260a95d9ff8d57/library/std/src/sync/mpsc/mod.rs#L1470-L1475

3 years agoBump slice_index_with_ops_bound_pair to 1.53.0
Mara Bos [Wed, 21 Apr 2021 20:40:19 +0000 (22:40 +0200)]
Bump slice_index_with_ops_bound_pair to 1.53.0

3 years agobump jobserver dependency
The8472 [Wed, 21 Apr 2021 20:02:54 +0000 (22:02 +0200)]
bump jobserver dependency

the newest jobserver version should slightly reduce context switches
in highly parallel build environments on linux kernels >= 5.6

3 years agoRemove `delete` alias from `mem::drop`.
Mara Bos [Wed, 21 Apr 2021 19:54:39 +0000 (21:54 +0200)]
Remove `delete` alias from `mem::drop`.

3 years agoReplaced flex gap with margin, for compatibility with older browsers.
Tor Hovland [Wed, 21 Apr 2021 19:33:48 +0000 (21:33 +0200)]
Replaced flex gap with margin, for compatibility with older browsers.

3 years agoAuto merge of #84394 - m-ou-se:upgrade-ci-dep-expat, r=Mark-Simulacrum
bors [Wed, 21 Apr 2021 17:07:45 +0000 (17:07 +0000)]
Auto merge of #84394 - m-ou-se:upgrade-ci-dep-expat, r=Mark-Simulacrum

Upgrade `expat` dependency in riscv64 to newer version.

The old version was renamed to `expat-2.2.6-RENAMED-VULNERABLE-PLEASE-USE-2.3.0-INSTEAD`. :)

r? `@Mark-Simulacrum`

3 years agoMore review changes
Jack Huey [Wed, 21 Apr 2021 16:26:19 +0000 (12:26 -0400)]
More review changes

3 years agoMove `sys_common::rwlock::StaticRWLock` etc. to `sys::unix::rwlock`
Christiaan Dirkx [Wed, 21 Apr 2021 11:24:24 +0000 (13:24 +0200)]
Move `sys_common::rwlock::StaticRWLock` etc. to `sys::unix::rwlock`

3 years agoReview comments
Jack Huey [Wed, 21 Apr 2021 15:49:59 +0000 (11:49 -0400)]
Review comments

3 years agoUpdate LLVM submodule
Amanieu d'Antras [Wed, 21 Apr 2021 14:22:46 +0000 (15:22 +0100)]
Update LLVM submodule

Fixes #83467

3 years agorustc: Use LLVM's new saturating float-to-int intrinsics
Alex Crichton [Mon, 19 Apr 2021 17:55:32 +0000 (10:55 -0700)]
rustc: Use LLVM's new saturating float-to-int intrinsics

This commit updates rustc, with an applicable LLVM version, to use
LLVM's new `llvm.fpto{u,s}i.sat.*.*` intrinsics to implement saturating
floating-point-to-int conversions. This results in a little bit tighter
codegen for x86/x86_64, but the main purpose of this is to prepare for
upcoming changes to the WebAssembly backend in LLVM where wasm's
saturating float-to-int instructions will now be implemented with these
intrinsics.

This change allows simplifying a good deal of surrounding code, namely
removing a lot of wasm-specific behavior. WebAssembly no longer has any
special-casing of saturating arithmetic instructions and the need for
`fptoint_may_trap` is gone and all handling code for that is now
removed. This means that the only wasm-specific logic is in the
`fpto{s,u}i` instructions which only get used for "out of bounds is
undefined behavior". This does mean that for the WebAssembly target
specifically the Rust compiler will no longer be 100% compatible with
pre-LLVM 12 versions, but it seems like that's unlikely to be relied on
by too many folks.

Note that this change does immediately regress the codegen of saturating
float-to-int casts on WebAssembly due to the specialization of the LLVM
intrinsic not being present in our LLVM fork just yet. I'll be following
up with an LLVM update to pull in those patches, but affects a few other
SIMD things in flight for WebAssembly so I wanted to separate this change.

Eventually the entire `cast_float_to_int` function can be removed when
LLVM 12 is the minimum version, but that will require sinking the
complexity of it into other backends such as Cranelfit.

3 years agoApply suggestions from code review
Christiaan Dirkx [Wed, 21 Apr 2021 14:06:32 +0000 (16:06 +0200)]
Apply suggestions from code review

3 years agoUpgrade `expat` dependency in riscv64 to newer version.
Mara Bos [Wed, 21 Apr 2021 13:54:57 +0000 (15:54 +0200)]
Upgrade `expat` dependency in riscv64 to newer version.

The old version was renamed to
`expat-2.2.6-RENAMED-VULNERABLE-PLEASE-USE-2.3.0-INSTEAD`. :)

3 years agoFix `alloc::test::test_show`
Christiaan Dirkx [Wed, 21 Apr 2021 13:45:41 +0000 (15:45 +0200)]
Fix `alloc::test::test_show`

3 years agoChange the `Debug` impl of `Any` and `UnsafeCell` to use `finish_non_exhaustive`
Christiaan Dirkx [Wed, 21 Apr 2021 12:51:04 +0000 (14:51 +0200)]
Change the `Debug` impl of `Any` and `UnsafeCell` to use `finish_non_exhaustive`

3 years agoReplace all `fmt.pad` with `debug_struct`
Christiaan Dirkx [Mon, 5 Apr 2021 11:31:11 +0000 (13:31 +0200)]
Replace all `fmt.pad` with `debug_struct`

3 years agoCorrectly handle --open argument on doc command
Guillaume Gomez [Wed, 21 Apr 2021 12:20:56 +0000 (14:20 +0200)]
Correctly handle --open argument on doc command

3 years agoFormat `Struct { .. }` on one line even with `{:#?}`.
Mara Bos [Wed, 21 Apr 2021 11:50:56 +0000 (13:50 +0200)]
Format `Struct { .. }` on one line even with `{:#?}`.

3 years agoMove nested quantification check to ast_validation
Jack Huey [Wed, 21 Apr 2021 07:12:04 +0000 (03:12 -0400)]
Move nested quantification check to ast_validation

3 years agoCheck for intrinsics before coercing to a function pointer
Tomasz Miąsko [Wed, 21 Apr 2021 00:00:00 +0000 (00:00 +0000)]
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.

3 years agoJust merge all of the <title> tests into one
Smitty [Tue, 20 Apr 2021 23:56:28 +0000 (19:56 -0400)]
Just merge all of the <title> tests into one

3 years agoAdd test for title of root page in item-title.rs
Smitty [Tue, 20 Apr 2021 23:53:44 +0000 (19:53 -0400)]
Add test for title of root page in item-title.rs

3 years agoAdd test for issue #71176
marmeladema [Tue, 20 Apr 2021 23:07:42 +0000 (00:07 +0100)]
Add test for issue #71176

3 years agoAdd test for issue #70304
marmeladema [Tue, 20 Apr 2021 22:59:05 +0000 (23:59 +0100)]
Add test for issue #70304

3 years agofix is_module check
Smitty [Tue, 20 Apr 2021 23:10:00 +0000 (19:10 -0400)]
fix is_module check

3 years agoMerge mod-title and item-title tests
Smitty [Tue, 20 Apr 2021 22:57:26 +0000 (18:57 -0400)]
Merge mod-title and item-title tests

3 years agoRename pushname to is_module
Smitty [Tue, 20 Apr 2021 22:53:15 +0000 (18:53 -0400)]
Rename pushname to is_module

3 years agoAdd test for issue #70303
marmeladema [Tue, 20 Apr 2021 22:49:04 +0000 (23:49 +0100)]
Add test for issue #70303

3 years agoAdd test for issue #78671
marmeladema [Tue, 20 Apr 2021 22:41:40 +0000 (23:41 +0100)]
Add test for issue #78671

3 years agoAdd test for issue #79636
marmeladema [Tue, 20 Apr 2021 22:33:13 +0000 (23:33 +0100)]
Add test for issue #79636

3 years agoAdd test for issue #79949
marmeladema [Tue, 20 Apr 2021 21:40:09 +0000 (22:40 +0100)]
Add test for issue #79949