229048 Commits

Author SHA1 Message Date
bors
d5c2e9c342 Auto merge of #115787 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum
[stable] 1.72.1 release

This backports:

*  Remove assert that checks type equality #115215
*  implied bounds: do not ICE on unconstrained region vars #115559
*  rustdoc: correctly deal with self ty params when eliding default object lifetimes #115276
*  Stop emitting non-power-of-two vectors in (non-portable-SIMD) codegen #115236
*  Normalize before checking if local is freeze in deduced_param_attrs #114948

Some cherry-picks required merge conflict resolution, we'll see if I got it right based on CI (rustdoc fix and LLVM codegen test).

r? `@Mark-Simulacrum`
1.72.1
2023-09-13 22:21:27 +00:00
Mark Rousskov
7900923b25 Move to older, mirrored redox install 2023-09-13 14:43:08 -04:00
Mark Rousskov
9c84757e01 Bump to supported Ubuntu
This hopefully fixes CI.
2023-09-13 08:44:56 -04:00
Mark Rousskov
0414f85177 1.72.1 release 2023-09-13 08:44:56 -04:00
Michael Goulet
ba911b11cb Normalize before checking if local is freeze in deduced_param_attrs 2023-09-13 08:44:56 -04:00
ouz-a
cc2240ef81 Remove assert that checks type equality 2023-09-13 08:44:56 -04:00
Scott McMurray
977fada591 Stop emitting non-power-of-two vectors in basic LLVM codegen 2023-09-13 08:44:56 -04:00
León Orell Valerian Liehr
7eed169745 rustdoc: correctly deal with self ty params when eliding default object lifetimes 2023-09-12 10:56:04 -04:00
lcnr
61d4817d5f unconstrained region vars: do not ICE ICE baby 2023-09-12 10:37:43 -04:00
bors
5680fa18fe Auto merge of #115140 - wesleywiser:turn_off_mir_sroa, r=cuviper
Disable MIR SROA optimization by default

Turn off the MIR SROA optimization by default to prevent incorrect debuginfo generation and rustc ICEs caused by invalid LLVM IR being created.

Related to #115113

r? `@cuviper`
cc `@saethlin`
1.72.0
2023-08-23 19:48:39 +00:00
Wesley Wiser
298ec5258f Disable MIR SROA optimization by default
Turn off the MIR SROA optimization by default to prevent incorrect
debuginfo generation and rustc ICEs caused by invalid LLVM IR being
created.

Related to #115113
2023-08-23 14:08:43 -04:00
bors
f155f8c3d9 Auto merge of #115083 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum
[stable] backport lint-docs fix

r? `@Mark-Simulacrum`
2023-08-22 03:32:56 +00:00
Mark Rousskov
44013319fb Include 1.17.1 release notes too 2023-08-21 22:47:43 -04:00
jyn
7cc7c5fbd5 Revert "Fix x test lint-docs when download-rustc is enabled"
This was not the correct fix. The problem was two-fold:
- `download-rustc` didn't respect `llvm.assertions`
- `rust-dev` was missing a bump to `download-ci-llvm-stamp`

The first is fixed in this PR and the latter was fixed a while ago. Revert this change to avoid breaking `rpath = false`.
2023-08-21 22:23:48 -04:00
bors
6301e8cdd5 Auto merge of #115057 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum
[stable] 1.72.0 release

r? `@Mark-Simulacrum`
2023-08-21 14:55:36 +00:00
Mark Rousskov
dabccdcb9b 1.72.0 release 2023-08-21 09:14:53 -04:00
bors
7a3a43a3b9 Auto merge of #114955 - cuviper:beta-next, r=cuviper
[beta] backports

* Upgrade std to gimli 0.28.0 #114825
* Partially revert #107200 #114897
* Permit pre-evaluated constants in simd_shuffle #113529

r? cuviper
2023-08-18 03:54:23 +00:00
Oli Scherer
402cc350c1 Monomorphize constants before inspecting them
(cherry picked from commit c7428d50520446ccd44ca89bbbf4ff7a4725570e)
2023-08-17 19:38:42 -07:00
Oli Scherer
5905d9cdba Permit pre-evaluated constants in simd_shuffle
(cherry picked from commit 9e5a67e57f715ec5eda915db1261cdf4c4a04642)
2023-08-17 19:38:42 -07:00
Josh Triplett
155a8fb983 Partially revert #107200
`Ok(0)` is indeed something the caller may interpret as an error, but
that's the *correct* thing to return if the writer can't accept any more
bytes.

(cherry picked from commit 5210f482d7309004c0ff3f6306f052f8d5adb67b)
2023-08-17 19:38:22 -07:00
Josh Stone
c102d110d9 Upgrade std to gimli 0.28.0 2023-08-17 19:36:50 -07:00
bors
8c6029574c Auto merge of #114937 - flip1995:clippy_beta_backport, r=Mark-Simulacrum
[beta] Clippy backports for ICE fixes

This backports PRs to beta, that fix ICEs, some lint grouping and FP fixes. Namely:

- https://github.com/rust-lang/rust-clippy/pull/11191
- https://github.com/rust-lang/rust-clippy/pull/11172
- https://github.com/rust-lang/rust-clippy/pull/11130
- https://github.com/rust-lang/rust-clippy/pull/11106
- https://github.com/rust-lang/rust-clippy/pull/11104
- https://github.com/rust-lang/rust-clippy/pull/11077
- https://github.com/rust-lang/rust-clippy/pull/11070 (This PR is not synced to the Rust repo yet, but I will open a separate PR to get it into `master`, before beta is branched: https://github.com/rust-lang/rust/pull/114938)
- https://github.com/rust-lang/rust-clippy/pull/11069

Kind of a big backport, but most of it is tests.

r? `@Mark-Simulacrum`

cc `@Manishearth`
2023-08-17 19:46:01 +00:00
bors
48fca125b8
Auto merge of #11069 - y21:issue11063, r=Alexendoo
[`missing_fields_in_debug`]: make sure self type is an adt

Fixes #11063, another ICE that can only happen in core.

This lint needs the `DefId` of the implementor to get its fields, but that ICEs if the implementor does not have a `DefId` (as is the case with primitive types, e.g. `impl Debug for bool`), which is where this ICE comes from.

This PR changes the check I added in #10897 to be more... robust against `Debug` implementations we don't want to lint.
Instead of just checking if the self type is a type parameter and "special casing" one specific case we don't want to lint, we should probably rather just check that the self type is either a struct, an enum or a union and only then continue.
That prevents weird edge cases like this one that can only happen in core.

Again, I don't know if it's even possible to add a test case for this since one cannot implement `Debug` for primitive types outside of the crate that defined `Debug` (core).
I did make sure that this PR no longer ICEs on `impl<T> Debug for T` and `impl Debug for bool`.
Maybe writing such a test is possible with `#![no_core]` and then re-defining the `Debug` trait or something like that...?

changelog: [`missing_fields_in_debug`]: make sure self type is an adt (fixes an ICE in core)

r? `@Alexendoo` (reviewed the last PRs for this lint)
2023-08-17 17:50:37 +02:00
bors
2562f8466c
Auto merge of #11070 - y21:issue11065, r=flip1995
[`useless_conversion`]: only lint on paths to fn items and fix FP in macro

Fixes #11065 (which is actually two issues: an ICE and a false positive)

It now makes sure that the function call path points to a function-like item (and not e.g. a `const` like in the linked issue), so that calling `TyCtxt::fn_sig` later in the lint does not ICE (fixes https://github.com/rust-lang/rust-clippy/issues/11065#issuecomment-1616836099).
It *also* makes sure that the expression is not part of a macro call (fixes https://github.com/rust-lang/rust-clippy/issues/11065#issuecomment-1616919639). ~~I'm not sure if there's a better way to check this other than to walk the parent expr chain and see if any of them are expansions.~~ (edit: it doesn't do this anymore)

changelog: [`useless_conversion`]: fix ICE when call receiver is a non-fn item
changelog: [`useless_conversion`]: don't lint if argument is a macro argument (fixes a FP)

r? `@llogiq` (reviewed #10814, which introduced these issues)
2023-08-17 17:50:37 +02:00
bors
3a86898bc5
Auto merge of #11106 - syvb:literal_unwrap_ice, r=dswij
[`unnecessary_literal_unwrap`]: Fix ICE on None.unwrap_or_default()

Fixes #11099
Fixes #11064

I'm running into #11099 (cc `@y21)` on my Rust codebase. Clippy ICEs on this code when evaluating the `unnecessary_literal_unwrap` lint:
```rust
fn main() {
    let val1: u8 = None.unwrap_or_default();
}
```

This fixes that ICE and adds an message specifically for that case:

```
error: used `unwrap_or_default()` on `None` value
  --> $DIR/unnecessary_literal_unwrap.rs:26:5
   |
LL |     None::<String>.unwrap_or_default();
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove the `None` and `unwrap_or_default()`: `String::default()`
```

This PR also fixes the same ICE with `None.unwrap_or_else` (by giving the generic error message for the lint in that case).

changelog: Fix ICE in `unnecessary_literal_unwrap` on `None.unwrap_or_default()`
2023-08-17 17:50:36 +02:00
bors
e8d5b1e66e
Auto merge of #11130 - smoelius:fix-10535, r=Jarcho
Fix ICE in #10535

Fixes #10535

r? `@Jarcho`

changelog: Eliminate ICE described in #10535
2023-08-17 17:15:49 +02:00
bors
c879eb5928
Auto merge of #11191 - Alexendoo:redundant-type-annotations-ice, r=llogiq
redundant_type_annotations: only pass certain def kinds to type_of

Fixes #11190
Fixes rust-lang/rust#113516

Also adds an `is_lint_allowed` check to skip the lint when it's not needed

changelog: none
2023-08-17 16:57:55 +02:00
bors
ced5a58fa0
Auto merge of #11104 - Alexendoo:arc-with-non-send-sync, r=Centri3
`arc_with_non_send_sync`: reword and move to `suspicious`

Fixes #11079

changelog: [`arc_with_non_send_sync`]: move to complexity
2023-08-17 16:52:50 +02:00
bors
1888037438
Auto merge of #11077 - y21:issue11076, r=Manishearth
[`arc_with_non_send_sync`]: don't lint if type has nested type parameters

Fixes #11076

changelog: [`arc_with_non_send_sync`]: don't lint if type has nested type parameters

r? `@Manishearth`
2023-08-17 16:52:14 +02:00
bors
214ab1197f
Auto merge of #11172 - Alexendoo:tuple-array-conversions-nursery, r=xFrednet
Move tuple_array_conversions to nursery

changelog: Move [`tuple_array_conversions`] to `nursery` (Now allow-by-default)
<!-- FIY: Ignore this change, if the commit gets backported and also https://github.com/rust-lang/rust-clippy/pull/11146 -->
[#11172](https://github.com/rust-lang/rust-clippy/pull/11172)

The nursery change got lost in #11146 and it ended up in pedantic, this puts it in nursery and gives something to backport

r? `@xFrednet`
2023-08-17 16:47:30 +02:00
bors
ab197f48b4 Auto merge of #114906 - weihanglo:update-beta-cargo, r=weihanglo
[beta-1.72.0] backport cargo

1 commits in 44b6be4bdf2cd7d3f4d4cb266bfe428dfc2a7952..103a7ff2ee7678d34f34d778614c5eb2525ae9de
2023-08-03 13:43:58 +0000 to 2023-08-15 23:32:44 +0000
- [beta-1.72.0] bump cargo-util to 0.2.5 (rust-lang/cargo#12505)

r? ghost
2023-08-17 02:55:10 +00:00
Weihang Lo
7acad66119
[beta] Update cargo 2023-08-16 19:19:40 +01:00
bors
598a0a3cb3 Auto merge of #114726 - DianQK:beta, r=cuviper
[beta] Update LLVM to resolve a miscompilation found in 114312.

Related issue: #114312 .

After the master updates the LLVM, we will add the same test cases. In the meantime, close the issue.
2023-08-12 05:38:25 +00:00
DianQK
e241551f8b
[beta-1.72] Update LLVM to resolve a miscompilation found in 114312. 2023-08-12 12:19:45 +08:00
DianQK
81e1247e8b
[beta-1.72] Pre-commit test for issue 114312.
We show this miscompilation in this commit.
2023-08-12 12:19:20 +08:00
bors
d1fa3e4de3 Auto merge of #114748 - cuviper:beta-next, r=cuviper
[beta] backport

* Restrict linker version script of proc-macro crates to just its two symbols #114470
* bootstrap: config: fix version comparison bug #114440
* lint/ctypes: only try normalize #113921
* Avoid tls access while iterating through mpsc thread entries #113861
* Substitute types before checking inlining compatibility. #113802
* Revert "fix: bug etc/bash_complettion -> src/etc/... to avoid copy error" #113579
* lint/ctypes: fix () return type checks #113457
* Rename and allow cast_ref_to_mut lint #113422
* Ignore flaky clippy tests. #113621

r? cuviper
2023-08-12 03:05:01 +00:00
Eric Huss
4d0501412a Ignore flaky clippy tests.
(cherry picked from commit fb5efd7008c698a821e9c50c3f3a04d48abd8295)
2023-08-11 19:17:23 -07:00
Felix S. Klock II
bc3491f99e fix proc-macro test added here to solely be exercised as a build product for the host.
thus we should no longer see test failures for e.g. wasm32 target.

(cherry picked from commit a2a7f27fd2548874b203f1f577f64cf61627e0a5)
2023-08-11 18:52:37 -07:00
Felix S. Klock II
a94c607997 Review feedback: return empty iff !should_codegen, and use simpler unconditional logic otherwise.
(cherry picked from commit a2058ddbed82adda55ce39f0e0915996706cb2b9)
2023-08-11 18:52:37 -07:00
Felix S Klock II
fecb6b277c Update tests/ui/proc-macro/no-mangle-in-proc-macro-issue-111888.rs
fix to test as proposed by wesleywiser

Co-authored-by: Wesley Wiser <wwiser@gmail.com>
(cherry picked from commit 5881e5f88d9245ef9259ca600b32af80d5972a7f)
2023-08-11 18:52:37 -07:00
Felix S. Klock II
6afdab5c68 regression test for issue 111888.
(cherry picked from commit 7a0e2ee133dacf4e2dbda64a316a95746a469c58)
2023-08-11 18:52:37 -07:00
Felix S. Klock II
8f4613ea77 special-case proc-macro crates in rustc_codegen_ssa:🔙:linker::exported_symbols to only export the two symbols that proc-macros need.
(cherry picked from commit 3000c24afc37fe09c65772a71331002a7505dc11)
2023-08-11 18:52:37 -07:00
Ariadne Conill
a3d2871102 bootstrap: config: fix version comparison bug
Rust requires a previous version of Rust to build, such as the current version, or the
previous version.  However, the version comparison logic did not take patch releases
into consideration when doing the version comparison for the current branch, e.g.
Rust 1.71.1 could not be built by Rust 1.71.0 because it is neither an exact version
match, or the previous version.

Adjust the version comparison logic to tolerate mismatches in the patch version.

Signed-off-by: Ariadne Conill <ariadne@dereferenced.org>
(cherry picked from commit 31a81a08786826cc6e832bd0b49fb8b934e29648)
2023-08-11 18:52:16 -07:00
David Wood
0426c1f1d5 lint/ctypes: only try normalize
Now that this lint runs on any external-ABI fn-ptr, normalization won't
always succeed, so use `try_normalize_erasing_regions` instead.

Signed-off-by: David Wood <david@davidtw.co>
(cherry picked from commit 09434a2575cee12b241c516ad91f21d4b4f9c3fd)
2023-08-11 18:51:55 -07:00
Ibraheem Ahmed
fc3ed7c298 avoid tls access while iterating through mpsc thread entries
(cherry picked from commit fb31a1ac21833b205196128b7425f5c587cd883c)
2023-08-11 18:49:41 -07:00
Camille GILLOT
33322e06da Substitute types before checking compatibility.
(cherry picked from commit 45ffe41d144e3e5bc8993abcbcdd54d870a2ff53)
2023-08-11 18:48:56 -07:00
ekusiadadus
64b4a54227 Revert "fix: 🐛 etc/bash_complettion -> src/etc/... to avoid copy error"
This reverts commit 08ce68b6a6bad360e9c3611ad60cf6598401f878.

(cherry picked from commit 05bc71cfaf9eb35caab425126d4fa8dcb8c62072)
2023-08-11 18:48:09 -07:00
David Wood
91e377c286 lint/ctypes: allow () within types
Consider `()` within types to be FFI-safe, and `()` to be FFI-safe as a
return type (incl. when in a transparent newtype).

Signed-off-by: David Wood <david@davidtw.co>
(cherry picked from commit 24f90fdd2654e9c5437a684d3a72a4e70826a985)
2023-08-11 18:47:47 -07:00
David Wood
e9cd650331 lint: refactor check_variant_for_ffi
Simplify this function a bit, it was quite hard to reason about.

Signed-off-by: David Wood <david@davidtw.co>
(cherry picked from commit 99b1897cf640d5f6dac74416761c9b3c75e1ef7a)
2023-08-11 18:46:58 -07:00
David Wood
7744a86963 lint/ctypes: stricter () return type checks
`()` is normally FFI-unsafe, but is FFI-safe when used as a return type.
It is also desirable that a transparent newtype for `()` is FFI-safe when
used as a return type.

In order to support this, when an type was deemed FFI-unsafe, because of
a `()` type, and was used in return type - then the type was considered
FFI-safe. However, this was the wrong approach - it didn't check that the
`()` was part of a transparent newtype! The consequence of this is that
the presence of a `()` type in a more complex return type would make it
the entire type be considered safe (as long as the `()` type was the
first that the lint found) - which is obviously incorrect.

Instead, this logic is removed, and a unit return type or a transparent
wrapper around a unit is checked for directly for functions and fn-ptrs.

Signed-off-by: David Wood <david@davidtw.co>
(cherry picked from commit f53cef31f5ea41c9a5ab8e5335637a6873b9f0b5)
2023-08-11 18:41:21 -07:00