]> git.lizzy.rs Git - rust.git/log
rust.git
18 months agoIndexItem.name String -> Symbol
klensy [Fri, 13 Jan 2023 12:39:16 +0000 (15:39 +0300)]
IndexItem.name String -> Symbol

18 months agoevade clones
klensy [Thu, 12 Jan 2023 16:47:53 +0000 (19:47 +0300)]
evade clones

18 months agoAuto merge of #106092 - asquared31415:start_lang_item_checks, r=davidtwco
bors [Fri, 13 Jan 2023 07:45:34 +0000 (07:45 +0000)]
Auto merge of #106092 - asquared31415:start_lang_item_checks, r=davidtwco

Add checks for the signature of the `start` lang item

Closes #105963

18 months agoAuto merge of #106004 - fee1-dead-contrib:const-closures, r=oli-obk
bors [Fri, 13 Jan 2023 05:04:48 +0000 (05:04 +0000)]
Auto merge of #106004 - fee1-dead-contrib:const-closures, r=oli-obk

Const closures

cc https://github.com/rust-lang/rust/issues/106003

18 months agoAuto merge of #101138 - Rejyr:diagnostic-migration-rustc-lint-pt2, r=davidtwco
bors [Fri, 13 Jan 2023 02:13:00 +0000 (02:13 +0000)]
Auto merge of #101138 - Rejyr:diagnostic-migration-rustc-lint-pt2, r=davidtwco

Migrate `rustc_lint` lint diagnostics

Part 2 of [Migrate `rustc_lint` errors to `SessionDiagnostic`](https://github.com/rust-lang/rust/pull/100776)

r? `@davidtwco`

# TODO
- [x] Refactor some lints manually implementing `DecorateLint` to use `Option<Subdiagnostic>`.
- [x] Add `#[rustc_lint_diagnostics]` to lint functions in `context.rs`.
- [x] Migrate `hidden_unicode_codepoints.rs`.
- [x] Migrate `UnsafeCode` in `builtin.rs`.
- [x] Migrate the rest of `builtin.rs`.

18 months agoAuto merge of #106786 - JohnTitor:rollup-8f4vk8m, r=JohnTitor
bors [Thu, 12 Jan 2023 22:58:14 +0000 (22:58 +0000)]
Auto merge of #106786 - JohnTitor:rollup-8f4vk8m, r=JohnTitor

Rollup of 8 pull requests

Successful merges:

 - #105795 (Stabilize `abi_efiapi` feature)
 - #106446 ([LSDA] Take ttype_index into account when taking unwind action)
 - #106675 (Mark ZST as FFI-safe if all its fields are PhantomData)
 - #106740 (Adding a hint on iterator type errors)
 - #106741 (Fix reexport of `doc(hidden)` item)
 - #106759 (Revert "Make nested RPITIT inherit the parent opaque's generics.")
 - #106772 (Re-add mw to review rotation)
 - #106778 (Exclude formatting commit from blame)

Failed merges:

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

18 months agoRollup merge of #106778 - RReverser:patch-1, r=dtolnay
Yuki Okushi [Thu, 12 Jan 2023 20:47:25 +0000 (05:47 +0900)]
Rollup merge of #106778 - RReverser:patch-1, r=dtolnay

Exclude formatting commit from blame

Excludes https://github.com/rust-lang/rust/commit/c34fbfaad38cf5829ef5cfe780dc9d58480adeaa (cc `@dtolnay)` to make Git blame a bit more useful.

18 months agoRollup merge of #106772 - michaelwoerister:triagebot-rotation, r=wesleywiser
Yuki Okushi [Thu, 12 Jan 2023 20:47:24 +0000 (05:47 +0900)]
Rollup merge of #106772 - michaelwoerister:triagebot-rotation, r=wesleywiser

Re-add mw to review rotation

r? `@wesleywiser`

18 months agoRollup merge of #106759 - compiler-errors:revert-105255, r=cjgillot
Yuki Okushi [Thu, 12 Jan 2023 20:47:24 +0000 (05:47 +0900)]
Rollup merge of #106759 - compiler-errors:revert-105255, r=cjgillot

Revert "Make nested RPITIT inherit the parent opaque's generics."

This reverts commit e2d41f4c974f0cc09e5aafb02883f222487610f9, and adjusts the `tests/ui/async-await/in-trait/nested-rpit.rs` test.

r? `@cjgillot`

fixes #106332, manually verified because it had no minimization :/

reopens #105197
cc #106729

18 months agoRollup merge of #106741 - GuillaumeGomez:reexport-doc-hidden, r=notriddle
Yuki Okushi [Thu, 12 Jan 2023 20:47:23 +0000 (05:47 +0900)]
Rollup merge of #106741 - GuillaumeGomez:reexport-doc-hidden, r=notriddle

Fix reexport of `doc(hidden)` item

Part of #59368.

It doesn't fix the `doc(inline)` nor the `doc(hidden)` on macro. I'll do it in a follow-up PR.

r? `@notriddle`

18 months agoRollup merge of #106740 - petar-dambovaliev:float-iterator-hint, r=Nilstrieb
Yuki Okushi [Thu, 12 Jan 2023 20:47:23 +0000 (05:47 +0900)]
Rollup merge of #106740 - petar-dambovaliev:float-iterator-hint, r=Nilstrieb

Adding a hint on iterator type errors

Issue reference https://github.com/rust-lang/rust/issues/106728

- [x] add a case in the attribute
- [x] add a test

closes #106728

18 months agoRollup merge of #106675 - krtab:fix_improper_ctypes, r=davidtwco
Yuki Okushi [Thu, 12 Jan 2023 20:47:22 +0000 (05:47 +0900)]
Rollup merge of #106675 - krtab:fix_improper_ctypes, r=davidtwco

Mark ZST as FFI-safe if all its fields are PhantomData

This presents one possible solution to issue: #106629.

This is my first (tentative) contribution to the compiler itself.

I'm looking forward for comments and feedback

Closes: #106629
18 months agoRollup merge of #106446 - bzEq:fix-unwind-lsda, r=Amanieu
Yuki Okushi [Thu, 12 Jan 2023 20:47:21 +0000 (05:47 +0900)]
Rollup merge of #106446 - bzEq:fix-unwind-lsda, r=Amanieu

[LSDA] Take ttype_index into account when taking unwind action

If `cs_action != 0`, we should check the `ttype_index` field in action record. If `ttype_index == 0`, a clean up action is taken; otherwise catch action is taken.

This can fix unwind failure on AIX which uses LLVM's libunwind by default. IIUC, rust's LSDA is borrowed from c++ and I'm assuming itanium-cxx-abi https://itanium-cxx-abi.github.io/cxx-abi/exceptions.pdf should be followed, so the fix follows what libcxxabi does. See https://github.com/llvm/llvm-project/blob/ec48682ce9f61d056361c5095f21e930b8365661/libcxxabi/src/cxa_personality.cpp#L152 for use of `ttype_index`.

18 months agoRollup merge of #105795 - nicholasbishop:bishop-stabilize-efiapi, r=joshtriplett
Yuki Okushi [Thu, 12 Jan 2023 20:47:21 +0000 (05:47 +0900)]
Rollup merge of #105795 - nicholasbishop:bishop-stabilize-efiapi, r=joshtriplett

Stabilize `abi_efiapi` feature

Tracking issue: https://github.com/rust-lang/rust/issues/65815
Closes #65815

18 months agoAuto merge of #106780 - flip1995:clippyup, r=Manishearth
bors [Thu, 12 Jan 2023 20:05:18 +0000 (20:05 +0000)]
Auto merge of #106780 - flip1995:clippyup, r=Manishearth

Update Clippy

r? `@Manishearth`

18 months agoMerge commit '7f27e2e74ef957baa382dc05cf08df6368165c74' into clippyup
Philipp Krones [Thu, 12 Jan 2023 18:48:13 +0000 (19:48 +0100)]
Merge commit '7f27e2e74ef957baa382dc05cf08df6368165c74' into clippyup

18 months agoAuto merge of #10192 - Jarcho:revert_9701, r=flip1995
bors [Thu, 12 Jan 2023 18:47:17 +0000 (18:47 +0000)]
Auto merge of #10192 - Jarcho:revert_9701, r=flip1995

Partially revert #9701

This partially reverts #9701 due to #10134

r? `@flip1995`

changelog: None

18 months agoAdjust old code for newer rustc version.
Jason Newcomb [Thu, 12 Jan 2023 18:29:23 +0000 (13:29 -0500)]
Adjust old code for newer rustc version.

18 months agoRevert 4dbd8ad34e7f6820f6e9e99531353e7ffe37b76a, c7dc96155853a3919b973347277d0e9bcaaa...
Jason Newcomb [Thu, 12 Jan 2023 18:28:22 +0000 (13:28 -0500)]
Revert 4dbd8ad34e7f6820f6e9e99531353e7ffe37b76ac7dc96155853a3919b973347277d0e9bcaaa22f0ed519ad746e31f64c4e9255be561785612532d37 and c6477eb71188311f01f409da628fab7062697bd7

18 months agoAuto merge of #10191 - flip1995:rustup, r=flip1995
bors [Thu, 12 Jan 2023 18:13:13 +0000 (18:13 +0000)]
Auto merge of #10191 - flip1995:rustup, r=flip1995

Rustup

r? `@ghost`

changelog: none

18 months agoAlso add rustc_driver to clippy_utils
Philipp Krones [Thu, 12 Jan 2023 18:12:06 +0000 (19:12 +0100)]
Also add rustc_driver to clippy_utils

I'm not sure why this is necessary. It worked without this for me
locally, but this fails in CI. The same was done in clippy_dev

18 months agoBump nightly version -> 2023-01-12
Philipp Krones [Thu, 12 Jan 2023 18:00:16 +0000 (19:00 +0100)]
Bump nightly version -> 2023-01-12

18 months agoMerge remote-tracking branch 'upstream/master' into rustup
Philipp Krones [Thu, 12 Jan 2023 17:59:59 +0000 (18:59 +0100)]
Merge remote-tracking branch 'upstream/master' into rustup

18 months agoExclude formatting commit from blame
Ingvar Stepanyan [Thu, 12 Jan 2023 17:40:48 +0000 (17:40 +0000)]
Exclude formatting commit from blame

Excludes https://github.com/rust-lang/rust/commit/c34fbfaad38cf5829ef5cfe780dc9d58480adeaa to make Git blame a bit more useful.

18 months agoAuto merge of #10149 - jyn514:duplicate-sysroot, r=flip1995
bors [Thu, 12 Jan 2023 17:36:00 +0000 (17:36 +0000)]
Auto merge of #10149 - jyn514:duplicate-sysroot, r=flip1995

Don't pass `--sysroot` twice if SYSROOT is set

This is useful for rust-lang/rust to allow setting a sysroot that's *only* for build scripts, different from the regular sysroot passed in RUSTFLAGS (since cargo doesn't apply RUSTFLAGS to build scripts or proc-macros).

That said, the exact motivation is not particularly important: this fixes a regression from
https://github.com/rust-lang/rust-clippy/pull/9881/commits/5907e9155ed7f1312d108aa2110853472da3b029#r1060215684.

Note that only RUSTFLAGS is tested in the new integration test; passing --sysroot through `clippy-driver` never worked as far as I can tell, and no one is using it, so I didn't fix it here.

Helps with https://github.com/rust-lang/rust/pull/106394.

---

changelog: other: `SYSROOT` and `--sysroot` can now be set at the same time
[#10149](https://github.com/rust-lang/rust-clippy/pull/10149)
<!-- changelog_checked -->

18 months agoAdd cargo-clippy sysroot test
Philipp Krones [Thu, 12 Jan 2023 17:30:51 +0000 (18:30 +0100)]
Add cargo-clippy sysroot test

Whne SYSROOT is defined, clippy-driver will insert a --sysroot argument
when calling rustc. However, when a sysroot argument is already defined,
e.g. through RUSTFLAGS=--sysroot=... the `cargo clippy` call would
error. This tests that the sysroot argument is only passed once and that
SYSROOT is ignored in this case.

18 months agoDon't pass `--sysroot` twice if SYSROOT is set
Joshua Nelson [Tue, 3 Jan 2023 18:04:28 +0000 (18:04 +0000)]
Don't pass `--sysroot` twice if SYSROOT is set

This is useful for rust-lang/rust to allow setting a sysroot that's
*only* for build scripts, different from the regular sysroot passed in
RUSTFLAGS (since cargo doesn't apply RUSTFLAGS to build scripts or
proc-macros).

That said, the exact motivation is not particularly important: this
fixes a regression from
https://github.com/rust-lang/rust-clippy/pull/9881/commits/5907e9155ed7f1312d108aa2110853472da3b029#r1060215684.

Note that only RUSTFLAGS is tested in the new integration test; passing
--sysroot through `clippy-driver` never worked as far as I can tell, and
no one is using it, so I didn't fix it here.

18 months agoAuto merge of #106773 - Nilstrieb:rollup-sq73pyg, r=Nilstrieb
bors [Thu, 12 Jan 2023 17:11:03 +0000 (17:11 +0000)]
Auto merge of #106773 - Nilstrieb:rollup-sq73pyg, r=Nilstrieb

Rollup of 6 pull requests

Successful merges:

 - #105806 (Support eager subdiagnostics again)
 - #106322 (Handle inference variables in `CollectAllMismatches` correctly)
 - #106579 (Suggest making private tuple struct field public)
 - #106714 (remove unreachable error code `E0490`)
 - #106751 (Fix rendering 'const' in header for intrinsics)
 - #106761 (Add `WaffleLapkin` to compiler reviewers)

Failed merges:

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

18 months agoAdd test for displayed re-export of `doc(hidden)`
Guillaume Gomez [Thu, 12 Jan 2023 17:03:50 +0000 (18:03 +0100)]
Add test for displayed re-export of `doc(hidden)`

18 months agoFix not displayed re-export of `doc(hidden)` item
Guillaume Gomez [Wed, 11 Jan 2023 19:41:07 +0000 (20:41 +0100)]
Fix not displayed re-export of `doc(hidden)` item

18 months agoAuto merge of #10184 - robertbastian:master, r=xFrednet
bors [Thu, 12 Jan 2023 14:59:41 +0000 (14:59 +0000)]
Auto merge of #10184 - robertbastian:master, r=xFrednet

Allow implementing `Hash` with derived `PartialEq` (`derive_hash_xor_eq`

This is a common pattern and is totally allowed by the `Hash` trait.

Fixes #2627

changelog: Move: Renamed `derive_hash_xor_eq` to [`derived_hash_with_manual_eq`]
[#10184](https://github.com/rust-lang/rust-clippy/pull/10184)
changelog: Enhancement: [`derived_hash_with_manual_eq`]: Now allows `#[derive(PartialEq)]` with custom `Hash` implementations
[#10184](https://github.com/rust-lang/rust-clippy/pull/10184)
<!-- changelog_checked -->

18 months agoRollup merge of #106761 - WaffleLapkin:waffle-is-CompilerReviewer, r=oli-obk
nils [Thu, 12 Jan 2023 14:44:53 +0000 (15:44 +0100)]
Rollup merge of #106761 - WaffleLapkin:waffle-is-CompilerReviewer, r=oli-obk

Add `WaffleLapkin` to compiler reviewers

r? ``@wesleywiser``

18 months agoRollup merge of #106751 - clubby789:const-intrinsic, r=GuillaumeGomez
nils [Thu, 12 Jan 2023 14:44:53 +0000 (15:44 +0100)]
Rollup merge of #106751 - clubby789:const-intrinsic, r=GuillaumeGomez

Fix rendering 'const' in header for intrinsics

Fixes #99398

18 months agoRollup merge of #106714 - Ezrashaw:remove-e0490, r=davidtwco
nils [Thu, 12 Jan 2023 14:44:52 +0000 (15:44 +0100)]
Rollup merge of #106714 - Ezrashaw:remove-e0490, r=davidtwco

remove unreachable error code `E0490`

AFAIK, the untested and undocumented error code `E0490` is now unreachable, it was from the days of the original borrow checker.

cc ``@GuillaumeGomez`` #61137

18 months agoRollup merge of #106579 - estebank:issue-52144, r=Nilstrieb
nils [Thu, 12 Jan 2023 14:44:51 +0000 (15:44 +0100)]
Rollup merge of #106579 - estebank:issue-52144, r=Nilstrieb

Suggest making private tuple struct field public

Fix #52144.

18 months agoRollup merge of #106322 - compiler-errors:CollectAllMismatches-infer-vars, r=oli-obk
nils [Thu, 12 Jan 2023 14:44:51 +0000 (15:44 +0100)]
Rollup merge of #106322 - compiler-errors:CollectAllMismatches-infer-vars, r=oli-obk

Handle inference variables in `CollectAllMismatches` correctly

1. Fix #106240
2. Treat int/float type variables correctly (see `src/test/ui/iterators/invalid-iterator-chain-with-int-infer.rs`), so we can point out things like "`Iterator::Item` changed to `{integer}` here"

18 months agoRollup merge of #105806 - mejrs:eager2, r=davidtwco
nils [Thu, 12 Jan 2023 14:44:50 +0000 (15:44 +0100)]
Rollup merge of #105806 - mejrs:eager2, r=davidtwco

Support eager subdiagnostics again

See https://github.com/rust-lang/rust/pull/104941#discussion_r1051135746

I'm not sure how to add a test for this. But I did pick some of the diagnostic structs in the mentioned PR and it works with them.

18 months agoAdd mw to triagebot.toml
Michael Woerister [Thu, 12 Jan 2023 14:36:15 +0000 (15:36 +0100)]
Add mw to triagebot.toml

18 months agoadd note for float iterator
Petar Dambovaliev [Wed, 11 Jan 2023 19:28:56 +0000 (20:28 +0100)]
add note for float iterator

18 months agoAuto merge of #105603 - oli-obk:non_repeatable_queries, r=petrochenkov
bors [Thu, 12 Jan 2023 13:59:30 +0000 (13:59 +0000)]
Auto merge of #105603 - oli-obk:non_repeatable_queries, r=petrochenkov

Harden the pre-tyctxt query system against accidental recomputation

While the current compiler has no issues where we `take` and then compute the query again, in https://github.com/rust-lang/rust/pull/105462 I accidentally introduced such a case.

I also took the opportunity to remove `peek_mut`, which is only ever used for `global_tcx` to then invoke `enter`. I added an `enter` method directly on the query.

18 months agofix
Robert Bastian [Thu, 12 Jan 2023 13:22:18 +0000 (14:22 +0100)]
fix

18 months agoAuto merge of #10179 - llogiq:trim-suspicious-to-owned-paths, r=xFrednet
bors [Thu, 12 Jan 2023 12:10:56 +0000 (12:10 +0000)]
Auto merge of #10179 - llogiq:trim-suspicious-to-owned-paths, r=xFrednet

trim paths in `suspicious_to_owned`

This continues my path trimming spree. I'm not going to add yet another changelog entry, we should have one "trim paths in some applicable lints" entry instead.

---

changelog: none

18 months agoMark ZST as FFI-safe if all its fields are PhantomData
Arthur Carcano [Tue, 10 Jan 2023 10:38:53 +0000 (11:38 +0100)]
Mark ZST as FFI-safe if all its fields are PhantomData

Modify the linting behavior and add the corresponding
regression test

18 months agoAuto merge of #106760 - compiler-errors:rollup-0bogyco, r=compiler-errors
bors [Thu, 12 Jan 2023 10:46:19 +0000 (10:46 +0000)]
Auto merge of #106760 - compiler-errors:rollup-0bogyco, r=compiler-errors

Rollup of 8 pull requests

Successful merges:

 - #103236 (doc: rewrite doc for signed int::{carrying_add,borrowing_sub})
 - #103800 (Stabilize `::{core,std}::pin::pin!`)
 - #106097 (Migrate mir_build diagnostics 2 of 3)
 - #106170 (Move autoderef to `rustc_hir_analysis`)
 - #106323 (Stabilize f16c_target_feature)
 - #106360 (Tweak E0277 `&`-removal suggestions)
 - #106524 (Label `struct/enum constructor` instead of `fn item`, mention that it should be called on type mismatch)
 - #106739 (Remove `<dyn AstConv<'tcx>>::fun(c, ...)` calls in favour of `c.astconv().fun(...)`)

Failed merges:

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

18 months agoHarden the pre-tyctxt query system against accidental recomputation
Oli Scherer [Mon, 12 Dec 2022 10:48:02 +0000 (10:48 +0000)]
Harden the pre-tyctxt query system against accidental recomputation

18 months agoAuto merge of #106757 - matthiaskrgr:rollup-9j8830g, r=matthiaskrgr
bors [Thu, 12 Jan 2023 07:40:32 +0000 (07:40 +0000)]
Auto merge of #106757 - matthiaskrgr:rollup-9j8830g, r=matthiaskrgr

Rollup of 10 pull requests

Successful merges:

 - #106167 (Fix invalid syntax and incomplete suggestion in impl Trait parameter type suggestions for E0311)
 - #106309 (Prefer non-`[type error]` candidates during selection)
 - #106532 (Allow codegen to unsize `dyn*` to `dyn`)
 - #106596 (Hide more of long types in E0271)
 - #106638 (std tests: use __OsLocalKeyInner from realstd)
 - #106676 (Test that we cannot use trait impl methods arguments as defining uses)
 - #106702 (Conserve cause of `ImplDerivedObligation` in E0599)
 - #106732 (rustc_llvm: replace llvm::makeArrayRef with ArrayRef constructors.)
 - #106733 (Revert "warn newer available version of the x tool")
 - #106748 (Clean up `OnUnimplementedFormatString::verify`)

Failed merges:

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

18 months agoAdd `WaffleLapkin` to compiler reviewers
Maybe Waffle [Thu, 12 Jan 2023 06:53:06 +0000 (06:53 +0000)]
Add `WaffleLapkin` to compiler reviewers

18 months agoRollup merge of #106739 - WaffleLapkin:astconv, r=estebank
Michael Goulet [Thu, 12 Jan 2023 06:25:50 +0000 (22:25 -0800)]
Rollup merge of #106739 - WaffleLapkin:astconv, r=estebank

Remove `<dyn AstConv<'tcx>>::fun(c, ...)` calls in favour of `c.astconv().fun(...)`

This removes the need for <>><><><<>> dances and makes the code a bit nicer.

Not sure if `astconv` is the best name though, maybe someone has a better idea?

18 months agoRollup merge of #106524 - compiler-errors:constructor-note, r=cjgillot
Michael Goulet [Thu, 12 Jan 2023 06:25:49 +0000 (22:25 -0800)]
Rollup merge of #106524 - compiler-errors:constructor-note, r=cjgillot

Label `struct/enum constructor` instead of `fn item`, mention that it should be called on type mismatch

Fixes #106516

18 months agoRollup merge of #106360 - estebank:remove-borrow-suggestion, r=compiler-errors
Michael Goulet [Thu, 12 Jan 2023 06:25:49 +0000 (22:25 -0800)]
Rollup merge of #106360 - estebank:remove-borrow-suggestion, r=compiler-errors

Tweak E0277 `&`-removal suggestions

Fix #64068, fix #84837.

18 months agoRollup merge of #106323 - starkat99:stabilize-f16c_target_feature, r=petrochenkov
Michael Goulet [Thu, 12 Jan 2023 06:25:48 +0000 (22:25 -0800)]
Rollup merge of #106323 - starkat99:stabilize-f16c_target_feature, r=petrochenkov

Stabilize f16c_target_feature

Resolves https://github.com/rust-lang/stdarch/issues/1234

Library PR for stabilizing corresponding intrinsics: https://github.com/rust-lang/stdarch/pull/1366

See also #44839 tracking issue for target_feature

18 months agoRollup merge of #106170 - compiler-errors:autoderef-to-analysis, r=lcnr
Michael Goulet [Thu, 12 Jan 2023 06:25:48 +0000 (22:25 -0800)]
Rollup merge of #106170 - compiler-errors:autoderef-to-analysis, r=lcnr

Move autoderef to `rustc_hir_analysis`

Not sure if this is a change we actually want, but autoderef really is only (functionally) used by `rustc_hir_analysis` and `rustc_hir_typeck`, so it probably should live there.

Instead, implement a separate autoderef helper in `TypeErrCtxt` for the one use-case that  goes against the ordering of the crate graph..

18 months agoRollup merge of #106097 - mejrs:mir_build2, r=oli-obk
Michael Goulet [Thu, 12 Jan 2023 06:25:47 +0000 (22:25 -0800)]
Rollup merge of #106097 - mejrs:mir_build2, r=oli-obk

Migrate mir_build diagnostics 2 of 3

The first three commits are fairly boring, however I've made some changes to the output of the match checking diagnostics.

18 months agoRollup merge of #103800 - danielhenrymantilla:stabilize-pin-macro, r=dtolnay
Michael Goulet [Thu, 12 Jan 2023 06:25:47 +0000 (22:25 -0800)]
Rollup merge of #103800 - danielhenrymantilla:stabilize-pin-macro, r=dtolnay

Stabilize `::{core,std}::pin::pin!`

As discussed [over here](https://github.com/rust-lang/rust/issues/93178#issuecomment-1295843548), it looks like a decent time to stabilize the `pin!` macro.

### Public API

```rust
// in module `core::pin`

/// API: `fn pin<T>($value: T) -> Pin<&'local mut T>`
pub macro pin($value:expr $(,)?) {
    …
}
```

  - Tracking issue: #93178

(now all this needs is an FCP by the proper team?)

18 months agoRollup merge of #103236 - tspiteri:redoc-int-adc-sbb, r=m-ou-se
Michael Goulet [Thu, 12 Jan 2023 06:25:46 +0000 (22:25 -0800)]
Rollup merge of #103236 - tspiteri:redoc-int-adc-sbb, r=m-ou-se

doc: rewrite doc for signed int::{carrying_add,borrowing_sub}

Reword the documentation for bigint helper methods, signed `int::{carrying_add,borrowing_sub}` (#85532).

This change is a follow-up to #101889, which was for the unsigned methods.

18 months agoRevert "Make nested RPITIT inherit the parent opaque's generics." and adjust test
Michael Goulet [Thu, 12 Jan 2023 06:07:53 +0000 (06:07 +0000)]
Revert "Make nested RPITIT inherit the parent opaque's generics." and adjust test

This reverts commit e2d41f4c974f0cc09e5aafb02883f222487610f9.

18 months agoRollup merge of #106748 - clubby789:on-unimplemented-fmt-verify, r=compiler-errors
Matthias Krüger [Thu, 12 Jan 2023 05:52:39 +0000 (06:52 +0100)]
Rollup merge of #106748 - clubby789:on-unimplemented-fmt-verify, r=compiler-errors

Clean up `OnUnimplementedFormatString::verify`

Lift the always-allowed symbols to a static array and replace a `match iter().find(...)` with `iter().any(...)`

18 months agoRollup merge of #106733 - DebugSteven:revert-104552-warn-newer-x, r=jyn514
Matthias Krüger [Thu, 12 Jan 2023 05:52:39 +0000 (06:52 +0100)]
Rollup merge of #106733 - DebugSteven:revert-104552-warn-newer-x, r=jyn514

Revert "warn newer available version of the x tool"

Reverts rust-lang/rust#104552

Running the x executable directly created an [issue](https://github.com/rust-lang/rust/issues/106469) here. There are other options for warning a user that a newer version of x exists in the issue's discussion as well.

r? `@jyn514`

18 months agoRollup merge of #106732 - durin42:dmitrig-arrayref-ctor, r=nikic
Matthias Krüger [Thu, 12 Jan 2023 05:52:38 +0000 (06:52 +0100)]
Rollup merge of #106732 - durin42:dmitrig-arrayref-ctor, r=nikic

rustc_llvm: replace llvm::makeArrayRef with ArrayRef constructors.

LLVM upstream has deprecated llvm::makeArrayRef and will remove it.

18 months agoRollup merge of #106702 - estebank:trait-bounds, r=compiler-errors
Matthias Krüger [Thu, 12 Jan 2023 05:52:38 +0000 (06:52 +0100)]
Rollup merge of #106702 - estebank:trait-bounds, r=compiler-errors

Conserve cause of `ImplDerivedObligation` in E0599

CC #86377.

18 months agoRollup merge of #106676 - oli-obk:tait_test, r=dtolnay
Matthias Krüger [Thu, 12 Jan 2023 05:52:37 +0000 (06:52 +0100)]
Rollup merge of #106676 - oli-obk:tait_test, r=dtolnay

Test that we cannot use trait impl methods arguments as defining uses

Addresses https://github.com/rust-lang/rust/issues/63063#issuecomment-1360053614

r? `@dtolnay`

18 months agoRollup merge of #106638 - RalfJung:realstd, r=thomcc
Matthias Krüger [Thu, 12 Jan 2023 05:52:37 +0000 (06:52 +0100)]
Rollup merge of #106638 - RalfJung:realstd, r=thomcc

std tests: use __OsLocalKeyInner from realstd

This is basically the same as https://github.com/rust-lang/rust/pull/100201, but for __OsLocalKeyInner:

Some std tests are failing in Miri on Windows because [this static](https://github.com/rust-lang/rust/blob/a377893da2cd7124e5a18c7116cbb70e16dd5541/library/std/src/sys/windows/thread_local_key.rs#L234-L239) is getting duplicated, and Miri does not handle that properly -- Miri does not support this magic `.CRT$XLB` linker section, but instead just looks up this particular hard-coded static in the standard library. This PR lets the test suite use the std static instead of having its own copy.

Fixes https://github.com/rust-lang/miri/issues/2754
r? `@thomcc`

18 months agoRollup merge of #106596 - estebank:verbose-e0271, r=compiler-errors
Matthias Krüger [Thu, 12 Jan 2023 05:52:36 +0000 (06:52 +0100)]
Rollup merge of #106596 - estebank:verbose-e0271, r=compiler-errors

Hide more of long types in E0271

Fix #40186.

18 months agoRollup merge of #106532 - compiler-errors:dyn-star-to-dyn, r=jackh726
Matthias Krüger [Thu, 12 Jan 2023 05:52:35 +0000 (06:52 +0100)]
Rollup merge of #106532 - compiler-errors:dyn-star-to-dyn, r=jackh726

Allow codegen to unsize `dyn*` to `dyn`

`dyn* Trait` is just another type that implements `Trait`, so we should be able to unsize `&dyn* Trait` into `&dyn Trait` perfectly fine, same for `Box` and other unsizeable types.

Fixes #106488

18 months agoRollup merge of #106309 - compiler-errors:prefer-non-err-candidates, r=oli-obk
Matthias Krüger [Thu, 12 Jan 2023 05:52:34 +0000 (06:52 +0100)]
Rollup merge of #106309 - compiler-errors:prefer-non-err-candidates, r=oli-obk

Prefer non-`[type error]` candidates during selection

Fixes #102130
Fixes #106351

r? types

note: Alternatively we could filter out error where-clauses during param-env construction? But we still need to filter out impls with errors during `match_impl`, I think.

18 months agoRollup merge of #106167 - yanchen4791:issue-105544-fix, r=oli-obk
Matthias Krüger [Thu, 12 Jan 2023 05:52:34 +0000 (06:52 +0100)]
Rollup merge of #106167 - yanchen4791:issue-105544-fix, r=oli-obk

Fix invalid syntax and incomplete suggestion in impl Trait parameter type suggestions for E0311

Fixes #105544

The problems: The suggestion given for E0311 has invalid syntax when the synthetic type parameter is used for Trait type in function declaration:
```rust
fn foo(d: impl Sized) -> impl Sized
```
instead of explicitly specified like the following:
```rust
fn foo<T: Sized>(d: T) -> impl Sized
```
In addition to the syntax error, the suggestions given for E0311 are not complete when multiple elided lifetimes are involved in lifetime bounds, not all involved parameters are given the named lifetime in the suggestions. For the following test case:
```
fn foo(d: impl Sized, p: &mut ()) -> impl Sized + '_ {
    (d, p)
}
```
a good suggestion should add the lifetime 'a to both d and p, instead of d only:
```
fn foo<'a>(d: impl Sized + 'a, p: &'a mut ()) -> impl Sized + '_ {
    (d, p)
}
```

The Solution: Fix the syntax problem in the suggestions when synthetic type parameter is used, and also add lifetimes for all involved parameters.

18 months agoAuto merge of #106711 - albertlarsan68:use-ci-llvm-when-lld, r=jyn514
bors [Thu, 12 Jan 2023 04:58:03 +0000 (04:58 +0000)]
Auto merge of #106711 - albertlarsan68:use-ci-llvm-when-lld, r=jyn514

Use CI LLVM in `test-various` builder

It was disabled because it needs `lld`, but since #104748 was merged it is no longer needed.

This will speed this test, since it no longer needs to build LLVM.

18 months agomove to correct test
Deadbeef [Thu, 12 Jan 2023 04:20:00 +0000 (04:20 +0000)]
move to correct test

18 months agoFix rendering 'const' for intrinsics
clubby789 [Thu, 12 Jan 2023 03:19:08 +0000 (03:19 +0000)]
Fix rendering 'const' for intrinsics

18 months agotest use in libcore
Deadbeef [Mon, 26 Dec 2022 10:48:54 +0000 (10:48 +0000)]
test use in libcore

18 months agofix fmt and bless
Deadbeef [Thu, 22 Dec 2022 18:15:15 +0000 (18:15 +0000)]
fix fmt and bless

18 months agofix fn_sig ice
Deadbeef [Thu, 22 Dec 2022 07:19:15 +0000 (07:19 +0000)]
fix fn_sig ice

18 months agoattempt to make a minimal example work
Deadbeef [Wed, 21 Dec 2022 16:32:16 +0000 (16:32 +0000)]
attempt to make a minimal example work

18 months agosuggest adding const_trait_impl if error because of that
Deadbeef [Wed, 21 Dec 2022 15:47:33 +0000 (15:47 +0000)]
suggest adding const_trait_impl if error because of that

18 months agogate const closures
Deadbeef [Wed, 21 Dec 2022 14:51:02 +0000 (14:51 +0000)]
gate const closures

18 months agoparse const closures
Deadbeef [Tue, 20 Dec 2022 16:15:55 +0000 (16:15 +0000)]
parse const closures

18 months agoAuto merge of #106537 - fmease:recover-where-clause-before-tuple-struct-body, r=estebank
bors [Thu, 12 Jan 2023 02:16:16 +0000 (02:16 +0000)]
Auto merge of #106537 - fmease:recover-where-clause-before-tuple-struct-body, r=estebank

Recover from where clauses placed before tuple struct bodies

Open to any suggestions regarding the phrasing of the diagnostic.

Fixes #100790.
`@rustbot` label A-diagnostics
r? diagnostics

18 months agoStabilize `abi_efiapi` feature
Nicholas Bishop [Fri, 16 Dec 2022 20:02:22 +0000 (15:02 -0500)]
Stabilize `abi_efiapi` feature

Tracking issue: https://github.com/rust-lang/rust/issues/65815

18 months agoremove unreachable error code `E0490`
Ezra Shaw [Wed, 11 Jan 2023 09:46:14 +0000 (22:46 +1300)]
remove unreachable error code `E0490`

18 months agoAuto merge of #10189 - Alexendoo:copy-packed-struct, r=giraffate
bors [Thu, 12 Jan 2023 00:29:30 +0000 (00:29 +0000)]
Auto merge of #10189 - Alexendoo:copy-packed-struct, r=giraffate

expl_impl_clone_on_copy: ignore packed structs with type/const params

changelog: [`expl_impl_clone_on_copy`]: Ignore `#[repr(packed)]` structs with type or const paramaters

Fixes #10188

A more involved solution that checks if any bound on the trait impl aren't present on the struct definition would be ideal, but I couldn't see a nice way to go about that

18 months agoAuto merge of #106743 - matthiaskrgr:rollup-q5dpxms, r=matthiaskrgr
bors [Wed, 11 Jan 2023 23:05:58 +0000 (23:05 +0000)]
Auto merge of #106743 - matthiaskrgr:rollup-q5dpxms, r=matthiaskrgr

Rollup of 6 pull requests

Successful merges:

 - #106620 (Detect struct literal needing parentheses)
 - #106622 (Detect out of bounds range pattern value)
 - #106703 (Note predicate span on `ImplDerivedObligation`)
 - #106705 (Report fulfillment errors in new trait solver)
 - #106726 (Fix some typos in code comments.)
 - #106734 (Deny having src/test exisiting in tidy)

Failed merges:

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

18 months agoClean up `OnUnimplementedFormatString::verify`
clubby789 [Wed, 11 Jan 2023 22:54:46 +0000 (22:54 +0000)]
Clean up `OnUnimplementedFormatString::verify`

18 months agoFix invalid syntax in impl Trait parameter type suggestions for E0311
yanchen4791 [Mon, 26 Dec 2022 23:43:31 +0000 (15:43 -0800)]
Fix invalid syntax in impl Trait parameter type suggestions for E0311

18 months agoTranslate `Overlap` eagerly
mejrs [Mon, 9 Jan 2023 21:37:56 +0000 (22:37 +0100)]
Translate `Overlap` eagerly

18 months agoSome cleanup, oops
mejrs [Fri, 23 Dec 2022 21:26:12 +0000 (22:26 +0100)]
Some cleanup, oops

18 months agoDon't recommend `if let` if `let else` works
mejrs [Fri, 23 Dec 2022 21:23:37 +0000 (22:23 +0100)]
Don't recommend `if let` if `let else` works

18 months agoMigrate pattern matching
mejrs [Fri, 23 Dec 2022 20:02:23 +0000 (21:02 +0100)]
Migrate pattern matching

18 months agoMigrate usefulness.rs
mejrs [Tue, 20 Dec 2022 20:24:18 +0000 (21:24 +0100)]
Migrate usefulness.rs

18 months agoMigrate deconstruct_pat.rs
mejrs [Tue, 20 Dec 2022 15:43:34 +0000 (16:43 +0100)]
Migrate deconstruct_pat.rs

18 months agoTranslate const_to_pat.rs
mejrs [Mon, 19 Dec 2022 23:28:33 +0000 (00:28 +0100)]
Translate const_to_pat.rs

18 months agoadd checks for the signature of the lang item
asquared31415 [Fri, 23 Dec 2022 18:54:14 +0000 (13:54 -0500)]
add checks for the signature of the  lang item

18 months agoSupport eager subdiagnostics again
mejrs [Sun, 8 Jan 2023 23:00:41 +0000 (00:00 +0100)]
Support eager subdiagnostics again

18 months agoStabilize `::{core,std}::pin::pin!`
Daniel Henry-Mantilla [Mon, 31 Oct 2022 12:07:40 +0000 (13:07 +0100)]
Stabilize `::{core,std}::pin::pin!`

18 months agoTest that we cannot use trait impl methods arguments as defining uses
Oli Scherer [Tue, 10 Jan 2023 11:23:58 +0000 (11:23 +0000)]
Test that we cannot use trait impl methods arguments as defining uses

18 months agoHide more of long types in E0271
Esteban Küber [Sun, 8 Jan 2023 18:41:09 +0000 (18:41 +0000)]
Hide more of long types in E0271

Fix #40186.

18 months agoUse the root trait predicate to determine whether to remove references
Esteban Küber [Mon, 9 Jan 2023 04:43:18 +0000 (04:43 +0000)]
Use the root trait predicate to determine whether to remove references

Fix #84837.

18 months agofix rebase
Esteban Küber [Sat, 7 Jan 2023 19:35:40 +0000 (19:35 +0000)]
fix rebase

18 months agoAccount for type params
Esteban Küber [Mon, 2 Jan 2023 03:35:53 +0000 (19:35 -0800)]
Account for type params

18 months agoMake `&`-removal suggestion verbose
Esteban Küber [Mon, 2 Jan 2023 02:43:47 +0000 (18:43 -0800)]
Make `&`-removal suggestion verbose

18 months agoreview comments: Tweak output
Esteban Küber [Tue, 10 Jan 2023 20:57:02 +0000 (20:57 +0000)]
review comments: Tweak output

* Account for `struct S(pub(super)Ty);` in suggestion
* Suggest changing field visibility in E0603 too