]> git.lizzy.rs Git - rust.git/log
rust.git
18 months agois_ty_infer -> is_ty_or_numeric_infer
Michael Goulet [Wed, 11 Jan 2023 22:20:56 +0000 (22:20 +0000)]
is_ty_infer -> is_ty_or_numeric_infer

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 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 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 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 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 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 agoFix rendering 'const' for intrinsics
clubby789 [Thu, 12 Jan 2023 03:19:08 +0000 (03:19 +0000)]
Fix rendering 'const' for intrinsics

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 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 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

18 months agoreview comment
Esteban Küber [Sun, 8 Jan 2023 07:18:07 +0000 (07:18 +0000)]
review comment

18 months agoSuggest making private tuple struct field public
Esteban Küber [Sun, 8 Jan 2023 01:15:28 +0000 (01:15 +0000)]
Suggest making private tuple struct field public

Fix #52144.

18 months agoMove autoderef to rustc_hir_analysis
Michael Goulet [Tue, 27 Dec 2022 00:39:36 +0000 (00:39 +0000)]
Move autoderef to rustc_hir_analysis

18 months agoRollup merge of #106734 - albertlarsan68:deny-src-tests-in-tidy, r=Nilstrieb
Matthias Krüger [Wed, 11 Jan 2023 20:08:10 +0000 (21:08 +0100)]
Rollup merge of #106734 - albertlarsan68:deny-src-tests-in-tidy, r=Nilstrieb

Deny having src/test exisiting in tidy

Fixes #106724

18 months agoRollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
Matthias Krüger [Wed, 11 Jan 2023 20:08:09 +0000 (21:08 +0100)]
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb

Fix some typos in code comments.

18 months agoRollup merge of #106705 - compiler-errors:new-solver-err-properly, r=lcnr
Matthias Krüger [Wed, 11 Jan 2023 20:08:09 +0000 (21:08 +0100)]
Rollup merge of #106705 - compiler-errors:new-solver-err-properly, r=lcnr

Report fulfillment errors in new trait solver

Causes fewer ICEs when testing the new solver :smile:

18 months agoRollup merge of #106703 - compiler-errors:impl-derived-span, r=estebank
Matthias Krüger [Wed, 11 Jan 2023 20:08:08 +0000 (21:08 +0100)]
Rollup merge of #106703 - compiler-errors:impl-derived-span, r=estebank

Note predicate span on `ImplDerivedObligation`

Seems obvious to point out the where-clause that introduces the `ImplDerivedObligation` :)

r? `@estebank`

18 months agoRollup merge of #106622 - estebank:issue-68972, r=davidtwco
Matthias Krüger [Wed, 11 Jan 2023 20:08:07 +0000 (21:08 +0100)]
Rollup merge of #106622 - estebank:issue-68972, r=davidtwco

Detect out of bounds range pattern value

Fix #68972.

18 months agoRollup merge of #106620 - estebank:issue-82051, r=davidtwco
Matthias Krüger [Wed, 11 Jan 2023 20:08:07 +0000 (21:08 +0100)]
Rollup merge of #106620 - estebank:issue-82051, r=davidtwco

Detect struct literal needing parentheses

Fix #82051.

18 months agoFilter impl and where-clause candidates that reference errors
Michael Goulet [Sun, 1 Jan 2023 23:48:10 +0000 (23:48 +0000)]
Filter impl and where-clause candidates that reference errors

18 months agoReuse ErrorGuaranteed during relation
Michael Goulet [Fri, 30 Dec 2022 21:51:12 +0000 (21:51 +0000)]
Reuse ErrorGuaranteed during relation

18 months agoHandle inference variables in CollectAllMismatches correctly
Michael Goulet [Sat, 31 Dec 2022 03:03:28 +0000 (03:03 +0000)]
Handle inference variables in CollectAllMismatches correctly

18 months agoAuto merge of #106660 - saethlin:destprop-move-codegen, r=tmiasko
bors [Wed, 11 Jan 2023 19:56:44 +0000 (19:56 +0000)]
Auto merge of #106660 - saethlin:destprop-move-codegen, r=tmiasko

Add a regression test for argument copies with DestinationPropagation

This example, as a codegen test: https://github.com/rust-lang/rust/pull/105813#issuecomment-1367947793

r? `@tmiasko`

18 months agolabel where constructor is defined and note that it should be called
Michael Goulet [Fri, 6 Jan 2023 03:33:57 +0000 (03:33 +0000)]
label where constructor is defined and note that it should be called

18 months agoBe more specific about constructor `FnDef`s in type mismatch
Michael Goulet [Fri, 6 Jan 2023 03:09:14 +0000 (03:09 +0000)]
Be more specific about constructor `FnDef`s in type mismatch

18 months agoAllow codegen to unsize dyn* to dyn
Michael Goulet [Fri, 6 Jan 2023 08:47:35 +0000 (08:47 +0000)]
Allow codegen to unsize dyn* to dyn

18 months agoNote predicate span on ImplDerivedObligation
Michael Goulet [Wed, 11 Jan 2023 03:21:11 +0000 (03:21 +0000)]
Note predicate span on ImplDerivedObligation

18 months agoTweak output
Esteban Küber [Wed, 11 Jan 2023 04:11:06 +0000 (04:11 +0000)]
Tweak output

18 months agoConserve cause of `ImplDerivedObligation` in E0599
Esteban Küber [Wed, 11 Jan 2023 03:07:14 +0000 (03:07 +0000)]
Conserve cause of `ImplDerivedObligation` in E0599

CC #86377.

18 months agokeep --wrapper-version argument in x
DebugSteven [Wed, 11 Jan 2023 19:13:35 +0000 (12:13 -0700)]
keep --wrapper-version argument in x

18 months agoMake selfless `dyn AstConv` methods into toplevel functions
Maybe Waffle [Wed, 11 Jan 2023 19:07:03 +0000 (19:07 +0000)]
Make selfless `dyn AstConv` methods into toplevel functions

18 months agoAdd `AstConv::astconv` method to remove `<dyn AstConv>::` calls
Maybe Waffle [Wed, 11 Jan 2023 18:58:44 +0000 (18:58 +0000)]
Add `AstConv::astconv` method to remove `<dyn AstConv>::` calls

18 months agoDeny having src/test exisiting in tidy
Albert Larsan [Wed, 11 Jan 2023 18:25:33 +0000 (18:25 +0000)]
Deny having src/test exisiting in tidy

18 months agoRevert "warn newer available version of the x tool"
J Haigh [Wed, 11 Jan 2023 18:11:56 +0000 (11:11 -0700)]
Revert "warn newer available version of the x tool"

18 months agoReport fulfillment errors in new trait solver
Michael Goulet [Wed, 11 Jan 2023 03:54:46 +0000 (03:54 +0000)]
Report fulfillment errors in new trait solver

18 months agoexpl_impl_clone_on_copy: ignore packed structs with type/const params
Alex Macleod [Wed, 11 Jan 2023 17:25:47 +0000 (17:25 +0000)]
expl_impl_clone_on_copy: ignore packed structs with type/const params

18 months agoAuto merge of #106730 - Nilstrieb:rollup-f7p8dsa, r=Nilstrieb
bors [Wed, 11 Jan 2023 17:01:44 +0000 (17:01 +0000)]
Auto merge of #106730 - Nilstrieb:rollup-f7p8dsa, r=Nilstrieb

Rollup of 9 pull requests

Successful merges:

 - #106321 (Collect and emit proper backtraces for `delay_span_bug`s)
 - #106397 (Check `impl`'s `where` clauses in `consider_impl_candidate` in experimental solver)
 - #106427 (Improve fluent error messages)
 - #106570 (add tests for div_duration_* functions)
 - #106648 (Polymorphization cleanup)
 - #106664 (Remove unnecessary lseek syscall when using std::fs::read)
 - #106709 (Disable "split dwarf inlining" by default.)
 - #106715 (Autolabel and ping wg for changes to new solver)
 - #106717 (fix typo LocalItemId -> ItemLocalId)

Failed merges:

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

18 months agoparser: recover from where clauses placed before tuple struct bodies
León Orell Valerian Liehr [Fri, 6 Jan 2023 16:47:21 +0000 (17:47 +0100)]
parser: recover from where clauses placed before tuple struct bodies

18 months agoDetect struct literal needing parentheses
Esteban Küber [Mon, 9 Jan 2023 05:29:54 +0000 (05:29 +0000)]
Detect struct literal needing parentheses

Fix #82051.

18 months agoDetect out of bounds range pattern value
Esteban Küber [Mon, 9 Jan 2023 07:10:17 +0000 (07:10 +0000)]
Detect out of bounds range pattern value

Fix #68972.