Commit Graph

213452 Commits

Author SHA1 Message Date
bors
b569c9dc57 Auto merge of #105979 - matthiaskrgr:rollup-2luw3mx, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #105791 (docs: add long error explanation for error E0472)
 - #105897 (Fix an opaque type ICE)
 - #105904 (Fix arch flag on i686-apple-darwin)
 - #105949 (Bump `cfg-if` to `1.0` in rustc crates)
 - #105964 (rustdoc: prevent CSS layout of line numbers shrinking into nothing)
 - #105972 (rustdoc: simplify section anchor CSS)
 - #105973 (Avoid going through the happy path in case of non-fn builtin calls)
 - #105976 (Remove unused `check-stage2-T-arm-linux-androideabi-H-x86_64-unknown-linux-gnu` make rule)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-12-21 20:19:22 +00:00
Jakob Degen
7c4c620475 Forbid RetagKind::TwoPhase as well 2022-12-21 11:46:13 -08:00
Guillaume Gomez
34a4e5cc12 Add comment explaining what the scrape-examples-toggle.goml GUI test is about 2022-12-21 20:21:31 +01:00
Jakob Degen
cb2c7bb833 Clarify that raw retags are not permitted in Mir 2022-12-21 10:32:01 -08:00
Ulrich Weigand
30fbfd5f05 Sort lint_groups in no_lint_suggestion
The no_lint_suggestion routine passes a vector of lint group names
to find_best_match_for_name.  That routine depends on the sort
order of its input vector, which matters in case multiple inputs
are at the same Levenshtein distance to the target name.

However, no_lint_suggestion currently just passes lint_groups.keys()
as input vector - this is sorted in hash value order, which is not
guaranteed to be stable, and in fact differs between big- and
little-endian host platforms, causing test failures on s390x.

To fix this, always sort the lint groups before using their names
as input to find_best_match_for_name.  In addition, deprecated
lint groups should never be suggested, so filter those out.

Fixes https://github.com/rust-lang/rust/issues/105379
2022-12-21 19:16:41 +01:00
Oli Scherer
a9af75cdbc Give opaque types a better coherence error 2022-12-21 17:44:30 +00:00
bors
a8207df49e Auto merge of #105812 - ojeda:no-jump-tables, r=nikic
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
2022-12-21 17:38:38 +00:00
bors
5b64c91c26 Auto merge of #2736 - RalfJung:josh, r=oli-obk
update josh instructions

Fixes https://github.com/rust-lang/miri/issues/2730

r\? `@oli-obk`
2022-12-21 16:59:31 +00:00
Ralf Jung
90d8fc6240 update josh onstructions 2022-12-21 17:54:10 +01:00
Krasimir Georgiev
9c9fa567f8 codegen tests: adapt patterns to also work with v0 symbol mangling
No functional changes intended.

These tests were failing under `new-symbol-mangling = true`.
This adapts the patterns to work in this case.
2022-12-21 16:37:03 +00:00
bors
49143814e1 Auto merge of #100390 - jhpratt:float-from-bool, r=dtolnay
Implement `From<bool>` for f32, f64

As is required for trait implementations, these are insta-stable. Given there is a release tomorrow and this needs FCP, I set 1.65 as the stable version.

`@rustbot` label +A-floating-point +C-feature-request +needs-fcp +relnotes +S-waiting-on-review +T-libs-api -T-libs
2022-12-21 14:27:57 +00:00
Arpad Borsos
b60281f472
Test that async blocks are UnwindSafe
This was a regression from the reverted #105250 which is now covered by a test.
2022-12-21 13:41:28 +01:00
Yuki Okushi
32a31d8aca
Add regression test for #96530
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-21 21:10:30 +09:00
Nikita Popov
1286d98278 Don't explicitly set C++ standard for lld
LLVM does this itself since 606cb8548a1b7763e0c8489c5efe66803a7ede72,
and 14 is no longer the correct standard when building lld 16,
causing build failures.
2022-12-21 12:56:40 +01:00
Ralf Jung
6f21ba4a06
less specific wording 2022-12-21 11:06:20 +01:00
Ikko Ashimine
5538c92837
Fix typo in reading_half_a_pointer.rs
gurantee -> guarantee
2022-12-21 15:34:21 +09:00
Michael Goulet
85a9d85435 Don't call typeck if we have no typeck results
This has a 10000000% chance of us causing a cycle if we're not careful
2022-12-21 06:06:47 +00:00
Michael Goulet
c6ef53477e CollectAllMismatches relation should respect int/float infer vars 2022-12-21 06:06:46 +00:00
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
Ben Kimock
749b2b077d Re-enable the VClock ordering tests 2022-12-20 22:54:44 -05:00
Ben Kimock
d2e1c3738e Fix span management 2022-12-20 22:48:23 -05: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