]> git.lizzy.rs Git - rust.git/log
rust.git
18 months agoabort immediately on bad mem::zeroed/uninit
Ralf Jung [Wed, 21 Dec 2022 12:49:48 +0000 (13:49 +0100)]
abort immediately on bad mem::zeroed/uninit

18 months agoAuto merge of #106034 - matthiaskrgr:rollup-2zpql33, r=matthiaskrgr
bors [Thu, 22 Dec 2022 11:06:51 +0000 (11:06 +0000)]
Auto merge of #106034 - matthiaskrgr:rollup-2zpql33, r=matthiaskrgr

Rollup of 8 pull requests

Successful merges:

 - #104741 (Switch `#[track_caller]` back to a no-op unless feature gate is enabled)
 - #105769 (add function to tell the identical errors for ambiguity_errors)
 - #105843 (Suggest associated const on possible capitalization mistake)
 - #105966 (Re-enable `Fn` trait call notation error for non-tuple argument)
 - #106002 (codegen tests: adapt patterns to also work with v0 symbol mangling)
 - #106010 (Give opaque types a better coherence error)
 - #106016 (rustdoc: simplify link anchor to section expand JS)
 - #106024 (Fix ICE due to `todo!()` in `rustdoc` for `Term`s)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

18 months agoRollup merge of #106024 - JulianKnodt:add_term_html_docs, r=notriddle
Matthias Krüger [Thu, 22 Dec 2022 10:03:53 +0000 (11:03 +0100)]
Rollup merge of #106024 - JulianKnodt:add_term_html_docs, r=notriddle

Fix ICE due to `todo!()` in `rustdoc` for `Term`s

Left a todo awhile ago (I think), so fill it in to print a const for `Term`s.

Fixes #105952.

Should I add some annotations to the rustdoc test?

18 months agoRollup merge of #106016 - notriddle:notriddle/link-has-onclick, r=GuillaumeGomez
Matthias Krüger [Thu, 22 Dec 2022 10:03:52 +0000 (11:03 +0100)]
Rollup merge of #106016 - notriddle:notriddle/link-has-onclick, r=GuillaumeGomez

rustdoc: simplify link anchor to section expand JS

18 months agoRollup merge of #106010 - oli-obk:tait_coherence_diagnostic, r=compiler-errors
Matthias Krüger [Thu, 22 Dec 2022 10:03:52 +0000 (11:03 +0100)]
Rollup merge of #106010 - oli-obk:tait_coherence_diagnostic, r=compiler-errors

Give opaque types a better coherence error

18 months agoRollup merge of #106002 - krasimirgg:v0sym, r=tmiasko
Matthias Krüger [Thu, 22 Dec 2022 10:03:51 +0000 (11:03 +0100)]
Rollup merge of #106002 - krasimirgg:v0sym, r=tmiasko

codegen tests: adapt patterns to also work with v0 symbol mangling

No functional changes intended.

These tests were failing under `new-symbol-mangling = true`, cf. https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/a.20few.20panic-abort.20tests.20fail.20under.20.60new-symbol-mangling.60.
This adapts the patterns to work in this case.

18 months agoRollup merge of #105966 - compiler-errors:issue-105936, r=eholk
Matthias Krüger [Thu, 22 Dec 2022 10:03:51 +0000 (11:03 +0100)]
Rollup merge of #105966 - compiler-errors:issue-105936, r=eholk

Re-enable `Fn` trait call notation error for non-tuple argument

I have no idea why I delayed this bug... but also there doesn't seem to be a UI test that actually shows a change, so maybe that's why.

Fixes #105936

18 months agoRollup merge of #105843 - compiler-errors:sugg-const, r=lcnr
Matthias Krüger [Thu, 22 Dec 2022 10:03:50 +0000 (11:03 +0100)]
Rollup merge of #105843 - compiler-errors:sugg-const, r=lcnr

Suggest associated const on possible capitalization mistake

Suggest `i32::MAX` if we typed `i32::max` without making a function call.

Fixes #93844

18 months agoRollup merge of #105769 - lyming2007:issue-105177-fix, r=eholk
Matthias Krüger [Thu, 22 Dec 2022 10:03:50 +0000 (11:03 +0100)]
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

18 months agoRollup merge of #104741 - bryangarza:bug-104588-async-track-caller, r=compiler-errors
Matthias Krüger [Thu, 22 Dec 2022 10:03:49 +0000 (11:03 +0100)]
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

18 months agoAuto merge of #104889 - GuillaumeGomez:fix-impl-block-in-const-expr, r=notriddle
bors [Thu, 22 Dec 2022 08:37:58 +0000 (08:37 +0000)]
Auto merge of #104889 - GuillaumeGomez:fix-impl-block-in-const-expr, r=notriddle

Fix impl block in const expr

Fixes #83026.

The problem was that we didn't visit block expressions. Considering how big the [walk_expr](https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_hir/intravisit.rs.html#678) function is, I decided to instead implement the `hir` visitor on the struct. It also answers the question which was in a comment for `RustdocVisitor`: we should have used a visitor instead of our ad-hoc implementation.

Adding this visitor also added some extra checks that weren't present before (check changes in `rustdoc-ui` tests).

r? `@notriddle`

18 months agoAuto merge of #106025 - matthiaskrgr:rollup-vz5rqah, r=matthiaskrgr
bors [Thu, 22 Dec 2022 05:30:00 +0000 (05:30 +0000)]
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

18 months agoSuggest associated const on capitalization error
Michael Goulet [Sat, 17 Dec 2022 20:11:29 +0000 (20:11 +0000)]
Suggest associated const on capitalization error

18 months agoAuto merge of #106023 - JohnTitor:rollup-k8mettz, r=JohnTitor
bors [Thu, 22 Dec 2022 02:16:59 +0000 (02:16 +0000)]
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

18 months agoChange comment to doc comment
Eric Holk [Thu, 22 Dec 2022 01:28:42 +0000 (17:28 -0800)]
Change comment to doc comment

18 months agoFix ICE
kadmin [Wed, 21 Dec 2022 23:54:29 +0000 (23:54 +0000)]
Fix ICE

Left a todo awhile ago (I think), so fill it in to print a const for `Term`s.

18 months agoRollup merge of #106012 - JakobDegen:retag-raw, r=RalfJung
Matthias Krüger [Thu, 22 Dec 2022 00:01:15 +0000 (01:01 +0100)]
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`

18 months agoRollup merge of #105996 - Swatinem:async-is-unwindsafe, r=petrochenkov
Matthias Krüger [Thu, 22 Dec 2022 00:01:14 +0000 (01:01 +0100)]
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.

18 months agoRollup merge of #105985 - compiler-errors:method-chain-nitpicks, r=estebank
Matthias Krüger [Thu, 22 Dec 2022 00:01:14 +0000 (01:01 +0100)]
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`

18 months agoRollup merge of #105960 - oli-obk:effect_cleanup, r=fee1-dead
Matthias Krüger [Thu, 22 Dec 2022 00:01:13 +0000 (01:01 +0100)]
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``

18 months agoRollup merge of #105932 - MasterAwesome:aarch64-bti-llvm-15, r=nikic
Matthias Krüger [Thu, 22 Dec 2022 00:01:13 +0000 (01:01 +0100)]
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:
https://github.com/rust-lang/llvm-project/commit/b0343a38a5910e980bb031e4014655d77cd0c162

fixes https://github.com/rust-lang/rust/issues/102162

18 months agoRollup merge of #105837 - compiler-errors:issue-105728, r=estebank
Matthias Krüger [Thu, 22 Dec 2022 00:01:12 +0000 (01:01 +0100)]
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

18 months agoRollup merge of #106014 - GuillaumeGomez:add-gui-explanations-scrape-examples-toggle...
Yuki Okushi [Wed, 21 Dec 2022 23:32:13 +0000 (08:32 +0900)]
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`

18 months agoRollup merge of #106008 - uweigand:s390x-lintgroup-order, r=Nilstrieb
Yuki Okushi [Wed, 21 Dec 2022 23:32:12 +0000 (08:32 +0900)]
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

18 months agoRollup merge of #105995 - JohnTitor:issue-96530, r=compiler-errors
Yuki Okushi [Wed, 21 Dec 2022 23:32:12 +0000 (08:32 +0900)]
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>
18 months agoRollup merge of #105986 - eltociear:patch-18, r=RalfJung
Yuki Okushi [Wed, 21 Dec 2022 23:32:11 +0000 (08:32 +0900)]
Rollup merge of #105986 - eltociear:patch-18, r=RalfJung

Fix typo in reading_half_a_pointer.rs

gurantee -> guarantee

18 months agoRollup merge of #105980 - goffrie:waker-drop, r=thomcc
Yuki Okushi [Wed, 21 Dec 2022 23:32:11 +0000 (08:32 +0900)]
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.

18 months agoRollup merge of #105824 - zacchiro:patch-1, r=JohnTitor
Yuki Okushi [Wed, 21 Dec 2022 23:32:10 +0000 (08:32 +0900)]
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.

18 months agoRollup merge of #105602 - RalfJung:read-convenience, r=oli-obk
Yuki Okushi [Wed, 21 Dec 2022 23:32:10 +0000 (08:32 +0900)]
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```

18 months agoRollup merge of #105584 - raffimolero:patch-1, r=JohnTitor
Yuki Okushi [Wed, 21 Dec 2022 23:32:09 +0000 (08:32 +0900)]
Rollup merge of #105584 - raffimolero:patch-1, r=JohnTitor

add assert messages if chunks/windows are length 0

18 months agoUpdate track_caller tests; run fmt
Bryan Garza [Wed, 21 Dec 2022 23:22:56 +0000 (23:22 +0000)]
Update track_caller tests; run fmt

18 months agoAuto merge of #105613 - Nilstrieb:rename-assert_uninit_valid, r=RalfJung
bors [Wed, 21 Dec 2022 23:20:04 +0000 (23:20 +0000)]
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`

18 months agorustdoc: simplify link anchor to section expand JS
Michael Howell [Wed, 21 Dec 2022 20:28:42 +0000 (13:28 -0700)]
rustdoc: simplify link anchor to section expand JS

18 months agoAuto merge of #105979 - matthiaskrgr:rollup-2luw3mx, r=matthiaskrgr
bors [Wed, 21 Dec 2022 20:19:22 +0000 (20:19 +0000)]
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

18 months agoForbid `RetagKind::TwoPhase` as well
Jakob Degen [Wed, 21 Dec 2022 19:46:13 +0000 (11:46 -0800)]
Forbid `RetagKind::TwoPhase` as well

18 months agoAdd comment explaining what the scrape-examples-toggle.goml GUI test is about
Guillaume Gomez [Wed, 21 Dec 2022 19:21:31 +0000 (20:21 +0100)]
Add comment explaining what the scrape-examples-toggle.goml GUI test is about

18 months agoClarify that raw retags are not permitted in Mir
Jakob Degen [Wed, 21 Dec 2022 18:30:38 +0000 (10:30 -0800)]
Clarify that raw retags are not permitted in Mir

18 months agoSort lint_groups in no_lint_suggestion
Ulrich Weigand [Wed, 21 Dec 2022 16:27:45 +0000 (17:27 +0100)]
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

18 months agoGive opaque types a better coherence error
Oli Scherer [Wed, 21 Dec 2022 17:44:30 +0000 (17:44 +0000)]
Give opaque types a better coherence error

18 months agoAuto merge of #105812 - ojeda:no-jump-tables, r=nikic
bors [Wed, 21 Dec 2022 17:38:38 +0000 (17:38 +0000)]
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

18 months agocodegen tests: adapt patterns to also work with v0 symbol mangling
Krasimir Georgiev [Wed, 21 Dec 2022 14:19:04 +0000 (14:19 +0000)]
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.

18 months agoAuto merge of #100390 - jhpratt:float-from-bool, r=dtolnay
bors [Wed, 21 Dec 2022 14:27:57 +0000 (14:27 +0000)]
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

18 months agoTest that async blocks are UnwindSafe
Arpad Borsos [Wed, 21 Dec 2022 12:41:28 +0000 (13:41 +0100)]
Test that async blocks are UnwindSafe

This was a regression from the reverted #105250 which is now covered by a test.

18 months agoAdd regression test for #96530
Yuki Okushi [Wed, 21 Dec 2022 12:10:30 +0000 (21:10 +0900)]
Add regression test for #96530

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
18 months agoless specific wording
Ralf Jung [Wed, 21 Dec 2022 10:06:20 +0000 (11:06 +0100)]
less specific wording

18 months agoFix typo in reading_half_a_pointer.rs
Ikko Ashimine [Wed, 21 Dec 2022 06:34:21 +0000 (15:34 +0900)]
Fix typo in reading_half_a_pointer.rs

gurantee -> guarantee

18 months agoDon't call typeck if we have no typeck results
Michael Goulet [Wed, 21 Dec 2022 05:49:12 +0000 (05:49 +0000)]
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

18 months agoCollectAllMismatches relation should respect int/float infer vars
Michael Goulet [Wed, 21 Dec 2022 05:42:48 +0000 (05:42 +0000)]
CollectAllMismatches relation should respect int/float infer vars

18 months agoRename things to be a bit clearer
Michael Goulet [Wed, 21 Dec 2022 05:53:55 +0000 (05:53 +0000)]
Rename things to be a bit clearer

18 months agoSubstitute things correctly
Michael Goulet [Wed, 21 Dec 2022 05:36:26 +0000 (05:36 +0000)]
Substitute things correctly

18 months agoRemove some unnecessary try_map_bound
Michael Goulet [Wed, 21 Dec 2022 05:07:50 +0000 (05:07 +0000)]
Remove some unnecessary try_map_bound

18 months agoImprove code based on feedback.
Bryan Garza [Wed, 21 Dec 2022 03:13:28 +0000 (03:13 +0000)]
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.

18 months agoAdd lint doc comment
Bryan Garza [Wed, 7 Dec 2022 20:26:56 +0000 (20:26 +0000)]
Add lint doc comment

18 months agoUpdate track_caller logic/lint after rebase
Bryan Garza [Wed, 7 Dec 2022 20:13:22 +0000 (20:13 +0000)]
Update track_caller logic/lint after rebase

18 months agoupdate wording of lint
Bryan Garza [Thu, 24 Nov 2022 03:48:27 +0000 (03:48 +0000)]
update wording of lint

18 months agoUpdate code based on PR comments
Bryan Garza [Thu, 24 Nov 2022 03:39:47 +0000 (03:39 +0000)]
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

18 months agoSwitch `#[track_caller]` back to a no-op unless feature gate is enabled
Bryan Garza [Tue, 22 Nov 2022 21:15:27 +0000 (21:15 +0000)]
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

18 months agoRefer to "Waker" rather than "RawWaker" in `drop` comment
Geoffry Song [Tue, 20 Dec 2022 22:51:24 +0000 (14:51 -0800)]
Refer to "Waker" rather than "RawWaker" in `drop` comment

18 months agoRollup merge of #105976 - jyn514:unused-make-targets, r=Mark-Simulacrum
Matthias Krüger [Tue, 20 Dec 2022 22:35:17 +0000 (23:35 +0100)]
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 0e272de69f4a9c889e5f1a024a88b3e1f60cb6c5, which looks like it's just intended for CI, not as a user-facing feature.

18 months agoRollup merge of #105973 - oli-obk:simplify_callee_checks, r=jackh726
Matthias Krüger [Tue, 20 Dec 2022 22:35:17 +0000 (23:35 +0100)]
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.

18 months agoRollup merge of #105972 - notriddle:notriddle/anchor, r=GuillaumeGomez
Matthias Krüger [Tue, 20 Dec 2022 22:35:16 +0000 (23:35 +0100)]
Rollup merge of #105972 - notriddle:notriddle/anchor, r=GuillaumeGomez

rustdoc: simplify section anchor CSS

Since f50bf8636e3b0296db82e631fe95c84324a46ccc changed anchors to be always positioned absolute, specifying it on hover as well is redundant.

18 months agoRollup merge of #105964 - notriddle:notriddle/scraped-example-length, r=GuillaumeGomez
Matthias Krüger [Tue, 20 Dec 2022 22:35:16 +0000 (23:35 +0100)]
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)

18 months agoRollup merge of #105949 - ChrisDenton:bump-cfg-if, r=Nilstrieb
Matthias Krüger [Tue, 20 Dec 2022 22:35:16 +0000 (23:35 +0100)]
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.

18 months agoRollup merge of #105904 - MarcusCalhoun-Lopez:darwin_arch_i386, r=bjorn3
Matthias Krüger [Tue, 20 Dec 2022 22:35:15 +0000 (23:35 +0100)]
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`

18 months agoRollup merge of #105897 - oli-obk:tait_patterns, r=TaKO8Ki
Matthias Krüger [Tue, 20 Dec 2022 22:35:15 +0000 (23:35 +0100)]
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 https://github.com/rust-lang/rust/blob/12bbdbdb440119a0b86d2ee742ec1460cdb2c5b9/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`.

18 months agoRollup merge of #105791 - Ezrashaw:add-e0472-long-docs, r=GuillaumeGomez
Matthias Krüger [Tue, 20 Dec 2022 22:35:14 +0000 (23:35 +0100)]
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`

18 months agoRemove unused `check-stage2-T-arm-linux-androideabi-H-x86_64-unknown-linux-gnu`
Joshua Nelson [Tue, 20 Dec 2022 21:39:32 +0000 (15:39 -0600)]
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 0e272de69f4a9c889e5f1a024a88b3e1f60cb6c5, which looks like it's just intended for CI, not as a user-facing feature.

18 months agoAdd `-Zno-jump-tables`
Miguel Ojeda [Sat, 17 Dec 2022 01:50:08 +0000 (02:50 +0100)]
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>
18 months agoAuto merge of #105127 - Sp00ph:const_new, r=dtolnay
bors [Tue, 20 Dec 2022 20:25:42 +0000 (20:25 +0000)]
Auto merge of #105127 - Sp00ph:const_new, r=dtolnay

Make `VecDeque::new` const

(See #105072)

18 months agoUse `Error` behavior for LLVM versions prior to 15
Arvind Mukund [Tue, 20 Dec 2022 19:44:12 +0000 (11:44 -0800)]
Use `Error` behavior for LLVM versions prior to 15

CI fails when building with LLVM-13. This raises unknown behavior
constant `8` from IRVerifier.

18 months agorustdoc: simplify section anchor CSS
Michael Howell [Tue, 20 Dec 2022 19:44:22 +0000 (12:44 -0700)]
rustdoc: simplify section anchor CSS

Since f50bf8636e3b0296db82e631fe95c84324a46ccc changed anchors to be
always positioned absolute, specifying it on hover as well is redundant.

18 months agoAvoid going through the happy path in case of non-fn builtin calls
Oli Scherer [Tue, 20 Dec 2022 18:59:52 +0000 (18:59 +0000)]
Avoid going through the happy path in case of non-fn builtin calls

18 months agoRe-enable fn trait call notation error
Michael Goulet [Tue, 20 Dec 2022 18:30:12 +0000 (18:30 +0000)]
Re-enable fn trait call notation error

18 months agorustdoc: prevent CSS layout of line numbers shrinking into nothing
Michael Howell [Tue, 20 Dec 2022 17:32:35 +0000 (10:32 -0700)]
rustdoc: prevent CSS layout of line numbers shrinking into nothing

18 months agoAuto merge of #105381 - uweigand:s390x-ffi-vaarg, r=nikic
bors [Tue, 20 Dec 2022 17:09:11 +0000 (17:09 +0000)]
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.

18 months agoSome ICE debugging aids
Oli Scherer [Wed, 21 Sep 2022 08:14:31 +0000 (08:14 +0000)]
Some ICE debugging aids

18 months agotracing: make flag checking less noisy
Oli Scherer [Tue, 11 Oct 2022 11:05:41 +0000 (11:05 +0000)]
tracing: make flag checking less noisy

18 months agoSome track_caller additions
Oli Scherer [Wed, 12 Oct 2022 14:16:31 +0000 (14:16 +0000)]
Some track_caller additions

18 months agoSome hir cleanups
Oli Scherer [Thu, 10 Nov 2022 08:47:16 +0000 (08:47 +0000)]
Some hir cleanups

18 months agoFix some `~const` usage in libcore
Oli Scherer [Tue, 11 Oct 2022 19:11:56 +0000 (19:11 +0000)]
Fix some `~const` usage in libcore

18 months agoRemove an unused function
Oli Scherer [Thu, 6 Oct 2022 11:44:42 +0000 (11:44 +0000)]
Remove an unused function

18 months agouse `track_caller` to show where the panic is actually from
Oli Scherer [Wed, 30 Nov 2022 11:09:22 +0000 (11:09 +0000)]
use `track_caller` to show where the panic is actually from

18 months agoAuto merge of #105951 - matthiaskrgr:rollup-aqxz888, r=matthiaskrgr
bors [Tue, 20 Dec 2022 13:58:08 +0000 (13:58 +0000)]
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

18 months agoHackily fix an opaque type ICE
Oli Scherer [Mon, 19 Dec 2022 13:14:22 +0000 (13:14 +0000)]
Hackily fix an opaque type ICE

18 months agoSome style nits
Oli Scherer [Mon, 19 Dec 2022 13:14:03 +0000 (13:14 +0000)]
Some style nits

18 months agoReplace a `find` with a loop to simplify the logic.
Oli Scherer [Mon, 19 Dec 2022 12:49:10 +0000 (12:49 +0000)]
Replace a `find` with a loop to simplify the logic.

18 months agoMake it easier to debug where a region error was created
Oli Scherer [Mon, 19 Dec 2022 12:10:26 +0000 (12:10 +0000)]
Make it easier to debug where a region error was created

18 months agoSome tracing cleanups
Oli Scherer [Mon, 19 Dec 2022 10:45:35 +0000 (10:45 +0000)]
Some tracing cleanups

18 months agoRollup merge of #105945 - JohnTitor:issue-57404, r=compiler-errors
Matthias Krüger [Tue, 20 Dec 2022 13:37:35 +0000 (14:37 +0100)]
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>
18 months agoRollup merge of #105944 - JohnTitor:issue-80816, r=compiler-errors
Matthias Krüger [Tue, 20 Dec 2022 13:37:34 +0000 (14:37 +0100)]
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>
18 months agoRollup merge of #105943 - JohnTitor:issue-102206, r=compiler-errors
Matthias Krüger [Tue, 20 Dec 2022 13:37:34 +0000 (14:37 +0100)]
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>
18 months agoRollup merge of #105939 - GuillaumeGomez:improve-description-gui-test, r=Dylan-DPC
Matthias Krüger [Tue, 20 Dec 2022 13:37:33 +0000 (14:37 +0100)]
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`

18 months agoRollup merge of #105938 - andersk:coerce_unsized-tracking, r=Dylan-DPC
Matthias Krüger [Tue, 20 Dec 2022 13:37:33 +0000 (14:37 +0100)]
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.

18 months agoRollup merge of #105930 - JakobDegen:nal-unsound, r=oli-obk
Matthias Krüger [Tue, 20 Dec 2022 13:37:32 +0000 (14:37 +0100)]
Rollup merge of #105930 - JakobDegen:nal-unsound, r=oli-obk

Disable `NormalizeArrayLen`

cc #105929

r? mir-opt

18 months agoRollup merge of #105835 - tmiasko:cleanup-post-borrowck, r=JakobDegen
Matthias Krüger [Tue, 20 Dec 2022 13:37:31 +0000 (14:37 +0100)]
Rollup merge of #105835 - tmiasko:cleanup-post-borrowck, r=JakobDegen

Refactor post borrowck cleanup passes

18 months agoBump `cfg-if` to `1.0`
Chris Denton [Tue, 20 Dec 2022 13:03:45 +0000 (13:03 +0000)]
Bump `cfg-if` to `1.0`

18 months agoAuto merge of #105940 - matthiaskrgr:rollup-ho4po1t, r=matthiaskrgr
bors [Tue, 20 Dec 2022 10:20:27 +0000 (10:20 +0000)]
Auto merge of #105940 - matthiaskrgr:rollup-ho4po1t, r=matthiaskrgr

Rollup of 5 pull requests

Successful merges:

 - #105901 (Don't panic on stable since miri is not available there)
 - #105912 (rustdoc: force pre tags to have the default line height)
 - #105914 (rustdoc: Simplify CSS for scraped code examples code blocks)
 - #105933 (Add readable rustdoc display for tvOS and watchOS)
 - #105935 (docs/test: add UI test and long-form error docs for `E0377`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

18 months agoAdd regression test for #57404
Yuki Okushi [Tue, 20 Dec 2022 09:52:30 +0000 (18:52 +0900)]
Add regression test for #57404

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
18 months agoAdd regression test for #80816
Yuki Okushi [Tue, 20 Dec 2022 09:48:02 +0000 (18:48 +0900)]
Add regression test for #80816

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
18 months agoAdd regression test for #102206
Yuki Okushi [Tue, 20 Dec 2022 09:24:04 +0000 (18:24 +0900)]
Add regression test for #102206

Signed-off-by: Yuki Okushi <jtitor@2k36.org>