Commit Graph

164000 Commits

Author SHA1 Message Date
Michael Goulet
75430670b3 only check method inputs once 2022-02-27 19:47:40 -08:00
bors
ec0ab61e8a Auto merge of #94437 - RalfJung:miri, r=RalfJung
update Miri

Fixes https://github.com/rust-lang/rust/issues/94318
r? `@ghost`
2022-02-28 03:44:19 +00:00
Michael Goulet
025b7c433c fix ICE when passing empty block to while-loop condition 2022-02-27 19:27:50 -08:00
Ralf Jung
a538b185f0 update Miri 2022-02-27 22:04:00 -05:00
bors
b07d59f794 Auto merge of #94431 - matthiaskrgr:rollup-1jsj0wu, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #94396 (1 - Make more use of `let_chains`)
 - #94397 (Document that pre-expansion lint passes are softly deprecated)
 - #94399 (Add test for #79465 to prevent regression)
 - #94409 (avoid rebuilding bootstrap when PATH changes)
 - #94415 (Use the first codegen backend in the config.toml as default)
 - #94417 (Fix duplicated impl links)
 - #94420 (3 - Make more use of `let_chains`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-02-28 01:18:01 +00:00
Michael Goulet
5ce3f56641 Make deref suggestion better 2022-02-27 16:20:18 -08:00
Ibraheem Ahmed
aac0281d30 add slice::{from_ptr_range, from_mut_ptr_range} 2022-02-27 16:53:26 -05:00
bors
9fbff89354 Auto merge of #94157 - erikdesjardins:more-noundef, r=nikic
Apply noundef attribute to all scalar types which do not permit raw init

Beyond `&`/`&mut`/`Box`, this covers `char`, enum discriminants, `NonZero*`, etc.
All such types currently cause a Miri error if left uninitialized,
and an `invalid_value` lint in cases like `mem::uninitialized::<char>()`.

Note that this _does not_ change whether or not it is UB for `u64` (or
other integer types with no invalid values) to be undef.

Fixes (partially) #74378.

r? `@ghost` (blocked on #94127)

`@rustbot` label S-blocked
2022-02-27 21:41:06 +00:00
Matthias Krüger
5570b1de40
Rollup merge of #94420 - c410-f3r:more-let-chains, r=Dylan-DPC
3 - Make more use of `let_chains`

Continuation of #94376.

cc #53667
2022-02-27 21:46:38 +01:00
Matthias Krüger
04ecf52a48
Rollup merge of #94417 - GuillaumeGomez:fix-duplicated-impl-links, r=notriddle
Fix duplicated impl links

Fixes #78701.

The problem is that the blanket impl has the same ID as the other impl, except that we don't derive IDs when we generate the sidebar. We now do.

r? ``@notriddle``
2022-02-27 21:46:37 +01:00
Matthias Krüger
c930884619
Rollup merge of #94415 - bjorn3:cfg_default_backend, r=Mark-Simulacrum
Use the first codegen backend in the config.toml as default

It is currently hard coded to llvm if enabled and cranelift otherwise.
This made some sense when cranelift was the only alternative codegen
backend. Since the introduction of the gcc backend this doesn't make
much sense anymore. Before this PR bootstrapping rustc using a backend
other than llvm or cranelift required changing the source of
rustc_interface. With this PR it becomes a matter of putting the right
backend as first enabled backend in config.toml.

cc ```@antoyo```
2022-02-27 21:46:36 +01:00
Matthias Krüger
736dae2f71
Rollup merge of #94409 - RalfJung:path, r=Mark-Simulacrum
avoid rebuilding bootstrap when PATH changes

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

r? ```@Mark-Simulacrum```
2022-02-27 21:46:35 +01:00
Matthias Krüger
19958c2d09
Rollup merge of #94399 - GuillaumeGomez:regression-test-79465, r=matthiaskrgr
Add test for #79465 to prevent regression

Fixes #79465.

Like this we will be able to close the issue.

r? ````@matthiaskrgr````
2022-02-27 21:46:34 +01:00
Matthias Krüger
9373d8b6ae
Rollup merge of #94397 - xFrednet:69838-deprecate-pre-expansion, r=cjgillot
Document that pre-expansion lint passes are softly deprecated

The pre-expansion lint pass has been softly deprecated since https://github.com/rust-lang/rust/pull/69838. Every once in a while I see someone mention it as a possibility, only get the feedback that it's deprecated. This PR officially documents that the method is soft deprecated to have a single point of truth for it.

That's it. Have a great rest of the day 🙃

---

* See [rust#69838](https://github.com/rust-lang/rust/pull/69838)
* See [rust-clippy#5518](https://github.com/rust-lang/rust-clippy/pull/5518)
2022-02-27 21:46:34 +01:00
Matthias Krüger
8cdafbf068
Rollup merge of #94396 - c410-f3r:yet-more-let-chains, r=Dylan-DPC
1 - Make more use of `let_chains`

Continuation of #94376.

cc #53667
2022-02-27 21:46:33 +01:00
Simonas Kazlauskas
dfcfaa4ec1 Do not pass through features without +/- prefix
LLVM really dislikes this and will assert, saying something along the
lines of:

```
rustc: llvm/lib/MC/MCSubtargetInfo.cpp:60: void ApplyFeatureFlag(
  llvm::FeatureBitset&, llvm::StringRef, llvm::ArrayRef<llvm::SubtargetFeatureKV>
): Assertion
  `SubtargetFeatures::hasFlag(Feature) && "Feature flags should start with '+' or '-'"`
failed.
```
2022-02-27 21:21:38 +02:00
Erik Desjardins
45ee3fc700 make pgo-branch-weights test not dependent on argument attributes 2022-02-27 13:41:43 -05:00
Camille GILLOT
e77e4fcf89 Only create a single expansion for each inline integration. 2022-02-27 19:05:56 +01:00
bors
6a70556616 Auto merge of #94412 - scottmcm:cfg-out-miri-from-swap, r=oli-obk
For MIRI, cfg out the swap vectorization logic from 94212

Because of #69488 the swap logic from #94212 doesn't currently work in MIRI.

Copying in smaller pieces is probably much worse for its performance anyway, so it'd probably rather just use the simple path regardless.

Part of #94371, though another PR will be needed for the CTFE aspect.

r? `@oli-obk`
cc `@RalfJung`
2022-02-27 17:42:48 +00:00
Erik Desjardins
fec4335407 Apply noundef metadata to loads of types that do not permit raw init
This matches the noundef attributes we apply on arguments/return types.
2022-02-27 12:16:16 -05:00
Ruby Lazuli
6dcf5d8fde
Lint against more useless #[must_use] attributes
This expands the existing `#[must_use]` check in `unused_attributes`
to lint against pretty much everything `#[must_use]` doesn't support.
Fixes #93906.
2022-02-27 08:52:37 -06:00
Caio
0eb8b32de3 3 - Make more use of let_chains
Continuation of #94376.

cc #53667
2022-02-27 11:10:20 -03:00
bors
3b1fe7e7c9 Auto merge of #94084 - Mark-Simulacrum:drop-sharded, r=cjgillot
Avoid query cache sharding code in single-threaded mode

In non-parallel compilers, this is just adding needless overhead at compilation time (since there is only one shard statically anyway). This amounts to roughly ~10 seconds reduction in bootstrap time, with overall neutral (some wins, some losses) performance results.

Parallel compiler performance should be largely unaffected by this PR; sharding is kept there.
2022-02-27 14:04:07 +00:00
bors
bab4c13f64 Auto merge of #94400 - c410-f3r:more-let-chains, r=Dylan-DPC
2 - Make more use of `let_chains`

Continuation of #94376.

cc #53667
2022-02-27 11:45:55 +00:00
Guillaume Gomez
9b8a6b97e5 Add test to ensure that links to impls are correctly generated 2022-02-27 12:07:54 +01:00
Guillaume Gomez
7e0a2a765e Correctly generate links in the sidebar for impls 2022-02-27 12:07:38 +01:00
bjorn3
7ad4297a49 Use the first codegen backend in the config.toml as default
It is currently hard coded to llvm if enabled and cranelift otherwise.
This made some sense when cranelift was the only alternative codegen
backend. Since the introduction of the gcc backend this doesn't make
much sense anymore. Before this PR bootstrapping rustc using a backend
other than llvm or cranelift required changing the source of
rustc_interface. With this PR it becomes a matter of putting the right
backend as first enabled backend in config.toml.
2022-02-27 11:28:05 +01:00
bors
2bd9656c80 Auto merge of #94221 - erikdesjardins:addattr, r=nikic
Add LLVM attributes in batches instead of individually

This should improve performance.

~r? `@ghost` (blocked on #94127)~
2022-02-27 09:23:24 +00:00
DrMeepster
bfa7d44823 fix box icing when it has aggregate abi 2022-02-27 00:48:17 -08:00
bors
9323028156 Auto merge of #94144 - est31:let_else_trait_selection, r=cjgillot
rustc_trait_selection: adopt let else in more places

Continuation of #89933, #91018, #91481, #93046, #93590, #94011.

I have extended my clippy lint to also recognize tuple passing and match statements. The diff caused by fixing it is way above 1 thousand lines. Thus, I split it up into multiple pull requests to make reviewing easier. This PR handles rustc_trait_selection.
2022-02-27 07:02:46 +00:00
bors
6abd8cd643 Auto merge of #94361 - nikic:s390x-update, r=Mark-Simulacrum
Update dist-s390x-dist image

Update to Ubuntu 20.04 and crosstool-ng 1.24.0. I've upgraded the
ct-ng config and then manually reset the kernel and glibc versions
to the oldest supported.

Specifically, we're updating from kernel 2.6.32.68 to 2.6.32.71
and glibc 2.11.1 to 2.12.1 here. The compiler toolchain is also
updated, but I don't think that's relevant for compatibility.

I've also enabled LLD, so this fixes #94324.

r? `@Mark-Simulacrum` cc `@uweigand`
2022-02-27 04:08:50 +00:00
Scott McMurray
b582bd388f For MIRI, cfg out the swap logic from 94212 2022-02-26 18:57:15 -08:00
bors
035a717ee8 Auto merge of #94373 - erikdesjardins:getitinl, r=Mark-Simulacrum
Make TLS __getit #[inline(always)] on non-Windows

This may improve perf, and/or stop `externs` perf benchmarks from being flaky.

r? `@ghost`
2022-02-27 01:23:48 +00:00
Ralf Jung
35e3aaf8d8 avoid rebuilding bootstrap when PATH changes 2022-02-26 19:07:02 -05:00
Nikita Popov
dac285905b Update dist-s390x-dist image
Update to Ubuntu 20.04 and crosstool-ng 1.24.0. I've updated the
ct-ng config and then manually reset the kernel and glibc versions
to the oldest supported.

Specifically, we're updating from kernel 2.6.32.68 to 2.6.32.71
and glibc 2.11.1 to 2.12.1 here. The compiler toolchain is also
updated, but I don't think that's relevant for compatibility.
2022-02-26 23:40:47 +01:00
Erik Desjardins
0d0cc4f6a0 AttrBuilder doesn't take a context in old LLVM 2022-02-26 17:16:01 -05:00
Erik Desjardins
ac9f4f7d0d use attrbuilder to remove attrs in old LLVM 2022-02-26 16:58:45 -05:00
Erik Desjardins
91e7e8ddcb just put smallvec lengths in the signature 2022-02-26 16:58:17 -05:00
bors
761e888485 Auto merge of #93516 - nagisa:branch-protection, r=cjgillot
No branch protection metadata unless enabled

Even if we emit metadata disabling branch protection, this metadata may
conflict with other modules (e.g. during LTO) that have different branch
protection metadata set.

This is an unstable flag and feature, so ideally the flag not being
specified should act as if the feature wasn't implemented in the first
place.

Additionally this PR also ensures we emit an error if
`-Zbranch-protection` is set on targets other than the supported
aarch64. For now the error is being output from codegen, but ideally it
should be moved to earlier in the pipeline before stabilization.
2022-02-26 21:53:03 +00:00
Erik Desjardins
5979b681e6 Apply noundef attribute to all scalar types which do not permit raw init
Beyond `&`/`&mut`/`Box`, this covers `char`, discriminants, `NonZero*`, etc.
All such types currently cause a Miri error if left uninitialized,
and an `invalid_value` lint in cases like `mem::uninitialized::<char>()`

Note that this _does not_ change whether or not it is UB for `u64` (or
other integer types with no invalid values) to be undef.
2022-02-26 16:42:33 -05:00
Jubilee
5f49d4c843
rust-lang/portable-simd#239: Bitmask conversion trait
Another approach that fixes rust-lang/portable-simd#223, as an alternative to rust-lang/portable-simd#238.

This adds the `ToBitMask` trait, which is implemented on a vector for each bitmask type it supports.  This includes all unsigned integers with enough bits to contain it.  The byte array variant has been separated out for now into rust-lang/portable-simd#246 and still requires `generic_const_exprs`, but the integer variants no longer require it and can make it to nightly.
2022-02-26 12:56:23 -08:00
bors
10cc7a6d03 Auto merge of #93449 - JakobDegen:restrict-hasdrop-optimization, r=cjgillot
Restrict query recursion in `needs_significant_drop`

Overly aggressive use of the query system to improve caching lead to query cycles and consequently ICEs. This patch fixes this by restricting the use of the query system as a cache to those cases where it is definitely correct.

Closes #92725 .

This is essentially a revert of #90845 for the significant drop case only. The general `needs_drop` still does the same thing. The hope is that this is enough to preserve the performance improvements of that PR while fixing the ICE. Should get a perf run to verify that this is the case.

cc `@cjgillot`
2022-02-26 19:25:04 +00:00
Erik Desjardins
30d3ce0674 Add LLVM attributes in batches instead of individually
This should improve performance.
2022-02-26 13:14:55 -05:00
Caio
ef5601b321 2 - Make more use of let_chains
Continuation of #94376.

cc #53667
2022-02-26 13:45:43 -03:00
bors
8604ef0878 Auto merge of #94329 - flip1995:clippyup, r=Manishearth
Update Clippy

r? `@Manishearth`
2022-02-26 16:44:17 +00:00
Guillaume Gomez
915740c392 Add test for #79465 to prevent regression 2022-02-26 16:58:21 +01:00
bors
6f681a8eb3 Auto merge of #94376 - c410-f3r:more-let-chains, r=petrochenkov
Initiate the inner usage of `let_chains`

The intention here is create a strong and robust foundation for a possible future stabilization so please, do not let the lack of any external tool support prevent the merge of this PR. Besides, `let_chains` is useful by itself.

cc #53667
2022-02-26 14:23:27 +00:00
flip1995
0d4e58304d
Update Cargo.lock (Clippy version bump) 2022-02-26 14:43:58 +01:00
flip1995
d128f9392d
Merge commit 'e329249b6a3a98830d860c74c8234a8dd9407436' into clippyup 2022-02-26 14:26:21 +01:00
bors
8c9640e34c Auto merge of #94078 - TaKO8Ki:suggest-float-literal-for-float-divided-by-integer, r=estebank
Suggest a float literal when dividing a floating-point type by `{integer}`

closes #93829
2022-02-26 11:58:12 +00:00