Commit Graph

213352 Commits

Author SHA1 Message Date
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
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