Commit Graph

213344 Commits

Author SHA1 Message Date
Michael Goulet
978dd2e3b8 Rename things to be a bit clearer 2022-12-21 06:06:46 +00:00
Michael Goulet
0c09e2bf5a Substitute things correctly 2022-12-21 06:06:46 +00:00
Michael Goulet
c8ebff6aee Remove some unnecessary try_map_bound 2022-12-21 06:06:46 +00:00
Michael Goulet
2f5334dff2 forgot a return in drop tracking handle_uninhabited_return 2022-12-21 05:03:11 +00:00
Bryan Garza
9650a4168f Improve code based on feedback.
This patch improves the readability of some of the code by using
if-let-chains. Also, make use of the `add_feature_diagnostics` function.
2022-12-21 03:47:27 +00:00
Bryan Garza
f702e89f9d Add lint doc comment 2022-12-21 03:39:39 +00:00
Bryan Garza
2d060034f0 Update track_caller logic/lint after rebase 2022-12-21 03:39:33 +00:00
Bryan Garza
e28a07a0a1 update wording of lint 2022-12-21 03:30:46 +00:00
Bryan Garza
dc2c4ce578 Update code based on PR comments
This patch does the following:
- Refactor some repeated lines into a single one
- Split the `ungated_async_fn_caller` lint into multiple lines, and make
  one of those lines only print out on nightly
- Use test revisions instead of copying an existing test
2022-12-21 03:30:37 +00:00
Bryan Garza
04926e0534 Switch #[track_caller] back to a no-op unless feature gate is enabled
This patch fixes a regression, in which `#[track_caller]`, which was
previously a no-op, was changed to actually turn on the behavior. This
should instead only happen behind the `closure_track_caller` feature
gate.

Also, add a warning for the user to understand how their code will
compile depending on the feature gate being turned on or not.

Fixes #104588
2022-12-21 03:23:08 +00:00
Geoffry Song
f5e776c3f7
Refer to "Waker" rather than "RawWaker" in drop comment 2022-12-20 14:51:24 -08:00
Matthias Krüger
ae90226896
Rollup merge of #105976 - jyn514:unused-make-targets, r=Mark-Simulacrum
Remove unused `check-stage2-T-arm-linux-androideabi-H-x86_64-unknown-linux-gnu` make rule

It's not used anywhere in CI, and it seems of questionable use. It was first added in 0e272de69f, which looks like it's just intended for CI, not as a user-facing feature.
2022-12-20 23:35:17 +01:00
Matthias Krüger
b68e994503
Rollup merge of #105973 - oli-obk:simplify_callee_checks, r=jackh726
Avoid going through the happy path in case of non-fn builtin calls

No functional change, just doing an early return. The removed comment is not applicable anymore, not every node needs type bindings in the error case. At best this would have been needed to avoid ICEs, but afaict this can't happen anymore today, as we do fallible checks.
2022-12-20 23:35:17 +01:00
Matthias Krüger
b9edcfa055
Rollup merge of #105972 - notriddle:notriddle/anchor, r=GuillaumeGomez
rustdoc: simplify section anchor CSS

Since f50bf8636e changed anchors to be always positioned absolute, specifying it on hover as well is redundant.
2022-12-20 23:35:16 +01:00
Matthias Krüger
50cfffa7a2
Rollup merge of #105964 - notriddle:notriddle/scraped-example-length, r=GuillaumeGomez
rustdoc: prevent CSS layout of line numbers shrinking into nothing

Before:

![image](https://user-images.githubusercontent.com/1593513/208730117-039442b4-01ee-4eee-8001-26429f9d54c3.png)

After:

![image](https://user-images.githubusercontent.com/1593513/208730167-ab2f95a9-1eea-48f9-a9c9-3a69d9db484a.png)
2022-12-20 23:35:16 +01:00
Matthias Krüger
a039b2218c
Rollup merge of #105949 - ChrisDenton:bump-cfg-if, r=Nilstrieb
Bump `cfg-if` to `1.0` in rustc crates

When `packed_simd_2` and `getrandom` are updated to newer versions, we will no longer have a dependency on old `cfg_if` versions.
2022-12-20 23:35:16 +01:00
Matthias Krüger
2ddfa8fd3b
Rollup merge of #105904 - MarcusCalhoun-Lopez:darwin_arch_i386, r=bjorn3
Fix arch flag on i686-apple-darwin

i686-apple-darwin should use `-arch i386` instead of `-arch i686`
2022-12-20 23:35:15 +01:00
Matthias Krüger
a4ef47d6b3
Rollup merge of #105897 - oli-obk:tait_patterns, r=TaKO8Ki
Fix an opaque type ICE

fixes #104551

The issue is that if you have

```rust
type T = impl Sized;
let (_a, _b): T = ..
```

we have only the type annotation `T`, but want to use that ascription for `_a` and `_b`, so what we generate is a type ascription plus a field projection saying `_a`'s type is `T::0`. Of course `T` has no fields. Of course we could also not generate type annotations for projections into opaque types at all, but that's more fragile, as we now have to make sure that 12bbdbdb44/compiler/rustc_mir_build/src/build/matches/mod.rs (L709) doesn't have any arm that introduces a user type annotation except for `PatKind::Binding`.
2022-12-20 23:35:15 +01:00
Matthias Krüger
4726e514d7
Rollup merge of #105791 - Ezrashaw:add-e0472-long-docs, r=GuillaumeGomez
docs: add long error explanation for error E0472

Add long-form error docs for E0472: "inline assembly not supported on this target" and update UI tests.

R? `@GuillaumeGomez`
2022-12-20 23:35:14 +01:00
Joshua Nelson
fb89ae4092 Remove unused check-stage2-T-arm-linux-androideabi-H-x86_64-unknown-linux-gnu
It's not used anywhere in CI, and it seems of questionable use.
It was first added in 0e272de69f, which looks like it's just intended for CI, not as a user-facing feature.
2022-12-20 15:42:38 -06:00
Jeremy Stucki
2c9d9bf381
Add missing anonymous lifetime 2022-12-20 22:34:42 +01:00
Jeremy Stucki
42d100aad0
Add missing anonymous lifetime 2022-12-20 22:28:22 +01:00
Jeremy Stucki
3dde32ca97
rustc: Remove needless lifetimes 2022-12-20 22:10:40 +01:00
Miguel Ojeda
a65ec44779 Add -Zno-jump-tables
This flag mimics GCC/Clang's `-fno-jump-tables` [1][2], which makes
the codegen backend avoid generating jump tables when lowering switches.

In the case of LLVM, the `"no-jump-tables"="true"` function attribute is
added to every function.

The kernel currently needs it for x86 when enabling IBT [3], as well
as for Alpha (plus VDSO objects in MIPS/LoongArch).

[1] https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#index-fno-jump-tables
[2] https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fjump-tables
[3] https://github.com/torvalds/linux/blob/v6.1/arch/x86/Makefile#L75-L83

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2022-12-20 21:42:54 +01:00
bors
1d12c3cea3 Auto merge of #105127 - Sp00ph:const_new, r=dtolnay
Make `VecDeque::new` const

(See #105072)
2022-12-20 20:25:42 +00:00
Arvind Mukund
5480ac540c Use Error behavior for LLVM versions prior to 15
CI fails when building with LLVM-13. This raises unknown behavior
constant `8` from IRVerifier.
2022-12-20 11:47:11 -08:00
Michael Howell
b29a9e3b3f rustdoc: simplify section anchor CSS
Since f50bf8636e changed anchors to be
always positioned absolute, specifying it on hover as well is redundant.
2022-12-20 12:44:22 -07:00
Oli Scherer
1c5b53be1c Avoid going through the happy path in case of non-fn builtin calls 2022-12-20 18:59:52 +00:00
Michael Goulet
738b0c0673 Re-enable fn trait call notation error 2022-12-20 18:31:13 +00:00
Michael Howell
168e3da812 rustdoc: prevent CSS layout of line numbers shrinking into nothing 2022-12-20 10:32:35 -07:00
bors
d6da428f34 Auto merge of #105381 - uweigand:s390x-ffi-vaarg, r=nikic
Implement va_list and va_arg for s390x FFI

Following the s390x ELF ABI and based on the clang implementation, provide appropriate definitions of va_list in library/core/src/ffi/mod.rs and va_arg handling in compiler/rustc_codegen_llvm/src/va_arg.rs.

Fixes the following test cases on s390x:
src/test/run-make-fulldeps/c-link-to-rust-va-list-fn src/test/ui/abi/variadic-ffi.rs

Fixes https://github.com/rust-lang/rust/issues/84628.
2022-12-20 17:09:11 +00:00
Chris Denton
531f3c9ee5
Bump packed_simd_2 and getrandom v0.2
Remove old versions of `cfg-if` by bumping `packed_simd_2` and `getrandom v0.2` versions

```console
> cargo update --package packed_simd_2 --package getrandom@0.2.0
    Updating crates.io index
    Removing cfg-if v0.1.10
    Updating getrandom v0.2.0 -> v0.2.8
    Updating packed_simd_2 v0.3.4 -> v0.3.8
```

`packed_simd_2` is only used as a dependency `bytecount`. The bigger jump is `getrandom@0.2.0`, but it's still semver compatible and there doesn't seem to be any worrying changes (see the [changelog](https://github.com/rust-random/getrandom/blob/master/CHANGELOG.md)). Note that this doesn't affect `getrandom@0.1.16`, which is already using the latest version of `cfg-if` (besides, there are already plans to remove that entirely).
2022-12-20 15:28:19 +00:00
Oli Scherer
ed61be60da Some ICE debugging aids 2022-12-20 15:01:37 +00:00
Oli Scherer
fedcc739c6 tracing: make flag checking less noisy 2022-12-20 15:01:37 +00:00
Oli Scherer
b2b859be8c Some track_caller additions 2022-12-20 15:01:37 +00:00
Oli Scherer
b0ed631ad4 Some hir cleanups 2022-12-20 15:01:37 +00:00
Oli Scherer
c787de3bbd Fix some ~const usage in libcore 2022-12-20 15:01:37 +00:00
Oli Scherer
872a6da935 Remove an unused function 2022-12-20 15:00:32 +00:00
Oli Scherer
f1ef038ae4 use track_caller to show where the panic is actually from 2022-12-20 14:13:29 +00:00
bors
65bd2a6a73 Auto merge of #105951 - matthiaskrgr:rollup-aqxz888, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #105835 (Refactor post borrowck cleanup passes)
 - #105930 (Disable `NormalizeArrayLen`)
 - #105938 (Update coerce_unsized tracking issue from #27732 to #18598)
 - #105939 (Improve description of struct-fields GUI test)
 - #105943 (Add regression test for #102206)
 - #105944 (Add regression test for #80816)
 - #105945 (Add regression test for #57404)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-12-20 13:58:08 +00:00
Oli Scherer
c9588d5bf8 Hackily fix an opaque type ICE 2022-12-20 13:43:41 +00:00
Oli Scherer
e405dabf7d Some style nits 2022-12-20 13:43:11 +00:00
Oli Scherer
8b1530260c Replace a find with a loop to simplify the logic. 2022-12-20 13:42:41 +00:00
Oli Scherer
562d846ff0 Make it easier to debug where a region error was created 2022-12-20 13:42:07 +00:00
Oli Scherer
8b5a96ec45 Some tracing cleanups 2022-12-20 13:39:48 +00:00
Matthias Krüger
8db5dd4983
Rollup merge of #105945 - JohnTitor:issue-57404, r=compiler-errors
Add regression test for #57404

r? `@compiler-errors`
Closes https://github.com/rust-lang/rust/issues/57404

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-20 14:37:35 +01:00
Matthias Krüger
b149315fda
Rollup merge of #105944 - JohnTitor:issue-80816, r=compiler-errors
Add regression test for #80816

Closes #80816
r? `@compiler-errors`
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-20 14:37:34 +01:00
Matthias Krüger
d6fbe79850
Rollup merge of #105943 - JohnTitor:issue-102206, r=compiler-errors
Add regression test for #102206

Closes #102206
r? `@compiler-errors`
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-20 14:37:34 +01:00
Matthias Krüger
191a877c88
Rollup merge of #105939 - GuillaumeGomez:improve-description-gui-test, r=Dylan-DPC
Improve description of struct-fields GUI test

I moved the comment at the top of the file and clarified it a little bit.

r? `@notriddle`
2022-12-20 14:37:33 +01:00
Matthias Krüger
ced6f38c99
Rollup merge of #105938 - andersk:coerce_unsized-tracking, r=Dylan-DPC
Update coerce_unsized tracking issue from #27732 to #18598

Issue #27732 was closed as a duplicate of #18598.
2022-12-20 14:37:33 +01:00