Commit graph

155725 commits

Author SHA1 Message Date
Fabian Wolff
9626f2bd84 Fix extra non_snake_case warning for shorthand field bindings 2021-10-03 14:33:14 +02:00
Stefan Schindler
e599e2df49 Move from grid layout to table based layout because of browser limits that overlay row entries after a UA specific amount of rows 2021-10-03 08:20:08 -04:00
Stefan Schindler
677fb6b1db Show how many tests are running in parallel 2021-10-03 08:20:08 -04:00
Stefan Schindler
a0cc9bb0f6 Add a test to detect overlapping entries in overview tables
Detects https://github.com/rust-lang/rust/issues/88545
2021-10-03 08:20:08 -04:00
Fabian Wolff
cf19131cb3 Try to recover from a => -> = or -> typo in a match arm 2021-10-03 14:14:35 +02:00
Matthias Kaak
d6a7e74c81 Combined 4 commits into 1
Fixed numerus of error message

Removed superfluous argument

Using pluralize!() instead of code duplication

Adjusted a test
2021-10-03 11:53:12 +00:00
bors
4479cb82e5 Auto merge of #89459 - tspiteri:idiv-overflow-bitand, r=kennytm
Use bitand when checking for signed integer division overflow

For `self == Self::MIN && rhs == -1`, LLVM does not realize that this is the same check made by `self / rhs`, so the code generated may have some unnecessary duplication. For `(self == Self::MIN) & (rhs == -1)`, LLVM realizes it is the same check.
2021-10-03 10:34:57 +00:00
Hans Kratz
32e19fbecb Update Let's Encrypt ROOT CA certificate in dist-(i686|x86_64)-linux docker images 2021-10-03 10:58:37 +02:00
Hirochika Matsumoto
3818981ca1 Practice diagnostic message convention 2021-10-03 16:16:28 +09:00
bors
c24c9067ee Auto merge of #88060 - TennyZhuang:optimize-vec-retain, r=dtolnay
Optimize unnecessary check in Vec::retain

The function `vec::Vec::retain` only have two stages:

1. Nothing was deleted.
2. Some elements were deleted.

Here is an unnecessary check `if g.deleted_cnt > 0` in the loop, and it's difficult for compiler to optimize it. I split the loop into two stages manully and keep the code clean using const generics.

I write a special but common bench case for this optimization. I call retain on vec but keep all elements.

Before and after this optimization:

```
test vec::bench_retain_whole_100000                      ... bench:      84,803 ns/iter (+/- 17,314)
```

```
test vec::bench_retain_whole_100000                      ... bench:      42,638 ns/iter (+/- 16,910)
```

The result is expected, there are two `if`s before the optimization and one `if` after.
2021-10-03 06:24:06 +00:00
Hirochika Matsumoto
fb0b1a5466 Follow the diagnostic output style guide 2021-10-03 14:28:39 +09:00
bors
77f1e504a9 Auto merge of #89479 - camsteffen:diag-naming, r=Manishearth
Make diangostic item naming consistent

Right now there is about a 50/50 split of naming diagnostic items as `vec_type` vs `Vec`. So it is hard to guess a diagnostic item name with confidence. I know it's not great to change these retroactively, but I think it will be much easier to maintain consistency after consistency is established.
2021-10-03 03:43:21 +00:00
Hameer Abbasi
dc4043075e Move test to correct path. 2021-10-03 05:24:45 +02:00
Hameer Abbasi
3da9dea491 Add test for issue 89118. 2021-10-03 04:08:11 +02:00
bors
c70b35efd8 Auto merge of #84267 - dtolnay:ptrunit, r=nagisa
Make *const (), *mut () okay for FFI

Pointer-to-() is used occasionally in the standard library to mean "pointer to none-of-your-business". Examples:

- `RawWakerVTable::new` https://doc.rust-lang.org/1.51.0/std/task/struct.RawWakerVTable.html#method.new
- `<*const T>::to_raw_parts` https://doc.rust-lang.org/nightly/std/primitive.pointer.html#method.to_raw_parts

I believe it's useful for the same purpose in FFI signatures, even while `()` itself is not FFI safe. The following should be allowed:

```rust
extern "C" {
    fn demo(pc: *const (), pm: *mut ());
}
```

Prior to this PR, those pointers were not considered okay for an extern signature.

```console
warning: `extern` block uses type `()`, which is not FFI-safe
 --> src/main.rs:2:17
  |
2 |     fn demo(pc: *const (), pm: *mut ());
  |                 ^^^^^^^^^ not FFI-safe
  |
  = note: `#[warn(improper_ctypes)]` on by default
  = help: consider using a struct instead
  = note: tuples have unspecified layout

warning: `extern` block uses type `()`, which is not FFI-safe
 --> src/main.rs:2:32
  |
2 |     fn demo(pc: *const (), pm: *mut ());
  |                                ^^^^^^^ not FFI-safe
  |
  = help: consider using a struct instead
  = note: tuples have unspecified layout
```
2021-10-03 00:41:49 +00:00
Cameron Steffen
eec856bfbc Make diangostic item names consistent 2021-10-02 19:38:19 -05:00
Cameron Steffen
67ea84d97a Add desugaring mark to while loop 2021-10-02 17:41:14 -05:00
Devin Ragotzy
b06409ebcd Rename etc -> has_rest_pat 2021-10-02 17:51:31 -04:00
Devin Ragotzy
3d83ff6aa3 Add ui test for empty fields for omitted_patterns lint 2021-10-02 17:50:53 -04:00
Devin Ragotzy
f7a8980347 Reorder etc check for non_exhaustive_omitted_patterns 2021-10-02 17:50:53 -04:00
Devin Ragotzy
8cbcc893a6 Fix ICE caused by non_exaustive_omitted_patterns struct lint 2021-10-02 17:50:53 -04:00
bors
2801a770ce Auto merge of #89345 - jackh726:89333, r=estebank
Don't lose binders when printing trait bound suggestion

Fixes #89333
2021-10-02 21:30:51 +00:00
Noah Lev
abbead78f7 rustdoc: Improve doctest pass's name and module's name
As the docs at the top of the file say, it is an overloaded pass and
actually runs two lints.
2021-10-02 14:15:34 -07:00
David Wood
e552c0d86b bootstrap: add config option for nix patching
On NixOS systems, bootstrap will patch rustc used in bootstrapping after
checking `/etc/os-release` (to confirm the current distribution is NixOS).
However, when using Nix on a non-NixOS system, it can be desirable for
bootstrap to patch rustc. In this commit, a `patch-binaries-for-nix`
option is added to `config.toml`, which allows for user opt-in to
bootstrap's Nix patching.

Signed-off-by: David Wood <david.wood@huawei.com>
2021-10-02 20:01:43 +00:00
Simonas Kazlauskas
5b4873a759 Run the #85441 regression test on MSVC only
On MinGW toolchains the various features (such as function sections)
necessary to eliminate dead function references are disabled due to
various bugs. This means that the windows sockets library will most
likely remain linked to any mingw toolchain built program that also
utilizes libstd.

That said, I made an attempt to also enable `function-sections` and
`--gc-sections` during my experiments, but the symbol references
remained, sadly.
2021-10-02 22:16:23 +03:00
Christiaan Dirkx
b7d2b465b9 Add test for checking if WS2_32.dll is linked 2021-10-02 22:08:35 +03:00
Christiaan Dirkx
9a6f2e655a Only register WSACleanup if WSAStartup is actually ever called 2021-10-02 22:08:35 +03:00
bors
f03eb6bef8 Auto merge of #89341 - audunhalland:derive-type-params-with-bound-generic-params, r=jackh726
Deriving: Include bound generic params in type parameters for where clause

Fixes #89188.

The `derive` macro ignored the `for<'s>` needed with the `Fn` trait in that code example.

edit: I'm unsure if this might cause regressions. I'm not an experienced compiler developer so I'm not used to thinking about unwanted side effects code changes like this might have.
2021-10-02 18:46:27 +00:00
bjorn3
e98f28907e Turn a module non-doc comment into a doc comment 2021-10-02 19:09:29 +02:00
bjorn3
998753c6f7 Swap out unboxed_closures feature gate for min_specialization
For some reason unboxed_closures supresses the feature gate for
min_specialization when implementing TrustedStep. min_specialization is
the true feature that is used.
2021-10-02 19:09:29 +02:00
bjorn3
83ddedf170 Remove various unused feature gates 2021-10-02 19:09:18 +02:00
Tobias Nießen
e017e458ab
Fix typos in rustdoc/lints
Refs: https://github.com/rust-lang/rust/pull/85223
2021-10-02 19:03:32 +02:00
bjorn3
e2d3e09b9c Prevent macro ambiguity errors
The previous macro_rules! parsers failed when an additional modifier was added
with ambiguity errors. The error is pretty unclear as to what exactly the cause
here is, but this change simplifies the argument parsing code such that the
error is avoided.
2021-10-02 13:00:19 -04:00
bors
d14731cb3c Auto merge of #89239 - petrochenkov:modcache, r=cjgillot
resolve: Cache module loading for all foreign modules

It was previously cached for modules loaded from `fn get_module`, but not for modules loaded from `fn build_reduced_graph_for_external_crate_res`.
This also makes all foreign modules use their real parent, span and expansion instead of possibly a parent/span/expansion of their reexport.
Modules are also often compared using referential equality (`ptr::eq`), this change makes such comparisons correct in all cases.

An ICE happening on attempt to decode expansions for foreign enums and traits is avoided.

Also local enums and traits are now added to the module map.

Follow up to https://github.com/rust-lang/rust/pull/88872.
r? `@cjgillot`
2021-10-02 16:17:13 +00:00
Vadim Petrochenkov
d7d07657cd rustc_span: Make hygiene debug printing reproducible 2021-10-02 18:31:50 +03:00
Vadim Petrochenkov
ded08e44c6 resolve: Avoid comparing modules by optional def-id
It makes all block modules identical during comparison
2021-10-02 18:31:50 +03:00
Vadim Petrochenkov
5aa732a364 resolve: Cache module loading for all foreign modules
It was previously cached for modules loaded from `fn get_module`, but not for modules loaded from `fn build_reduced_graph_for_external_crate_res`.
This also makes all foreign modules use their real parent, span and expansion instead of possibly a parent/span/expansion of their reexport.

An ICE happening on attempt to decode expansions for foreign enums and traits is avoided.

Also local enums and traits are now added to the module map.
2021-10-02 18:31:42 +03:00
bors
edebf77e00 Auto merge of #89408 - Mark-Simulacrum:fix-query-nondet, r=petrochenkov
Avoid nondeterminism in trimmed_def_paths

Previously this query depended on the global interning order of Symbols, which
meant that irrelevant changes could influence the query and cause
recompilations. This commit ensures that the return set is stable and will not
be affected by the global order by deterministically (in lexicographic order)
choosing a name to use if there are multiple names for a single DefId.

This should fix the cause of the [regressions] in #83343.

[regressions]: https://perf.rust-lang.org/compare.html?start=9620f3a84b079decfdc2e557be007580b097fe43&end=addb4da686a97da46159f0123cb6cdc2ce3d7fdb
2021-10-02 13:36:27 +00:00
David Carlier
98dde56eb1 haiku thread affinity build fix 2021-10-02 13:24:30 +01:00
bors
b27661eb33 Auto merge of #89405 - GuillaumeGomez:fix-clippy-lints, r=cjgillot
Fix clippy lints

I'm currently working on allowing clippy to run on librustdoc after a discussion I had with `@Mark-Simulacrum.` So in the meantime, I fixed a few lints on the compiler crates.
2021-10-02 10:52:09 +00:00
Trevor Spiteri
1139ee32aa Use bitand when checking for signed integer division overflow
For `self == Self::MIN && rhs == -1`, LLVM does not realize that this is the
same check made by `self / rhs`, so the code generated may have some unnecessary
duplication. For `(self == Self::MIN) & (rhs == -1)`, LLVM realizes it is the
same check.
2021-10-02 12:16:08 +02:00
Audun Halland
87241e9099 Expand one test (from jackh726) 2021-10-02 11:26:56 +02:00
Oli Scherer
69274aa549 Bump tracing to get the instrumentation perf improvement 2021-10-02 08:22:03 +00:00
bors
a8387aef8c Auto merge of #89450 - usbalbin:const_try_revert, r=oli-obk
Revert #86853

Should fix issue found in #89432
2021-10-02 07:41:25 +00:00
Josh Stone
03cf07f85f Update to the final LLVM 13.0.0 release 2021-10-01 21:06:19 -07:00
Bruce Mitchener
058a21d5cf Consistently use 'supertrait'.
A subset of places referred to 'super-trait', so this changes them
to all use 'supertrait'. This matches 'supertype' and some other
usages. An exception is 'auto-trait' which is consistently used
in that manner.
2021-10-02 08:05:44 +07:00
Michael Howell
277a018140 rustdoc: use slice::contains instead of open-coding it 2021-10-01 16:42:29 -07:00
Albin Hedman
6a0c97aa5c
Add regression test for #89432
Co-authored-by: Josh Stone <cuviper@gmail.com>
2021-10-02 01:12:15 +02:00
bors
6e12110812 Auto merge of #89449 - Manishearth:rollup-3alb61f, r=Manishearth
Rollup of 7 pull requests

Successful merges:

 - #85223 (rustdoc: Clarified the attribute which prompts the warning)
 - #88847 (platform-support.md: correct ARMv7+MUSL platform triple notes)
 - #88963 (Coerce const FnDefs to implement const Fn traits )
 - #89376 (Fix use after drop in self-profile with llvm events)
 - #89422 (Replace whitespaces in doctests' name with dashes)
 - #89440 (Clarify a sentence in the documentation of Vec (#84488))
 - #89441 (Normalize after substituting via `field.ty()`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-10-01 22:47:22 +00:00
Albin Hedman
81bb5a54c3
Revert "Auto merge of #86853 - usbalbin:const_try, r=oli-obk"
This reverts commit c6007fdc70, reversing
changes made to 69c1c6a173.
2021-10-02 00:07:48 +02:00