Commit Graph

213206 Commits

Author SHA1 Message Date
Matthias Krüger
2cace6aa5d
Rollup merge of #105769 - lyming2007:issue-105177-fix, r=eholk
add function to tell the identical errors for ambiguity_errors

if 2 errors of the kind and ident and span of the ident, b1, b2 and misc1 misc2 are the same we call these 2 ambiguity errors identical
prevent identical ambiguity error from pushing into vector of ambiguity_errors this will fix #105177
2022-12-22 11:03:50 +01:00
Matthias Krüger
0adf9e046b
Rollup merge of #104741 - bryangarza:bug-104588-async-track-caller, r=compiler-errors
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-22 11:03:49 +01:00
bors
75f4ee8b44 Auto merge of #106025 - matthiaskrgr:rollup-vz5rqah, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #105837 (Don't ICE in `check_must_not_suspend_ty` for mismatched tuple arity)
 - #105932 (Correct branch-protection ModFlagBehavior for Aarch64 on LLVM-15)
 - #105960 (Various cleanups)
 - #105985 (Method chain nitpicks)
 - #105996 (Test that async blocks are `UnwindSafe`)
 - #106012 (Clarify that raw retags are not permitted in Mir)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-12-22 05:30:00 +00:00
bors
8574880108 Auto merge of #106023 - JohnTitor:rollup-k8mettz, r=JohnTitor
Rollup of 8 pull requests

Successful merges:

 - #105584 (add assert messages if chunks/windows are length 0)
 - #105602 (interpret: add read_machine_[ui]size convenience methods)
 - #105824 (str.lines() docstring: clarify that line endings are not returned)
 - #105980 (Refer to "Waker" rather than "RawWaker" in `drop` comment)
 - #105986 (Fix typo in reading_half_a_pointer.rs)
 - #105995 (Add regression test for #96530)
 - #106008 (Sort lint_groups in no_lint_suggestion)
 - #106014 (Add comment explaining what the scrape-examples-toggle.goml GUI test is about)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-12-22 02:16:59 +00:00
Eric Holk
f20f86ec4e
Change comment to doc comment 2022-12-21 17:28:42 -08:00
Matthias Krüger
d0d0ccdca2
Rollup merge of #106012 - JakobDegen:retag-raw, r=RalfJung
Clarify that raw retags are not permitted in Mir

Not sure when this changed, but documentation and the validator needed to be updated. This also removes raw retags from custom mir.

cc rust-lang/miri#2735

r? `@RalfJung`
2022-12-22 01:01:15 +01:00
Matthias Krüger
f340e68907
Rollup merge of #105996 - Swatinem:async-is-unwindsafe, r=petrochenkov
Test that async blocks are `UnwindSafe`

This was a regression from the reverted #105250 which is now covered by a test.
2022-12-22 01:01:14 +01:00
Matthias Krüger
66544b57f4
Rollup merge of #105985 - compiler-errors:method-chain-nitpicks, r=estebank
Method chain nitpicks

Just fixing some little things I didn't see in review from that method chain PR.

r? `@estebank`
2022-12-22 01:01:14 +01:00
Matthias Krüger
ec7eb5b5ad
Rollup merge of #105960 - oli-obk:effect_cleanup, r=fee1-dead
Various cleanups

This PR pulls changes out of https://github.com/rust-lang/rust/pull/101900 that can land on master immediately

r? ``@fee1-dead``
2022-12-22 01:01:13 +01:00
Matthias Krüger
924a1d4a7a
Rollup merge of #105932 - MasterAwesome:aarch64-bti-llvm-15, r=nikic
Correct branch-protection ModFlagBehavior for Aarch64 on LLVM-15

When building with Fat LTO and BTI enabled on aarch64, the BTI is set to `Module::Min` for alloc shim but is set to `Module::Error` for the crate. This was fine when we were using LLVM-14 but LLVM-15 changes it's behaviour to support for compiling with different `mbranch-protection` flags.

Refer:
b0343a38a5

fixes https://github.com/rust-lang/rust/issues/102162
2022-12-22 01:01:13 +01:00
Matthias Krüger
3eccc297d4
Rollup merge of #105837 - compiler-errors:issue-105728, r=estebank
Don't ICE in `check_must_not_suspend_ty` for mismatched tuple arity

These expressions are just used for their spans, so make it best-effort here.

Fixes #105728
2022-12-22 01:01:12 +01:00
Yuki Okushi
4d50fa6989
Rollup merge of #106014 - GuillaumeGomez:add-gui-explanations-scrape-examples-toggle, r=notriddle
Add comment explaining what the scrape-examples-toggle.goml GUI test is about

r? `@notriddle`
2022-12-22 08:32:13 +09:00
Yuki Okushi
4c2dd75af3
Rollup merge of #106008 - uweigand:s390x-lintgroup-order, r=Nilstrieb
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 doing so, prefer non- deprecated lint group names over deprecated ones, and then use alphabetical order.

Fixes https://github.com/rust-lang/rust/issues/105379
2022-12-22 08:32:12 +09:00
Yuki Okushi
6c0dedb445
Rollup merge of #105995 - JohnTitor:issue-96530, r=compiler-errors
Add regression test for #96530

Closes #96530
r? `@compiler-errors`

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-22 08:32:12 +09:00
Yuki Okushi
5689a7b372
Rollup merge of #105986 - eltociear:patch-18, r=RalfJung
Fix typo in reading_half_a_pointer.rs

gurantee -> guarantee
2022-12-22 08:32:11 +09:00
Yuki Okushi
03a763c5c8
Rollup merge of #105980 - goffrie:waker-drop, r=thomcc
Refer to "Waker" rather than "RawWaker" in `drop` comment

In my view this is technically more correct as `Waker` actually implements `Drop` (which calls the `drop` method) whereas `RawWaker` does not.
2022-12-22 08:32:11 +09:00
Yuki Okushi
257edf2de5
Rollup merge of #105824 - zacchiro:patch-1, r=JohnTitor
str.lines() docstring: clarify that line endings are not returned

Previously, the str.lines() docstring stated that lines are split at line endings, but not whether those were returned or not.  This new version of the docstring states this explicitly, avoiding the need of getting to doctests to get an answer to this FAQ.
2022-12-22 08:32:10 +09:00
Yuki Okushi
4f29ca386f
Rollup merge of #105602 - RalfJung:read-convenience, r=oli-obk
interpret: add read_machine_[ui]size convenience methods

We have `read_pointer`, so it felt inconsistent to not also have these.

r? ```@oli-obk```
2022-12-22 08:32:10 +09:00
Yuki Okushi
342d1b7f01
Rollup merge of #105584 - raffimolero:patch-1, r=JohnTitor
add assert messages if chunks/windows are length 0
2022-12-22 08:32:09 +09:00
Bryan Garza
ccbba0a60e Update track_caller tests; run fmt 2022-12-21 23:25:08 +00:00
bors
bdbe392a13 Auto merge of #105613 - Nilstrieb:rename-assert_uninit_valid, r=RalfJung
Rename `assert_uninit_valid` intrinsic

It's not about "uninit" anymore but about "filling with 0x01 bytes" so the name should at least try to reflect that.

This is actually not fully correct though, as it does still panic for all uninit with `-Zstrict-init-checks`. I'm not sure what the best way is to deal with that not causing confusion. I guess we could just remove the flag? I don't think having it makes a lot of sense anymore with the direction that we have chose to go. It could be relevant again if #100423 lands so removing it may be a bit over eager.

r? `@RalfJung`
2022-12-21 23:20:04 +00:00
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
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
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
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
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