]> git.lizzy.rs Git - rust.git/log
rust.git
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 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 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 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 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 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>
18 months agoRollup merge of #105935 - Ezrashaw:add-test+docs-for-e0377, r=GuillaumeGomez
Matthias Krüger [Tue, 20 Dec 2022 07:51:16 +0000 (08:51 +0100)]
Rollup merge of #105935 - Ezrashaw:add-test+docs-for-e0377, r=GuillaumeGomez

docs/test: add UI test and long-form error docs for `E0377`

18 months agoRollup merge of #105933 - taiki-e:doc-cfg, r=GuillaumeGomez
Matthias Krüger [Tue, 20 Dec 2022 07:51:16 +0000 (08:51 +0100)]
Rollup merge of #105933 - taiki-e:doc-cfg, r=GuillaumeGomez

Add readable rustdoc display for tvOS and watchOS

They are currently displayed as `target_os="..."` in rustdoc, but it would be nice to have readable display like in iOS and other OSs.

<img width="487" alt="cfg" src="https://user-images.githubusercontent.com/43724913/208579395-fd5cf276-8171-47ab-bbed-23e40bb7af11.png">

18 months agoRollup merge of #105914 - GuillaumeGomez:simplify-css-examples-code-blocks, r=notriddle
Matthias Krüger [Tue, 20 Dec 2022 07:51:16 +0000 (08:51 +0100)]
Rollup merge of #105914 - GuillaumeGomez:simplify-css-examples-code-blocks, r=notriddle

rustdoc: Simplify CSS for scraped code examples code blocks

It's another approach than https://github.com/rust-lang/rust/pull/105894 for https://github.com/rust-lang/rust/pull/105823.

I simply removed the extra style added for the scraped code blocks which appears to be unneeded.

r? `@notriddle`

18 months agoRollup merge of #105912 - notriddle:notriddle/pre-line-height, r=GuillaumeGomez
Matthias Krüger [Tue, 20 Dec 2022 07:51:15 +0000 (08:51 +0100)]
Rollup merge of #105912 - notriddle:notriddle/pre-line-height, r=GuillaumeGomez

rustdoc: force pre tags to have the default line height

Fixes #105906

18 months agoRollup merge of #105901 - oli-obk:no_miri_on_stable, r=Mark-Simulacrum
Matthias Krüger [Tue, 20 Dec 2022 07:51:14 +0000 (08:51 +0100)]
Rollup merge of #105901 - oli-obk:no_miri_on_stable, r=Mark-Simulacrum

Don't panic on stable since miri is not available there

fixes #105816

18 months agoAuto merge of #105880 - Nilstrieb:make-newtypes-less-not-rust, r=oli-obk
bors [Tue, 20 Dec 2022 07:27:01 +0000 (07:27 +0000)]
Auto merge of #105880 - Nilstrieb:make-newtypes-less-not-rust, r=oli-obk

Improve syntax of `newtype_index`

This makes it more like proper Rust and also makes the implementation a lot simpler.

Mostly just turns weird flags in the body into proper attributes.

It should probably also be converted to an attribute macro instead of function-like, but that can be done in a future PR.

18 months agoImprove description of struct-fields GUI test
Guillaume Gomez [Tue, 20 Dec 2022 07:22:31 +0000 (08:22 +0100)]
Improve description of struct-fields GUI test

18 months agoUpdate coerce_unsized tracking issue from #27732 to #18598
Anders Kaseorg [Tue, 20 Dec 2022 07:08:38 +0000 (23:08 -0800)]
Update coerce_unsized tracking issue from #27732 to #18598

Issue #27732 was closed as a duplicate of #18598.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
18 months agodocs/test: add UI test and long-form error docs for `E0377`
Ezra Shaw [Tue, 20 Dec 2022 05:31:15 +0000 (18:31 +1300)]
docs/test: add UI test and long-form error docs for `E0377`

18 months agoAuto merge of #105575 - compiler-errors:impl-wf-lint, r=oli-obk
bors [Tue, 20 Dec 2022 03:52:43 +0000 (03:52 +0000)]
Auto merge of #105575 - compiler-errors:impl-wf-lint, r=oli-obk

Add `IMPLIED_BOUNDS_ENTAILMENT` lint

Implements a lint (#105572) version of the hard-error introduced in #105483. Context is in that PR.

r? `@lcnr`
cc `@oli-obk` who had asked for this to be a lint first

Not sure if this needs to be an FCP, since it's a lint for now.

18 months agoAdd readable rustdoc display for tvOS and watchOS
Taiki Endo [Tue, 20 Dec 2022 03:42:12 +0000 (12:42 +0900)]
Add readable rustdoc display for tvOS and watchOS

18 months agoDisable `NormalizeArrayLen`
Jakob Degen [Tue, 20 Dec 2022 01:38:18 +0000 (17:38 -0800)]
Disable `NormalizeArrayLen`

18 months agoAuto merge of #105918 - matthiaskrgr:rollup-mmazd62, r=matthiaskrgr
bors [Tue, 20 Dec 2022 01:06:52 +0000 (01:06 +0000)]
Auto merge of #105918 - matthiaskrgr:rollup-mmazd62, r=matthiaskrgr

Rollup of 7 pull requests

Successful merges:

 - #105801 (Realistic `Path::as_mut_os_str` doctest)
 - #105860 (Add long error docs for `E0460` and `E0457`)
 - #105895 (Test that we don't add a new kind of breaking change with TAITs)
 - #105902 (docs: improve pin docs)
 - #105910 (Update books)
 - #105913 (rustdoc: remove width-limiter from source pages, stop overriding CSS)
 - #105915 (Revert "Replace usage of `ResumeTy` in async lowering with `Context`")

Failed merges:

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

18 months agoAuto merge of #105905 - lqd:revert-103880, r=jackh726
bors [Mon, 19 Dec 2022 22:37:12 +0000 (22:37 +0000)]
Auto merge of #105905 - lqd:revert-103880, r=jackh726

Revert #103880 "Use non-ascribed type as field's type in mir"

This PR prepares a revert for #103880 to fix #105809, #105881, #105886 and others (like the duplicates of the first one), in case an actual fix can't get done today.

I've also added the MCVE from #105809. There is no MCVE for the #105881 and #105886 ICEs yet however, so there are no tests for them here, although we'll need one before relanding the original changes.

Were this PR to land, it would also reopen #96514 as it was fixed by the original PR.

Opening as draft to allow time for a possible fix.

r? `@jackh726`

18 months agoImplement va_list and va_arg for s390x FFI
Ulrich Weigand [Tue, 6 Dec 2022 16:36:09 +0000 (17:36 +0100)]
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 agoRollup merge of #105915 - andrewpollack:revert-105250-async-rm-resumety, r=tmandry
Matthias Krüger [Mon, 19 Dec 2022 19:55:00 +0000 (20:55 +0100)]
Rollup merge of #105915 - andrewpollack:revert-105250-async-rm-resumety, r=tmandry

Revert "Replace usage of `ResumeTy` in async lowering with `Context`"

Reverts rust-lang/rust#105250
Fixes: #105501
Following instructions from [forge](https://forge.rust-lang.org/compiler/reviews.html#reverts).

This change introduced a breaking change that is not actionable nor relevant, and is blocking updates to our toolchain. Along with other comments on the CL marking issues that are fixed by reverts, reverting is best until these issues can be resolved

cc. `@Swatinem`

18 months agoRollup merge of #105913 - notriddle:notriddle/width-limiter, r=GuillaumeGomez
Matthias Krüger [Mon, 19 Dec 2022 19:55:00 +0000 (20:55 +0100)]
Rollup merge of #105913 - notriddle:notriddle/width-limiter, r=GuillaumeGomez

rustdoc: remove width-limiter from source pages, stop overriding CSS

18 months agoRollup merge of #105910 - rustbot:docs-update, r=ehuss
Matthias Krüger [Mon, 19 Dec 2022 19:54:59 +0000 (20:54 +0100)]
Rollup merge of #105910 - rustbot:docs-update, r=ehuss

Update books

## rust-lang/nomicon

1 commits in ae406aa5287a9e025abb72343aaceec98458c117..dd37e21ccee43918ed18a71581bb2af537ffe4fc
2022-12-09 22:04:38 UTC to 2022-12-09 22:04:38 UTC

- Update lifetime-mismatch.md (rust-lang/nomicon#387)

## rust-lang/rust-by-example

3 commits in a9869b4a3c4cac3bc6099b41f088679e268400b8..995df09b65c582eb6290ab7ea5d9485983eb4c37
2022-12-08 23:29:31 UTC to 2022-12-08 23:28:31 UTC

- Add documentation for let-else. (rust-lang/rust-by-example#1640)
- Added missing space in comment (rust-lang/rust-by-example#1644)
- Clean up Chapter 1 (Hello World) (rust-lang/rust-by-example#1650)

## rust-lang/rustc-dev-guide

8 commits in e269950a57fa6fcda356426545fb5aa3691a7ced..8b42eb5f57d3d8ed2257a22d0e850d9db52afed3
2022-12-17 22:41:27 UTC to 2022-12-07 05:42:57 UTC

- Add -Ztrack-diagnostics information (rust-lang/rustc-dev-guide#1506)
- Add documentation for LLVM KCFI support (rust-lang/rustc-dev-guide#1529)
- Replace references to NoLandingPads in MIR pass documents (rust-lang/rustc-dev-guide#1531)
- share same link (rust-lang/rustc-dev-guide#1530)
- chore: Update `actions/github-script` to v6 (rust-lang/rustc-dev-guide#1521)
- fix: Fix broken links (rust-lang/rustc-dev-guide#1522)
- Remove TyS (rust-lang/rustc-dev-guide#1526)
- Fix small inaccuracy in monomorph page (rust-lang/rustc-dev-guide#1525)

18 months agoRollup merge of #105902 - vincenzopalazzo:macros/pin_docs, r=eholk
Matthias Krüger [Mon, 19 Dec 2022 19:54:59 +0000 (20:54 +0100)]
Rollup merge of #105902 - vincenzopalazzo:macros/pin_docs, r=eholk

docs: improve pin docs

Override https://github.com/rust-lang/rust/pull/104195 with a full cleanup of the git history, now it should be ready to be merged.

r? ``@eholk``

``@rustbot`` label +A-async-await

18 months agoRollup merge of #105895 - oli-obk:tait_coherence, r=lcnr
Matthias Krüger [Mon, 19 Dec 2022 19:54:58 +0000 (20:54 +0100)]
Rollup merge of #105895 - oli-obk:tait_coherence, r=lcnr

Test that we don't add a new kind of breaking change with TAITs

r? ``@lcnr``

18 months agoRollup merge of #105860 - Ezrashaw:add-long-errors-0460-0457, r=jruderman,GuillaumeGomez
Matthias Krüger [Mon, 19 Dec 2022 19:54:57 +0000 (20:54 +0100)]
Rollup merge of #105860 - Ezrashaw:add-long-errors-0460-0457, r=jruderman,GuillaumeGomez

Add long error docs for `E0460` and `E0457`

Final docs for errors in #61137 that have UI tests, my next PRs will also add these tests.

r? ``@GuillaumeGomez``

18 months agoRollup merge of #105801 - zertosh:path_mut_os_str_doc_test, r=dtolnay
Matthias Krüger [Mon, 19 Dec 2022 19:54:57 +0000 (20:54 +0100)]
Rollup merge of #105801 - zertosh:path_mut_os_str_doc_test, r=dtolnay

Realistic `Path::as_mut_os_str` doctest

With "Implement DerefMut for PathBuf" (#105018) now merged, it's
possible to exercise `Path::as_mut_os_str` (#105002) without going
through `into_boxed_path`.

18 months agoRevert "Replace usage of `ResumeTy` in async lowering with `Context`"
Andrew Pollack [Mon, 19 Dec 2022 19:24:59 +0000 (11:24 -0800)]
Revert "Replace usage of `ResumeTy` in async lowering with `Context`"

18 months agoAuto merge of #103600 - compiler-errors:early-binder-nits, r=spastorino
bors [Mon, 19 Dec 2022 19:21:35 +0000 (19:21 +0000)]
Auto merge of #103600 - compiler-errors:early-binder-nits, r=spastorino

Address some `EarlyBinder` nits

18 months agoMake fast-path for implied wf lint better
Michael Goulet [Mon, 19 Dec 2022 19:04:55 +0000 (19:04 +0000)]
Make fast-path for implied  wf lint better

18 months agoSimplify CSS for code examples code blocks
Guillaume Gomez [Mon, 19 Dec 2022 18:53:09 +0000 (19:53 +0100)]
Simplify CSS for code examples code blocks

18 months agorustdoc: remove width-limiter from source pages, stop overriding CSS
Michael Howell [Mon, 19 Dec 2022 18:40:22 +0000 (11:40 -0700)]
rustdoc: remove width-limiter from source pages, stop overriding CSS

18 months agoadd non-regression test for issue 105809
Rémy Rakic [Mon, 19 Dec 2022 15:41:36 +0000 (15:41 +0000)]
add non-regression test for issue 105809

18 months agoDowngrade IMPLIED_BOUNDS_ENTAILMENT to warn by default, add it to builtin lint list
Michael Goulet [Fri, 16 Dec 2022 19:30:32 +0000 (19:30 +0000)]
Downgrade IMPLIED_BOUNDS_ENTAILMENT to warn by default, add it to builtin lint list

18 months agoMake Clippy test no longer unsound
Michael Goulet [Fri, 16 Dec 2022 03:06:21 +0000 (03:06 +0000)]
Make Clippy test no longer unsound

18 months agoAdd IMPLIED_BOUNDS_ENTAILMENT lint
Michael Goulet [Sun, 11 Dec 2022 21:16:43 +0000 (21:16 +0000)]
Add IMPLIED_BOUNDS_ENTAILMENT lint

18 months agorustdoc: force pre tags to have the default line height
Michael Howell [Mon, 19 Dec 2022 17:18:10 +0000 (10:18 -0700)]
rustdoc: force pre tags to have the default line height

Fixes #105906

18 months agoUpdate books
rustbot [Mon, 19 Dec 2022 17:01:02 +0000 (12:01 -0500)]
Update books

18 months agoAuto merge of #105698 - joboet:unsupported_threads_once, r=thomcc
bors [Mon, 19 Dec 2022 16:46:57 +0000 (16:46 +0000)]
Auto merge of #105698 - joboet:unsupported_threads_once, r=thomcc

Use a more efficient `Once` on platforms without threads

The current implementation uses an atomic queue and spins rather than panicking when calling `call_once` recursively. Since concurrency is not supported on platforms like WASM, `Once` can be implemented much more efficiently using just a single non-atomic state variable.

18 months agoRevert "Auto merge of #103880 - b-naber:field-ty-mir, r=lcnr"
Rémy Rakic [Mon, 19 Dec 2022 15:30:43 +0000 (15:30 +0000)]
Revert "Auto merge of #103880 - b-naber:field-ty-mir, r=lcnr"

This reverts commit 03770f0e2b60c02db8fcf52fed5fb36aac70cedc, reversing
changes made to 01ef4b21dc5251b58bd9c6fd6face2ae95d56da1.

18 months agoDon't panic on stable since miri is not available there
Oli Scherer [Mon, 19 Dec 2022 14:48:45 +0000 (14:48 +0000)]
Don't panic on stable since miri is not available there

18 months agodocs: improve pin docs
ch-iv [Tue, 8 Nov 2022 14:27:32 +0000 (09:27 -0500)]
docs: improve pin docs

Co-authored-by: <@ch-iv>
18 months agoTest that we don't add a new kind of breaking change with TAITs
Oli Scherer [Mon, 19 Dec 2022 11:51:46 +0000 (11:51 +0000)]
Test that we don't add a new kind of breaking change with TAITs

18 months agomore markdown list formatting
Ezra Shaw [Mon, 19 Dec 2022 09:50:31 +0000 (22:50 +1300)]
more markdown list formatting

Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
18 months agoAuto merge of #105892 - Dylan-DPC:rollup-eozolx4, r=Dylan-DPC
bors [Mon, 19 Dec 2022 09:23:31 +0000 (09:23 +0000)]
Auto merge of #105892 - Dylan-DPC:rollup-eozolx4, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #105682 (Use `expose_addr()` in `fmt::Pointer`)
 - #105839 (Suggest a `T: Send` bound for `&mut T` upvars in `Send` generators)
 - #105864 (clippy::complexity fixes)
 - #105882 (Don't ICE in closure arg borrow suggestion)
 - #105889 (Fix `uninlined_format_args` in libtest)

Failed merges:

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

18 months agoRollup merge of #105889 - Nilstrieb:fmt-libtest, r=thomcc
Dylan DPC [Mon, 19 Dec 2022 09:11:37 +0000 (14:41 +0530)]
Rollup merge of #105889 - Nilstrieb:fmt-libtest, r=thomcc

Fix `uninlined_format_args` in libtest

Done using clippy with a quick manual review.

18 months agoRollup merge of #105882 - compiler-errors:issue-105832, r=jackh726
Dylan DPC [Mon, 19 Dec 2022 09:11:36 +0000 (14:41 +0530)]
Rollup merge of #105882 - compiler-errors:issue-105832, r=jackh726

Don't ICE in closure arg borrow suggestion

Fixes #105832

18 months agoRollup merge of #105864 - matthiaskrgr:compl, r=Nilstrieb
Dylan DPC [Mon, 19 Dec 2022 09:11:35 +0000 (14:41 +0530)]
Rollup merge of #105864 - matthiaskrgr:compl, r=Nilstrieb

clippy::complexity fixes

filter_next
needless_question_mark
bind_instead_of_map
manual_find
derivable_impls
map_identity
redundant_slicing
skip_while_next
unnecessary_unwrap
needless_bool

r? `@compiler-errors`

18 months agoRollup merge of #105839 - LegionMammal978:mut-upvar-not-send, r=lcnr
Dylan DPC [Mon, 19 Dec 2022 09:11:35 +0000 (14:41 +0530)]
Rollup merge of #105839 - LegionMammal978:mut-upvar-not-send, r=lcnr

Suggest a `T: Send` bound for `&mut T` upvars in `Send` generators

Right now, we suggest a `T: Sync` bound for both `&T` and `&mut T` upvars. A user on URLO [found this confusing](https://users.rust-lang.org/t/error-complains-about-missing-sync-but-send-is-whats-missing/86021), so I wrote this quick fix to look at the mutability before making the suggestion.

18 months agoRollup merge of #105682 - thomcc:expose-ptr-fmt, r=RalfJung
Dylan DPC [Mon, 19 Dec 2022 09:11:34 +0000 (14:41 +0530)]
Rollup merge of #105682 - thomcc:expose-ptr-fmt, r=RalfJung

Use `expose_addr()` in `fmt::Pointer`

Discussion in https://rust-lang.zulipchat.com/#narrow/stream/136281-t-lang.2Fwg-unsafe-code-guidelines/topic/Should.20.60fmt.3A.3APointer.60.20expose.20the.20argument.3F on whether or not we should do this (still undecided).

CC `@RalfJung`

18 months agoFix `uninlined_format_args` in libtest
nils [Mon, 19 Dec 2022 07:48:30 +0000 (08:48 +0100)]
Fix `uninlined_format_args` in libtest

18 months agoAuto merge of #105845 - lqd:revert-thinlto-revert, r=Mark-Simulacrum
bors [Mon, 19 Dec 2022 06:25:22 +0000 (06:25 +0000)]
Auto merge of #105845 - lqd:revert-thinlto-revert, r=Mark-Simulacrum

Re-enable ThinLTO for rustc on `x86_64-apple-darwin`

ThinLTO was disabled on x64 mac in https://github.com/rust-lang/rust/pull/105646 because of the https://github.com/rust-lang/rust/issues/105637 regression.

It was later discovered that the issue was present on other targets as well, as the mac revert was already landing. The linux/win reverts, however, did not land before the root cause was identified.

https://github.com/rust-lang/rust/pull/105800 fixed the underlying issue in `-Zdylib-lto` handling, and the x64 msvc and linux targets are now fixed, ICEs are using the correct `rustc_driver` panic hook.

This PR re-enables ThinLTO on mac for improved perf now that the issue should be fixed everywhere.

18 months agoAuto merge of #105884 - weihanglo:update-cargo, r=weihanglo
bors [Mon, 19 Dec 2022 03:36:34 +0000 (03:36 +0000)]
Auto merge of #105884 - weihanglo:update-cargo, r=weihanglo

Update cargo

11 commits in cc0a320879c17207bbfb96b5d778e28a2c62030d..c994a4a638370bc7e0ffcbb0e2865afdfa7d4415 2022-12-14 14:46:57 +0000 to 2022-12-18 21:50:58 +0000
- Fix examples of proc-macro crates being scraped for examples (rust-lang/cargo#11497)
- Enable triagebot's relabel functionality (rust-lang/cargo#11498)
- Revert "temporarily disable test `lto::test_profile`" (rust-lang/cargo#11495)
- Bump to 0.69.0, update changelog (rust-lang/cargo#11493)
- Fix typo (rust-lang/cargo#11491)
- Display CPU info in CI (rust-lang/cargo#11488)
- Fix collision_doc_profile test error (rust-lang/cargo#11489)
- fix: Make auto-fix note work with `clippy` (rust-lang/cargo#11399)
- fix(add): use the possessive in error message (rust-lang/cargo#11483)
- Document home crate in contrib docs (rust-lang/cargo#11481)
- Split up registry documentation into multiple sections (rust-lang/cargo#11480)

r? `@ghost`

18 months agoAuto merge of #105883 - matthiaskrgr:rollup-v5n53t1, r=matthiaskrgr
bors [Mon, 19 Dec 2022 01:13:58 +0000 (01:13 +0000)]
Auto merge of #105883 - matthiaskrgr:rollup-v5n53t1, r=matthiaskrgr

Rollup of 8 pull requests

Successful merges:

 - #105419 (Add tests for #41731)
 - #105447 (Add a test for #103095)
 - #105842 (print argument name in arg mismatch if possible)
 - #105863 (Update browser-ui-test version to reduce GUI tests flakyness)
 - #105867 (remove redundant fn params that were only "used" in recursion)
 - #105869 (don't clone Copy types)
 - #105873 (use &str / String literals instead of format!())
 - #105879 (Revert "Introduce lowering_arena to avoid creating AST nodes on the fly")

Failed merges:

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

18 months agoUpdate cargo
Weihang Lo [Sun, 18 Dec 2022 23:39:39 +0000 (23:39 +0000)]
Update cargo

11 commits in cc0a320879c17207bbfb96b5d778e28a2c62030d..c994a4a638370bc7e0ffcbb0e2865afdfa7d4415
2022-12-14 14:46:57 +0000 to 2022-12-18 21:50:58 +0000
- Fix examples of proc-macro crates being scraped for examples (rust-lang/cargo#11497)
- Enable triagebot's relabel functionality (rust-lang/cargo#11498)
- Revert "temporarily disable test `lto::test_profile`" (rust-lang/cargo#11495)
- Bump to 0.69.0, update changelog (rust-lang/cargo#11493)
- Fix typo (rust-lang/cargo#11491)
- Display CPU info in CI (rust-lang/cargo#11488)
- Fix collision_doc_profile test error (rust-lang/cargo#11489)
- fix: Make auto-fix note work with `clippy` (rust-lang/cargo#11399)
- fix(add): use the possessive in error message (rust-lang/cargo#11483)
- Document home crate in contrib docs (rust-lang/cargo#11481)
- Split up registry documentation into multiple sections (rust-lang/cargo#11480)

18 months agoclippy::complexity fixes
Matthias Krüger [Sun, 18 Dec 2022 11:45:56 +0000 (12:45 +0100)]
clippy::complexity fixes

filter_next
needless_question_mark
bind_instead_of_map
manual_find
derivable_impls
map_identity
redundant_slicing
skip_while_next
unnecessary_unwrap
needless_bool

18 months agoRollup merge of #105879 - Nilstrieb:revert-hir-arena, r=oli-obk
Matthias Krüger [Sun, 18 Dec 2022 22:03:08 +0000 (23:03 +0100)]
Rollup merge of #105879 - Nilstrieb:revert-hir-arena, r=oli-obk

Revert "Introduce lowering_arena to avoid creating AST nodes on the fly"

This reverts commit d9a1faaa9cff6eab069ea8e5cd7862d0ae48e231 (#101499).

This was originally part of #101345 which has now been closed as a different approach is taken now.

r? `@oli-obk`

cc `@spastorino`

18 months agoRollup merge of #105873 - matthiaskrgr:clippy_fmt, r=Nilstrieb
Matthias Krüger [Sun, 18 Dec 2022 22:03:07 +0000 (23:03 +0100)]
Rollup merge of #105873 - matthiaskrgr:clippy_fmt, r=Nilstrieb

use &str / String literals instead of format!()

18 months agoRollup merge of #105869 - matthiaskrgr:clone_on_copy, r=compiler-errors
Matthias Krüger [Sun, 18 Dec 2022 22:03:07 +0000 (23:03 +0100)]
Rollup merge of #105869 - matthiaskrgr:clone_on_copy, r=compiler-errors

don't clone Copy types

18 months agoRollup merge of #105867 - matthiaskrgr:rec_param, r=compiler-errors
Matthias Krüger [Sun, 18 Dec 2022 22:03:06 +0000 (23:03 +0100)]
Rollup merge of #105867 - matthiaskrgr:rec_param, r=compiler-errors

remove redundant fn params that were only "used" in recursion

18 months agoRollup merge of #105863 - GuillaumeGomez:update-browser-ui-test, r=notriddle
Matthias Krüger [Sun, 18 Dec 2022 22:03:06 +0000 (23:03 +0100)]
Rollup merge of #105863 - GuillaumeGomez:update-browser-ui-test, r=notriddle

Update browser-ui-test version to reduce GUI tests flakyness

Part of https://github.com/rust-lang/rust/issues/93784.

r? `@notriddle`

18 months agoRollup merge of #105842 - compiler-errors:arg-name-sugg, r=petrochenkov
Matthias Krüger [Sun, 18 Dec 2022 22:03:05 +0000 (23:03 +0100)]
Rollup merge of #105842 - compiler-errors:arg-name-sugg, r=petrochenkov

print argument name in arg mismatch if possible

A bit more contextual than just `/* value */`, at least when the argument is named something related to its context.

The UI test cases are... not super convincing, but also they're minimized tests.

18 months agoRollup merge of #105447 - TaKO8Ki:add-test-for-103095, r=petrochenkov
Matthias Krüger [Sun, 18 Dec 2022 22:03:05 +0000 (23:03 +0100)]
Rollup merge of #105447 - TaKO8Ki:add-test-for-103095, r=petrochenkov

Add a test for #103095

closes #103095

18 months agoRollup merge of #105419 - YC:issue-41731, r=petrochenkov
Matthias Krüger [Sun, 18 Dec 2022 22:03:04 +0000 (23:03 +0100)]
Rollup merge of #105419 - YC:issue-41731, r=petrochenkov

Add tests for #41731

Closes #41731

18 months agoAuto merge of #105446 - erikdesjardins:vt-size, r=nikic
bors [Sun, 18 Dec 2022 22:01:39 +0000 (22:01 +0000)]
Auto merge of #105446 - erikdesjardins:vt-size, r=nikic

Add 0..=isize::MAX range metadata to size loads from vtables

This is the (much belated) size counterpart to #91569.

Inspired by https://rust-lang.zulipchat.com/#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/Range.20metadata.20for.20.60size_of_val.60.20and.20other.20isize.3A.3AMAX.20limits. This could help optimize layout computations based on the size of a dyn trait. Though, admittedly, adding this to vtables wouldn't be as beneficial as adding it to slice len, which is used much more often.

Miri detects this UB already: https://github.com/rust-lang/rust/blob/b7cc99142ad0cfe47e2fe9f7a82eaf5b672c0573/compiler/rustc_const_eval/src/interpret/traits.rs#L119-L121
(In fact Miri goes further, [assuming a 48-bit address space on 64-bit platforms](https://github.com/rust-lang/rust/blob/9db224fc908059986c179fc6ec433944e9cfce50/compiler/rustc_abi/src/lib.rs#L312-L331), but I don't think we can assume that in an optimization.)

18 months agoDon't ICE in closure arg borrow suggestion
Michael Goulet [Sun, 18 Dec 2022 21:41:08 +0000 (21:41 +0000)]
Don't ICE in closure arg borrow suggestion

18 months agoA few small cleanups for `newtype_index`
Nilstrieb [Sun, 18 Dec 2022 20:47:28 +0000 (21:47 +0100)]
A few small cleanups for `newtype_index`

Remove the `..` from the body, only a few invocations used it and it's
inconsistent with rust syntax.

Use `;` instead of `,` between consts. As the Rust syntax gods inteded.

18 months agoMake `#[debug_format]` an attribute in `newtype_index`
Nilstrieb [Sun, 18 Dec 2022 20:37:38 +0000 (21:37 +0100)]
Make `#[debug_format]` an attribute in `newtype_index`

This removes the `custom` format functionality as its only user was
trivially migrated to using a normal format.

If a new use case for a custom formatting impl pops up, you can add it
back.

18 months agoMake `#[max]` an attribute in `newtype_index`
Nilstrieb [Sun, 18 Dec 2022 20:22:14 +0000 (21:22 +0100)]
Make `#[max]` an attribute in `newtype_index`

18 months agoMake `#[no_ord_impl]` an attribute in `newtype_index`
Nilstrieb [Sun, 18 Dec 2022 20:06:44 +0000 (21:06 +0100)]
Make `#[no_ord_impl]` an attribute in `newtype_index`

18 months agoMake `#[custom_encodable]` an attribute for `newtype_index`
Nilstrieb [Sun, 18 Dec 2022 20:02:14 +0000 (21:02 +0100)]
Make `#[custom_encodable]` an attribute for `newtype_index`

Makes the syntax a little more rusty.

18 months agodocs: add long-form error-code docs for E0457
Ezra Shaw [Sun, 18 Dec 2022 09:00:35 +0000 (22:00 +1300)]
docs: add long-form error-code docs for E0457

18 months agodocs: add long-form error-code docs for E0460
Ezra Shaw [Sun, 18 Dec 2022 07:58:09 +0000 (20:58 +1300)]
docs: add long-form error-code docs for E0460

18 months agoUse `#[derive]` instead of custom syntax in all `newtype_index`
Nilstrieb [Sun, 18 Dec 2022 19:53:08 +0000 (20:53 +0100)]
Use `#[derive]` instead of custom syntax in all `newtype_index`

18 months agoRevert "Introduce lowering_arena to avoid creating AST nodes on the fly"
Nilstrieb [Sun, 18 Dec 2022 19:28:59 +0000 (20:28 +0100)]
Revert "Introduce lowering_arena to avoid creating AST nodes on the fly"

This reverts commit d9a1faaa9cff6eab069ea8e5cd7862d0ae48e231.

This was originally part of a larger PR that has now been closed as a
different approach is taken now.

18 months agoAuto merge of #105876 - matthiaskrgr:rollup-a9dgzjt, r=matthiaskrgr
bors [Sun, 18 Dec 2022 18:44:37 +0000 (18:44 +0000)]
Auto merge of #105876 - matthiaskrgr:rollup-a9dgzjt, r=matthiaskrgr

Rollup of 7 pull requests

Successful merges:

 - #96584 (Fix `x setup -h -v` should work)
 - #105420 (Remove dead code after destination propagation)
 - #105844 (Make the x tool use the x and x.ps1 scripts)
 - #105854 (remove redundant clone)
 - #105858 (Another `as_chunks` example)
 - #105870 (avoid .into() conversion to identical types)
 - #105875 (don't destuct references just to reborrow)

Failed merges:

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

18 months agoRollup merge of #105875 - matthiaskrgr:needless_borrowed_reference, r=oli-obk
Matthias Krüger [Sun, 18 Dec 2022 17:57:05 +0000 (18:57 +0100)]
Rollup merge of #105875 - matthiaskrgr:needless_borrowed_reference, r=oli-obk

don't destuct references just to reborrow

18 months agoRollup merge of #105870 - matthiaskrgr:useless_conv, r=oli-obk
Matthias Krüger [Sun, 18 Dec 2022 17:57:05 +0000 (18:57 +0100)]
Rollup merge of #105870 - matthiaskrgr:useless_conv, r=oli-obk

avoid .into() conversion to identical types

18 months agoRollup merge of #105858 - scottmcm:extra-as-chunks-example, r=the8472
Matthias Krüger [Sun, 18 Dec 2022 17:57:04 +0000 (18:57 +0100)]
Rollup merge of #105858 - scottmcm:extra-as-chunks-example, r=the8472

Another `as_chunks` example

I really liked this structure that dtolney brought up in #105316, so wanted to put it in the docs to help others use it.

18 months agoRollup merge of #105854 - matthiaskrgr:rmclone, r=compiler-errors
Matthias Krüger [Sun, 18 Dec 2022 17:57:03 +0000 (18:57 +0100)]
Rollup merge of #105854 - matthiaskrgr:rmclone, r=compiler-errors

remove redundant clone

18 months agoRollup merge of #105844 - albertlarsan68:x-rewrite, r=jyn514
Matthias Krüger [Sun, 18 Dec 2022 17:57:03 +0000 (18:57 +0100)]
Rollup merge of #105844 - albertlarsan68:x-rewrite, r=jyn514

Make the x tool use the x and x.ps1 scripts

This removes another python search from bootstrap.

r? `@jyn514`

18 months agoRollup merge of #105420 - tmiasko:dest-prop-dead-code, r=JakobDegen
Matthias Krüger [Sun, 18 Dec 2022 17:57:03 +0000 (18:57 +0100)]
Rollup merge of #105420 - tmiasko:dest-prop-dead-code, r=JakobDegen

Remove dead code after destination propagation

Fixes #105428.

cc `@JakobDegen`

18 months agoRollup merge of #96584 - bentongxyz:x-setup-h-v-should-work, r=jyn514
Matthias Krüger [Sun, 18 Dec 2022 17:57:02 +0000 (18:57 +0100)]
Rollup merge of #96584 - bentongxyz:x-setup-h-v-should-work, r=jyn514

Fix `x setup -h -v` should work

r? `@jyn514`

I have to convert profile to path and back in order to remove special-casing in bootstrap. I also check for `dry_run` so that `config.toml` and/ or `.git/hooks/pre-push` will not be created if `--dry-run` is specified.

Please help me see if this is ok, thanks alot!

18 months agoUpdate browser-ui-test version to reduce GUI tests flakyness
Guillaume Gomez [Sun, 18 Dec 2022 10:42:30 +0000 (11:42 +0100)]
Update browser-ui-test version to reduce GUI tests flakyness

18 months agoMake x use the x and x.ps1 scripts
Albert Larsan [Sun, 18 Dec 2022 17:07:48 +0000 (18:07 +0100)]
Make x use the x and x.ps1 scripts

This removes another python search from bootstrap.

18 months agodon't restuct references just to reborrow
Matthias Krüger [Sun, 18 Dec 2022 16:01:58 +0000 (17:01 +0100)]
don't restuct references just to reborrow

18 months agoAuto merge of #105714 - jyn514:tidy-first, r=Mark-Simulacrum
bors [Sun, 18 Dec 2022 16:03:46 +0000 (16:03 +0000)]
Auto merge of #105714 - jyn514:tidy-first, r=Mark-Simulacrum

Run `x test tidy` sooner in mingw-check

It takes less time to run than the other tests and is more likely to fail. `expand-yaml-anchors` is still run first to make sure the CI files are internally consistent.

Note that changing to `--stage 0` doesn't actually do anything since bootstrap tools are always built with the bootstrap compiler, this just makes it less confusing.

cc https://github.com/rust-lang/rust/pull/105058/commits/83bab41b5b2d4752d187dd91b05c88ac74cf3783

18 months agoavoid .into() conversion to identical types
Matthias Krüger [Sun, 18 Dec 2022 14:01:26 +0000 (15:01 +0100)]
avoid .into() conversion to identical types