Commit graph

142771 commits

Author SHA1 Message Date
Christiaan Dirkx
cf470197ad Move all cleanup to sys::cleanup 2021-04-22 10:44:44 +02:00
Christiaan Dirkx
5b30662741 Rework at_exit to cleanup 2021-04-22 10:34:48 +02:00
Christiaan Dirkx
9cabbd0afc Move sys_common::poison to sync::poison 2021-04-22 10:27:21 +02:00
bors
1f7aef336e Auto merge of #7102 - taralx:taralx-patch-1, r=flip1995
Switch transmute_ptr_to_ptr to "pedantic" class.

Per discussion in https://github.com/rust-lang/rust-clippy/issues/6372, this lint has significant false positives.

changelog: transmute_ptr_to_ptr defaults to "allow".
2021-04-22 08:26:14 +00: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
Mara Bos
e7f20335a6
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
2021-04-21 23:06:19 +02:00
Mara Bos
193b631593
Rollup merge of #84378 - starthal:patch-1, r=jyn514
Fix broken doc link
2021-04-21 23:06:18 +02:00
Mara Bos
6967b68667
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?
2021-04-21 23:06:17 +02:00
Mara Bos
d341851f94
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.
2021-04-21 23:06:16 +02:00
Mara Bos
47886ead1f
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...^^
2021-04-21 23:06:15 +02:00
Mara Bos
31b83802a4
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.
2021-04-21 23:06:14 +02:00
Mara Bos
3897ad1128
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.

e41f378f82/compiler/rustc_target/src/spec/vxworks_base.rs (L12)

``@rustbot`` label: +T-libs-impl
2021-04-21 23:06:12 +02:00
Mara Bos
a7a7737114
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
1255053067/library/std/src/sync/mpsc/mod.rs (L1470-L1475)
2021-04-21 23:06:11 +02:00
Mara Bos
6763a40eff
Bump slice_index_with_ops_bound_pair to 1.53.0 2021-04-21 22:40:19 +02:00
Josh Stone
2a97c690bc Note array.into_iter() specifically in method probing 2021-04-21 13:04:59 -07:00
The8472
7f45cdb090 bump jobserver dependency
the newest jobserver version should slightly reduce context switches
in highly parallel build environments on linux kernels >= 5.6
2021-04-21 22:02:54 +02:00
Mara Bos
f1f3069a98 Remove delete alias from mem::drop. 2021-04-21 21:54:39 +02:00
Tor Hovland
bb91805ace Replaced flex gap with margin, for compatibility with older browsers. 2021-04-21 21:33:48 +02:00
bors
b849326744 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`
2021-04-21 17:07:45 +00:00
Jack Huey
c78724f869 More review changes 2021-04-21 12:26:19 -04:00
Christiaan Dirkx
eb9b0f6ab7 Move sys_common::rwlock::StaticRWLock etc. to sys::unix::rwlock 2021-04-21 17:53:00 +02:00
Jack Huey
b78c0d8a4d Review comments 2021-04-21 11:49:59 -04:00
bors
79b9eb5371 Auto merge of #7072 - ebobrow:imports-ending-with-self, r=camsteffen
add unnecessary_self_imports lint

fixes #6552

changelog: add `unnecessary_self_imports` lint
2021-04-21 14:47:49 +00:00
Amanieu d'Antras
e34f7e665f Update LLVM submodule
Fixes #83467
2021-04-21 15:22:46 +01:00
Elliot Bobrow
224881b94d add unnecessary_self_imports lint 2021-04-21 07:17:42 -07:00
Alex Crichton
de2a4601ab 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.
2021-04-21 07:15:53 -07:00
Christiaan Dirkx
aa46f08abd Apply suggestions from code review 2021-04-21 16:06:32 +02:00
bors
bbc22e2ef3 Auto merge of #7083 - GuillaumeGomez:bool-assert-eq, r=camsteffen
Add lint to check for boolean comparison in assert macro calls

This PR adds a lint to check if an assert macro is using a boolean as "comparison value". For example:

```rust
assert_eq!("a".is_empty(), false);
```

Could be rewritten as:

```rust
assert!(!"a".is_empty());
```

PS: The dev guidelines are amazing. Thanks a lot for writing them!

changelog: Add `bool_assert_comparison` lint
2021-04-21 13:58:53 +00:00
Mara Bos
9ac18da17e 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`. :)
2021-04-21 15:54:57 +02:00
Christiaan Dirkx
fccc75cf82 Fix alloc::test::test_show 2021-04-21 15:45:41 +02:00
bjorn3
cdc0aa188e Rustup to rustc 1.53.0-nightly (6df26f897 2021-04-20) 2021-04-21 15:32:04 +02:00
lcnr
d3e0d2f53d supply substs to anon consts in defaults 2021-04-21 15:25:58 +02:00
lcnr
312b4fdfd2 improve wf check for const param defaults 2021-04-21 15:25:58 +02:00
lcnr
7cb1dcd488 loosen ordering restricts for const_generics_defaults 2021-04-21 15:25:58 +02:00
lcnr
259a368e9e fix name resolution for param defaults 2021-04-21 15:25:32 +02:00
Christiaan Dirkx
fdae75738b Change the Debug impl of Any and UnsafeCell to use finish_non_exhaustive 2021-04-21 14:51:04 +02:00
Christiaan Dirkx
1fb3256fcb Replace all fmt.pad with debug_struct 2021-04-21 14:38:24 +02:00
Guillaume Gomez
cc44ce0a3f Correctly handle --open argument on doc command 2021-04-21 14:36:26 +02:00
Mara Bos
82dc73b1ae Format Struct { .. } on one line even with {:#?}. 2021-04-21 13:50:56 +02:00
bjorn3
05f9602567 Sync from rust 6df26f897c 2021-04-21 11:29:57 +02:00
bors
926286acfe Auto merge of #7109 - ctennis:ct/asm_syntax_aarch64, r=flip1995
Ignore aarch64 for this test as it's x86 assembly only.  Fixes #7091

fixes #7091 - asm_syntax lint test will not compile on aarch64

changelog: none
2021-04-21 08:49:15 +00:00
Jack Huey
4568e7d62e Move nested quantification check to ast_validation 2021-04-21 03:12:04 -04:00