Commit Graph

213332 Commits

Author SHA1 Message Date
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
Michael Goulet
20052c83c0 Suggest associated const on capitalization error 2022-12-22 03:07:18 +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
kadmin
8a4cbf4f7b Fix ICE
Left a todo awhile ago (I think), so fill it in to print a const for `Term`s.
2022-12-22 01:24:43 +00:00
Michael Howell
2b661c33de rustdoc: simplify CSS and DOM for more-scraped-examples
This gets rid of the more-scraped-examples-inner wrapper, instead nesting the
children directly and using absolute positioning for the toggle line.
2022-12-21 18:03:31 -07:00
Jakob Degen
0229281d03 Don't run Drop terminators on types that do not have drop glue in const eval 2022-12-21 16:15:56 -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
Jakob Degen
37e00165e4 Bless tests 2022-12-21 14:59:55 -08:00
Jakob Degen
c359ab0b5d Retag argument to drop_in_place unconditionally 2022-12-21 14:59:55 -08:00
Jakob Degen
102040ce76 Retag as FnEntry on drop_in_place 2022-12-21 14:59:55 -08:00
Michael Howell
5dfa6a8922 rustdoc: simplify link anchor to section expand JS 2022-12-21 13:28:42 -07: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
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
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
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