]> git.lizzy.rs Git - rust.git/log
rust.git
18 months agoPoint at args in associated const fn pointers
Michael Goulet [Tue, 6 Dec 2022 03:50:48 +0000 (03:50 +0000)]
Point at args in associated const fn pointers

18 months agoAuto merge of #105328 - matthiaskrgr:rollup-qnfksmq, r=matthiaskrgr
bors [Mon, 5 Dec 2022 21:46:58 +0000 (21:46 +0000)]
Auto merge of #105328 - matthiaskrgr:rollup-qnfksmq, r=matthiaskrgr

Rollup of 8 pull requests

Successful merges:

 - #104912 (PartialEq: PERs are homogeneous)
 - #104952 (Streamline the user experience for `x.py setup`)
 - #104953 (Ensure required submodules at the same time as updating existing submodules)
 - #105180 (Use proper HirId for async track_caller attribute check)
 - #105222 (std update libc version and freebsd image build dependencies)
 - #105223 (suggest parenthesis around ExprWithBlock BinOp ExprWithBlock)
 - #105230 (Skip recording resolution for duplicated generic params.)
 - #105301 (update Miri)

Failed merges:

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

18 months agoRollup merge of #105301 - RalfJung:miri, r=oli-obk
Matthias Krüger [Mon, 5 Dec 2022 19:43:45 +0000 (20:43 +0100)]
Rollup merge of #105301 - RalfJung:miri, r=oli-obk

update Miri

Let's ship the work-around for https://github.com/rust-lang/unsafe-code-guidelines/issues/381.

18 months agoRollup merge of #105230 - cjgillot:issue-104312, r=petrochenkov
Matthias Krüger [Mon, 5 Dec 2022 19:43:44 +0000 (20:43 +0100)]
Rollup merge of #105230 - cjgillot:issue-104312, r=petrochenkov

Skip recording resolution for duplicated generic params.

Turns out the fix was simpler than I thought.

Fixes https://github.com/rust-lang/rust/issues/104312

18 months agoRollup merge of #105223 - lukas-code:(ExprWithBlock), r=petrochenkov
Matthias Krüger [Mon, 5 Dec 2022 19:43:44 +0000 (20:43 +0100)]
Rollup merge of #105223 - lukas-code:(ExprWithBlock), r=petrochenkov

suggest parenthesis around ExprWithBlock BinOp ExprWithBlock

fix https://github.com/rust-lang/rust/issues/105179
fix https://github.com/rust-lang/rust/issues/102171

18 months agoRollup merge of #105222 - devnexen:fbsd_update_img, r=petrochenkov
Matthias Krüger [Mon, 5 Dec 2022 19:43:43 +0000 (20:43 +0100)]
Rollup merge of #105222 - devnexen:fbsd_update_img, r=petrochenkov

std update libc version and freebsd image build dependencies

18 months agoRollup merge of #105180 - nbdd0121:async_track_caller, r=compiler-errors
Matthias Krüger [Mon, 5 Dec 2022 19:43:42 +0000 (20:43 +0100)]
Rollup merge of #105180 - nbdd0121:async_track_caller, r=compiler-errors

Use proper HirId for async track_caller attribute check

Fix #105134

18 months agoRollup merge of #104953 - jyn514:fewer-submodule-updates, r=Mark-Simulacrum
Matthias Krüger [Mon, 5 Dec 2022 19:43:42 +0000 (20:43 +0100)]
Rollup merge of #104953 - jyn514:fewer-submodule-updates, r=Mark-Simulacrum

Ensure required submodules at the same time as updating existing submodules

In practice, this would always happen at the same time, but putting them next to each other makes that more obvious and ensures it doesn't change in the future. It also avoids the difference affecting `cargo metadata` somehow.

This is based on https://github.com/rust-lang/rust/pull/104952 for convenience to avoid merge conflicts, but doesn't depend on that PR.

18 months agoRollup merge of #104952 - jyn514:setup, r=Mark-Simulacrum
Matthias Krüger [Mon, 5 Dec 2022 19:43:41 +0000 (20:43 +0100)]
Rollup merge of #104952 - jyn514:setup, r=Mark-Simulacrum

Streamline the user experience for `x.py setup`

## Don't update submodules for x setup

Before, the submodule handling was very jank and would update *between two interactive prompts*:
```
; x setup
Building rustbuild
    Finished dev [unoptimized] target(s) in 0.05s
Welcome to the Rust project! What do you want to do with x.py?
a) library: Contribute to the standard library
Please choose one (a/b/c/d/e): a
Updating submodule library/backtrace
Submodule 'library/backtrace' (https://github.com/rust-lang/backtrace-rs.git) registered for path 'library/backtrace'
error: you asked `x.py` to setup a new config file, but one already exists at `config.toml`
Build completed unsuccessfully in 0:00:02
```

That's not a great user experience because you need to wait a long time between prompts.
It would be possible to move the submodule handling either before or after the prompt, but it seems
better to just not require submodules to be checked out at all, to minimize the time spend waiting
just to create a new configuration.

## Revamp the order setup executes

- Create `config.toml` last. It's the most likely to error, and used to stop later steps from executing
- Don't print an error message + exit if the git hook already exists; that's expected

18 months agoRollup merge of #104912 - RalfJung:per, r=Mark-Simulacrum
Matthias Krüger [Mon, 5 Dec 2022 19:43:40 +0000 (20:43 +0100)]
Rollup merge of #104912 - RalfJung:per, r=Mark-Simulacrum

PartialEq: PERs are homogeneous

PartialEq claims that it corresponds to a PER, but that is only a well-defined statement when `Rhs == Self`. There is no standard notion of PER on a relation between two different sets/types. So move this out of the first paragraph and clarify this.

18 months agoAuto merge of #105176 - klensy:docker-smol, r=Mark-Simulacrum
bors [Mon, 5 Dec 2022 17:26:19 +0000 (17:26 +0000)]
Auto merge of #105176 - klensy:docker-smol, r=Mark-Simulacrum

CI: reduce docker image sizes

Reduces docker image sizes by using simple tips like: cleaning packet managers cache, squashing sequential installation steps into one.

For some images this gives ~40mb for apt-based images (not so much), but ~200mb(!) for centos one.

18 months agoAuto merge of #2715 - RalfJung:rustup, r=RalfJung
bors [Mon, 5 Dec 2022 12:55:36 +0000 (12:55 +0000)]
Auto merge of #2715 - RalfJung:rustup, r=RalfJung

Rustup

18 months agoMerge from rustc
Ralf Jung [Mon, 5 Dec 2022 12:52:53 +0000 (13:52 +0100)]
Merge from rustc

18 months agoPreparing for merge from rustc
Ralf Jung [Mon, 5 Dec 2022 12:51:41 +0000 (13:51 +0100)]
Preparing for merge from rustc

18 months agoAuto merge of #105046 - scottmcm:vecdeque-vs-vec, r=Mark-Simulacrum
bors [Mon, 5 Dec 2022 08:45:03 +0000 (08:45 +0000)]
Auto merge of #105046 - scottmcm:vecdeque-vs-vec, r=Mark-Simulacrum

Send `VecDeque::from_iter` via `Vec::from_iter`

Since it's O(1) to convert between them now, might as well reuse the logic.

Mostly for the various specializations it does, but might also save some monomorphization work if, say, people collect slice iterators into both `Vec`s and `VecDeque`s.

18 months agoAuto merge of #104824 - klensy:bump-some, r=Mark-Simulacrum
bors [Mon, 5 Dec 2022 05:54:33 +0000 (05:54 +0000)]
Auto merge of #104824 - klensy:bump-some, r=Mark-Simulacrum

deps: update cpufeatures, swap difference to dissimilar

Updating cpufeatures v0.2.1 -> v0.2.5: https://github.com/RustCrypto/utils/blob/master/cpufeatures/CHANGELOG.md#025-2022-09-04, was yanked bc of miscompile (https://github.com/RustCrypto/utils/pull/800, https://github.com/rust-lang/rust/issues/101346)

Removing difference v2.0.0
     Adding dissimilar v1.0.4
   Updating expect-test v1.0.1 -> v1.4.0

difference unmaintened https://rustsec.org/advisories/RUSTSEC-2020-0095.html, so replaced with https://github.com/dtolnay/dissimilar (as dependency of `expect-test`)

18 months agoAdd fixme note
Gary Guo [Mon, 5 Dec 2022 03:18:26 +0000 (03:18 +0000)]
Add fixme note

18 months agoAuto merge of #104920 - compiler-errors:avoid-infcx-build, r=jackh726
bors [Mon, 5 Dec 2022 02:51:06 +0000 (02:51 +0000)]
Auto merge of #104920 - compiler-errors:avoid-infcx-build, r=jackh726

Avoid some `InferCtxt::build` calls

Either because we're inside of an `InferCtxt` already, or because we're not in a place where we'd ever see inference vars.

r? types

18 months agoAuto merge of #105094 - Swatinem:generator-not-future, r=compiler-errors
bors [Sun, 4 Dec 2022 22:46:11 +0000 (22:46 +0000)]
Auto merge of #105094 - Swatinem:generator-not-future, r=compiler-errors

Make sure async constructs do not `impl Generator`

Async lowering turns async functions and blocks into generators internally.
Though these special kinds of generators should not `impl Generator` themselves.
The other way around, normal generators should not `impl Future`.

This was discovered in https://github.com/rust-lang/rust/pull/105082#issuecomment-1332210907 and is a regression from https://github.com/rust-lang/rust/pull/104321.

r? `@compiler-errors`

18 months agoAvoid InferCtxt::build in generic_arg_mismatch_err
Michael Goulet [Sat, 26 Nov 2022 00:23:28 +0000 (00:23 +0000)]
Avoid InferCtxt::build in generic_arg_mismatch_err

18 months agoAvoid InferCtxt::build in report_similar_impl_candidates
Michael Goulet [Sat, 26 Nov 2022 00:18:16 +0000 (00:18 +0000)]
Avoid InferCtxt::build in report_similar_impl_candidates

18 months agoAuto merge of #104535 - mikebenfield:discr-fix, r=pnkfelix
bors [Sun, 4 Dec 2022 20:05:32 +0000 (20:05 +0000)]
Auto merge of #104535 - mikebenfield:discr-fix, r=pnkfelix

rustc_codegen_ssa: Fix for codegen_get_discr

When doing the optimized implementation of getting the discriminant, the arithmetic needs to be done in the tag type so wrapping behavior works correctly.

Fixes #104519

18 months agoAuto merge of #105261 - matthiaskrgr:rollup-9ghhc9c, r=matthiaskrgr
bors [Sun, 4 Dec 2022 16:32:21 +0000 (16:32 +0000)]
Auto merge of #105261 - matthiaskrgr:rollup-9ghhc9c, r=matthiaskrgr

Rollup of 6 pull requests

Successful merges:

 - #101975 (Suggest to use . instead of :: when accessing a method of an object)
 - #105141 (Fix ICE on invalid variable declarations in macro calls)
 - #105224 (Properly substitute inherent associated types.)
 - #105236 (Add regression test for #47814)
 - #105247 (Use parent function WfCheckingContext to check RPITIT.)
 - #105253 (Update a couple of rustbuild deps)

Failed merges:

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

18 months agoRollup merge of #105253 - bjorn3:update_rustbuild_deps, r=jyn514
Matthias Krüger [Sun, 4 Dec 2022 15:25:34 +0000 (16:25 +0100)]
Rollup merge of #105253 - bjorn3:update_rustbuild_deps, r=jyn514

Update a couple of rustbuild deps

These mostly remove some dependency edges potentially making compilation of rustbuild itself a tiny bit faster. I hoped to be able to completely remove some dependencies, but other than replacing ansi_term with yansi all dependencies are still used.

18 months agoRollup merge of #105247 - cjgillot:issue-102682, r=compiler-errors
Matthias Krüger [Sun, 4 Dec 2022 15:25:34 +0000 (16:25 +0100)]
Rollup merge of #105247 - cjgillot:issue-102682, r=compiler-errors

Use parent function WfCheckingContext to check RPITIT.

WF-check for RPITIT was done in the opaque type's param-env, so it could not benefit from assumed wf types from the function's parameters.

cc `@compiler-errors` since you chose that param-env in fd2766e7fde4

Fixes https://github.com/rust-lang/rust/issues/102682
Fixes https://github.com/rust-lang/rust/issues/104908
Fixes https://github.com/rust-lang/rust/issues/102552
Fixes https://github.com/rust-lang/rust/issues/104529

18 months agoRollup merge of #105236 - JohnTitor:issue-47814, r=compiler-errors
Matthias Krüger [Sun, 4 Dec 2022 15:25:33 +0000 (16:25 +0100)]
Rollup merge of #105236 - JohnTitor:issue-47814, r=compiler-errors

Add regression test for #47814

Closes #47814
r? `@compiler-errors`

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
18 months agoRollup merge of #105224 - cjgillot:issue-104240, r=compiler-errors
Matthias Krüger [Sun, 4 Dec 2022 15:25:33 +0000 (16:25 +0100)]
Rollup merge of #105224 - cjgillot:issue-104240, r=compiler-errors

Properly substitute inherent associated types.

Fixes https://github.com/rust-lang/rust/issues/104240

18 months agoRollup merge of #105141 - ohno418:fix-ice-on-invalid-var-decl-in-macro-call, r=compil...
Matthias Krüger [Sun, 4 Dec 2022 15:25:32 +0000 (16:25 +0100)]
Rollup merge of #105141 - ohno418:fix-ice-on-invalid-var-decl-in-macro-call, r=compiler-errors

Fix ICE on invalid variable declarations in macro calls

This fixes ICE that happens with invalid variable declarations in macro calls like:

```rust
macro_rules! m { ($s:stmt) => {} }
m! { var x }
m! { auto x }
m! { mut x }
```

Found this is because of not collecting tokens on recovery, so I changed to force collect them.

Fixes https://github.com/rust-lang/rust/issues/103529.

18 months agoRollup merge of #101975 - chenyukang:fix-101749, r=compiler-errors
Matthias Krüger [Sun, 4 Dec 2022 15:25:32 +0000 (16:25 +0100)]
Rollup merge of #101975 - chenyukang:fix-101749, r=compiler-errors

Suggest to use . instead of :: when accessing a method of an object

Fixes #101749
Fixes #101542

18 months agoAuto merge of #103293 - est31:untwist_and_drop_order, r=nagisa
bors [Sun, 4 Dec 2022 14:03:12 +0000 (14:03 +0000)]
Auto merge of #103293 - est31:untwist_and_drop_order, r=nagisa

Remove drop order twist of && and || and make them associative

Previously a short circuiting binop chain (chain of && or ||s) would drop the temporaries created by the first element after all the other elements, and otherwise follow evaluation order. So `f(1).g() && f(2).g() && f(3).g() && f(4).g()` would drop the temporaries in the order `2,3,4,1`. This made `&&` and `||` non-associative regarding drop order. In other words, adding ()'s to the expression would change drop order: `f(1).g() && (f(2).g() && f(3).g()) && f(4).g()` for example would drop in the order `3,2,4,1`.

As, except for the bool result, there is no data returned by the sub-expressions of the short circuiting binops, we can safely discard of any temporaries created by the sub-expr. Previously, code was already putting the rhs's into terminating scopes, but missed it for the lhs's.

This commit addresses this "twist". We now also put the lhs into a terminating scope. The drop order of the above expressions becomes `1,2,3,4`.

There might be code relying on the current order, and therefore I'd recommend doing a crater run to gauge the impact. I'd argue that such code is already quite wonky as it is one `foo() &&` addition away from breaking. ~~For the impact, I don't expect any *build* failures, as the compiler gets strictly more tolerant: shortening the lifetime of temporaries only expands the list of programs the compiler accepts as valid. There might be *runtime* failures caused by this change however.~~ Edit: both build and runtime failures are possible, e.g. see the example provided by dtolnay [below](https://github.com/rust-lang/rust/pull/103293#issuecomment-1285341113). Edit2: the crater run has finished and [results](https://github.com/rust-lang/rust/pull/103293#issuecomment-1292275203) are that there is only one build failure which is easy to fix with a +/- 1 line diff.

I've included a testcase that now compiles thanks to this patch.

The breakage is also limited to drop order relative to conditionals in the && chain: that is, in code like this:

```Rust
let hello = foo().hi() && bar().world();
println!("hi");
```

we already drop the temporaries of `foo().hi()` before we reach "hi".

I'd ideally have this PR merged before let chains are stabilized. If this PR is taking too long, I'd love to have a more restricted version of this change limited to `&&`'s in let chains: the `&&`'s of such chains are quite special anyways as they accept `let` bindings, in there the `&&` is therefore more a part of the "if let chain" construct than a construct of its own.

Fixes #103107

Status: waiting on [this accepted FCP](https://github.com/rust-lang/rust/pull/103293#issuecomment-1293411354) finishing.

18 months agoUpdate crossbeam
bjorn3 [Sun, 4 Dec 2022 13:20:26 +0000 (14:20 +0100)]
Update crossbeam

This removes a lazy_static dependency edge

18 months agoUpdate rayon to 1.6
bjorn3 [Sun, 4 Dec 2022 13:17:09 +0000 (14:17 +0100)]
Update rayon to 1.6

This removes an autocfg dependency edge

18 months agoUpdate pretty_assertions to 1.3
bjorn3 [Sun, 4 Dec 2022 13:15:06 +0000 (14:15 +0100)]
Update pretty_assertions to 1.3

This replaces ansi_term with yansi which in turn removes a winapi
dependency edge

18 months agoAuto merge of #105248 - matthiaskrgr:rollup-d56k6bc, r=matthiaskrgr
bors [Sun, 4 Dec 2022 11:34:30 +0000 (11:34 +0000)]
Auto merge of #105248 - matthiaskrgr:rollup-d56k6bc, r=matthiaskrgr

Rollup of 4 pull requests

Successful merges:

 - #104856 (Don't suggest associated function call for associated const.)
 - #105123 (Fix passing MACOSX_DEPLOYMENT_TARGET to the linker)
 - #105142 (Make inline const block `ExprWithBlock`)
 - #105237 (Add regression test for #79450)

Failed merges:

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

18 months agoRollup merge of #105237 - JohnTitor:issue-79450, r=oli-obk
Matthias Krüger [Sun, 4 Dec 2022 10:38:52 +0000 (11:38 +0100)]
Rollup merge of #105237 - JohnTitor:issue-79450, r=oli-obk

Add regression test for #79450

Closes #79450
r? `@oli-obk`

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
18 months agoRollup merge of #105142 - nbdd0121:inline_const, r=petrochenkov
Matthias Krüger [Sun, 4 Dec 2022 10:38:51 +0000 (11:38 +0100)]
Rollup merge of #105142 - nbdd0121:inline_const, r=petrochenkov

Make inline const block `ExprWithBlock`

Fix https://github.com/rust-lang/rust/pull/104087#issuecomment-1324190817

`@rustbot` label: +T-lang +F-inline_const

18 months agoRollup merge of #105123 - BlackHoleFox:fixing-the-macos-deployment, r=oli-obk
Matthias Krüger [Sun, 4 Dec 2022 10:38:51 +0000 (11:38 +0100)]
Rollup merge of #105123 - BlackHoleFox:fixing-the-macos-deployment, r=oli-obk

Fix passing MACOSX_DEPLOYMENT_TARGET to the linker

I messed up in https://github.com/rust-lang/rust/pull/103929 when merging the two base files together and as a result, started ignoring `MACOSX_DEPLOYMENT_TARGET` at the linker level. This ended up being the cause of nighty builds not running on older macOS versions.

My original hope with the previous PR was that CI would have caught something like that but there were only tests checking the compiler target definitions in codegen tests. Because of how badly this sucks to break, I put together a new test via `run-make` that actually confirms the deployment target set makes it to the linker instead of just LLVM.

Closes https://github.com/rust-lang/rust/issues/104570 (for real this time)

18 months agoRollup merge of #104856 - luqmana:associated-const-bad-suggestion, r=compiler-errors
Matthias Krüger [Sun, 4 Dec 2022 10:38:50 +0000 (11:38 +0100)]
Rollup merge of #104856 - luqmana:associated-const-bad-suggestion, r=compiler-errors

Don't suggest associated function call for associated const.

Fixes #104801.

r? `@compiler-errors`

18 months agoUse parent function WfCheckingContext to check RPITIT.
Camille GILLOT [Sun, 4 Dec 2022 10:22:20 +0000 (10:22 +0000)]
Use parent function WfCheckingContext to check RPITIT.

18 months agoAuto merge of #101514 - nvzqz:nvzqz/stabilize-nonzero-bits, r=thomcc
bors [Sun, 4 Dec 2022 08:28:22 +0000 (08:28 +0000)]
Auto merge of #101514 - nvzqz:nvzqz/stabilize-nonzero-bits, r=thomcc

Stabilize `nonzero_bits`

Closes #94881, implemented by #93292.

This change stabilizes the associated `BITS` constant for `NonZero{U,I}{8,16,32,64,128,size}` integers, e.g.:

```rs
impl NonZeroUsize {
    pub const BITS: u32 = usize::BITS;
}
```

18 months agoAuto merge of #105121 - oli-obk:simpler-cheaper-dump_mir, r=nnethercote
bors [Sun, 4 Dec 2022 05:47:10 +0000 (05:47 +0000)]
Auto merge of #105121 - oli-obk:simpler-cheaper-dump_mir, r=nnethercote

Cheaper `dump_mir` take two

alternative to #105083

r? `@nnethercote`

18 months agoAlso avoid creating a terminating scope in mixed chains
est31 [Sat, 3 Dec 2022 23:21:19 +0000 (00:21 +0100)]
Also avoid creating a terminating scope in mixed chains

This avoids creation of a terminating scope in
chains that contain both && and ||, because
also there we know that a terminating scope is
not neccessary: all the chain members are already
in such terminating scopes.

Also add a mixed && / || test.

18 months agoImprove comments
est31 [Sat, 3 Dec 2022 22:32:14 +0000 (23:32 +0100)]
Improve comments

18 months agoAuto merge of #104757 - camelid:consolidate-lints, r=GuillaumeGomez,jyn514,Manishearth
bors [Sun, 4 Dec 2022 02:56:45 +0000 (02:56 +0000)]
Auto merge of #104757 - camelid:consolidate-lints, r=GuillaumeGomez,jyn514,Manishearth

Consolidate rustdoc's lint passes into a single pass

This should improve performance and simplify the code.

r? `@GuillaumeGomez`

18 months agoAdd regression test for #79450
Yuki Okushi [Sun, 4 Dec 2022 00:55:43 +0000 (09:55 +0900)]
Add regression test for #79450

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
18 months agoAdd regression test for #47814
Yuki Okushi [Sun, 4 Dec 2022 00:43:05 +0000 (09:43 +0900)]
Add regression test for #47814

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
18 months agoAuto merge of #105217 - jyn514:submodule-fixes, r=bjorn3
bors [Sun, 4 Dec 2022 00:27:32 +0000 (00:27 +0000)]
Auto merge of #105217 - jyn514:submodule-fixes, r=bjorn3

Don't exit with an error if there are no changes to submodules

Fixes https://github.com/rust-lang/rust/issues/105215, which regressed in https://github.com/rust-lang/rust/pull/104865.

18 months agomore comments
Lukas Markeffsky [Sat, 3 Dec 2022 22:54:06 +0000 (23:54 +0100)]
more comments

18 months agoSkip recording resolution for duplicated generic params.
Camille GILLOT [Sat, 3 Dec 2022 22:40:30 +0000 (22:40 +0000)]
Skip recording resolution for duplicated generic params.

18 months agoRemove drop order twist of && and || and make them associative
est31 [Thu, 20 Oct 2022 07:50:32 +0000 (09:50 +0200)]
Remove drop order twist of && and || and make them associative

Previously a short circuiting && chain would drop the
first element after all the other elements, and otherwise
follow evaluation order, so code like:

f(1).g() && f(2).g() && f(3).g() && f(4).g()

would drop the temporaries in the order 2,3,4,1. This made
&& and || non-associative regarding drop order, so
adding ()'s to the expression would change drop order:

f(1).g() && (f(2).g() && f(3).g()) && f(4).g()

for example would drop in the order 3,2,4,1.

As, except for the bool result, there is no data returned
by the sub-expressions of the short circuiting binops,
we can safely discard of any temporaries created by the
sub-expr. Previously, code was already putting the rhs's
into terminating scopes, but missed it for the lhs's.

This commit addresses this "twist". In the expression,
we now also put the lhs into a terminating scope.
The drop order for the above expressions is 1,2,3,4
now.

18 months agoAuto merge of #105218 - matthiaskrgr:rollup-8d3k08n, r=matthiaskrgr
bors [Sat, 3 Dec 2022 21:25:45 +0000 (21:25 +0000)]
Auto merge of #105218 - matthiaskrgr:rollup-8d3k08n, r=matthiaskrgr

Rollup of 9 pull requests

Successful merges:

 - #104199 (Keep track of the start of the argument block of a closure)
 - #105050 (Remove useless borrows and derefs)
 - #105153 (Create a hacky fail-fast mode that stops tests at the first failure)
 - #105164 (Restore `use` suggestion for `dyn` method call requiring `Sized`)
 - #105193 (Disable coverage instrumentation for naked functions)
 - #105200 (Remove useless filter in unused extern crate check.)
 - #105201 (Do not call fn_sig on non-functions.)
 - #105208 (Add AmbiguityError for inconsistent resolution for an import)
 - #105214 (update Miri)

Failed merges:

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

18 months agoProperly substitute inherent associated types.
Camille GILLOT [Sat, 3 Dec 2022 19:08:00 +0000 (19:08 +0000)]
Properly substitute inherent associated types.

18 months agosuggest parenthesis around ExprWithBlock BinOp ExprWithBlock
Lukas Markeffsky [Sat, 3 Dec 2022 19:02:39 +0000 (20:02 +0100)]
suggest parenthesis around ExprWithBlock BinOp ExprWithBlock

18 months agostd update libc version and freebsd image build dependencies
David CARLIER [Sat, 3 Dec 2022 19:01:55 +0000 (19:01 +0000)]
std update libc version and freebsd image build dependencies

18 months agoAuto merge of #105212 - pietroalbini:pa-macos-xl, r=jyn514
bors [Sat, 3 Dec 2022 18:11:40 +0000 (18:11 +0000)]
Auto merge of #105212 - pietroalbini:pa-macos-xl, r=jyn514

Switch to the `macos-12-xl` builder

This PR switches us to the `macos-12-xl` builders, a more powerful builder pool managed by GitHub for us.

18 months agoAuto merge of #2713 - RalfJung:not-unpin-fake-read, r=RalfJung
bors [Sat, 3 Dec 2022 18:08:05 +0000 (18:08 +0000)]
Auto merge of #2713 - RalfJung:not-unpin-fake-read, r=RalfJung

for now, do not do fake reads on non-Unpin mutable references

Work-around for https://github.com/rust-lang/unsafe-code-guidelines/issues/381, needed to make the new test pass. Undoes parts of https://github.com/rust-lang/miri/pull/2694.

18 months agofor now, do not do fake reads on non-Unpin mutable references
Ralf Jung [Sat, 3 Dec 2022 18:05:46 +0000 (19:05 +0100)]
for now, do not do fake reads on non-Unpin mutable references

18 months agoadd test for self-referential future
Ralf Jung [Sat, 3 Dec 2022 17:38:04 +0000 (18:38 +0100)]
add test for self-referential future

18 months agoRollup merge of #105214 - RalfJung:miri, r=RalfJung
Matthias Krüger [Sat, 3 Dec 2022 16:37:46 +0000 (17:37 +0100)]
Rollup merge of #105214 - RalfJung:miri, r=RalfJung

update Miri

r? `@ghost`

18 months agoRollup merge of #105208 - chenyukang:yukang/fix-105069, r=cjgillot
Matthias Krüger [Sat, 3 Dec 2022 16:37:45 +0000 (17:37 +0100)]
Rollup merge of #105208 - chenyukang:yukang/fix-105069, r=cjgillot

Add AmbiguityError for inconsistent resolution for an import

Fixes #105069
Fixes #83950

18 months agoRollup merge of #105201 - cjgillot:issue-105040, r=compiler-errors
Matthias Krüger [Sat, 3 Dec 2022 16:37:45 +0000 (17:37 +0100)]
Rollup merge of #105201 - cjgillot:issue-105040, r=compiler-errors

Do not call fn_sig on non-functions.

Fixes https://github.com/rust-lang/rust/issues/105040
Fixes https://github.com/rust-lang/rust/issues/89271

18 months agoRollup merge of #105200 - cjgillot:issue-104562, r=compiler-errors
Matthias Krüger [Sat, 3 Dec 2022 16:37:44 +0000 (17:37 +0100)]
Rollup merge of #105200 - cjgillot:issue-104562, r=compiler-errors

Remove useless filter in unused extern crate check.

Fixes https://github.com/rust-lang/rust/issues/104562

18 months agoRollup merge of #105193 - tmiasko:naked-nocoverage, r=wesleywiser
Matthias Krüger [Sat, 3 Dec 2022 16:37:44 +0000 (17:37 +0100)]
Rollup merge of #105193 - tmiasko:naked-nocoverage, r=wesleywiser

Disable coverage instrumentation for naked functions

Fixes #105170.

18 months agoRollup merge of #105164 - compiler-errors:revert-import-filter, r=estebank
Matthias Krüger [Sat, 3 Dec 2022 16:37:43 +0000 (17:37 +0100)]
Rollup merge of #105164 - compiler-errors:revert-import-filter, r=estebank

Restore `use` suggestion for `dyn` method call requiring `Sized`

Add the suggestion back that I accidentally removed in 88f2140d8736329610a4c0bd8000e164c9170537 because I didn't understand that suggestion was actually useful...

Fixes #105159

18 months agoRollup merge of #105153 - oli-obk:fail_faster, r=compiler-errors
Matthias Krüger [Sat, 3 Dec 2022 16:37:42 +0000 (17:37 +0100)]
Rollup merge of #105153 - oli-obk:fail_faster, r=compiler-errors

Create a hacky fail-fast mode that stops tests at the first failure

This is useful for not having to wait until all 10k+ ui tests have finished running and then having to crawl through hundreds of failure reports.

You now only get the first report when you turn on that env var and no new tests are run at all

This works like a charm, but is obviously welded on very crudely

18 months agoRollup merge of #105050 - WaffleLapkin:uselessrefign, r=jyn514
Matthias Krüger [Sat, 3 Dec 2022 16:37:42 +0000 (17:37 +0100)]
Rollup merge of #105050 - WaffleLapkin:uselessrefign, r=jyn514

Remove useless borrows and derefs

They are nothing more than noise.
<sub>These are not all of them, but my clippy started crashing (stack overflow), so rip :(</sub>

18 months agoRollup merge of #104199 - SarthakSingh31:issue-97417-1, r=cjgillot
Matthias Krüger [Sat, 3 Dec 2022 16:37:41 +0000 (17:37 +0100)]
Rollup merge of #104199 - SarthakSingh31:issue-97417-1, r=cjgillot

Keep track of the start of the argument block of a closure

This removes a call to `tcx.sess.source_map()` from [compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs](https://github.com/rust-lang/rust/compare/master...SarthakSingh31:issue-97417-1?expand=1#diff-8406bbc0d0b43d84c91b1933305df896ecdba0d1f9269e6744f13d87a2ab268a) as required by #97417.

VsCode automatically applied `rustfmt` to the files I edited under `src/tools`. I can undo that if its a problem.

r? `@cjgillot`

18 months agoDon't exit with an error if there are no changes to submodules
Joshua Nelson [Sat, 3 Dec 2022 16:33:15 +0000 (10:33 -0600)]
Don't exit with an error if there are no changes to submodules

18 months agoupdate lockfile
Ralf Jung [Sat, 3 Dec 2022 15:30:56 +0000 (16:30 +0100)]
update lockfile

18 months agoAuto merge of #97485 - bjorn3:new_archive_writer, r=wesleywiser
bors [Sat, 3 Dec 2022 15:07:39 +0000 (15:07 +0000)]
Auto merge of #97485 - bjorn3:new_archive_writer, r=wesleywiser

Rewrite LLVM's archive writer in Rust

This allows it to be used by other codegen backends.

Fixes https://github.com/bjorn3/rustc_codegen_cranelift/issues/1155

18 months agoswitch to the macos-12-xl builder
Pietro Albini [Sat, 3 Dec 2022 14:46:18 +0000 (15:46 +0100)]
switch to the macos-12-xl builder

18 months agoparser: refactoring on recovery from invalid variable declarations
Yutaro Ohno [Sat, 3 Dec 2022 14:37:23 +0000 (23:37 +0900)]
parser: refactoring on recovery from invalid variable declarations

Previously, the `recover_local_after_let` function was called from the
body of the `recover_stmt_local` function. Unifying these two functions
make it more simple and more readable.

18 months agofix #101749, use . instead of :: when accessing a method of an object
yukang [Sun, 18 Sep 2022 07:35:21 +0000 (15:35 +0800)]
fix #101749, use . instead of :: when accessing a method of an object

18 months agofix #105069, Add AmbiguityError for inconsistent resolution for an import
yukang [Sat, 3 Dec 2022 13:18:37 +0000 (21:18 +0800)]
fix #105069, Add AmbiguityError for inconsistent resolution for an import

18 months agoparser: fix ICE with invalid variable declaration in macro call
Yutaro Ohno [Sat, 3 Dec 2022 14:24:49 +0000 (23:24 +0900)]
parser: fix ICE with invalid variable declaration in macro call

Fix ICE on parsing an invalid variable declaration as a statement like:

```
macro_rules! m { ($s:stmt) => {} }
m! { var x }
```

18 months agoMake sure all input archives are unmapped before persisting the output archive
bjorn3 [Sat, 3 Dec 2022 12:53:47 +0000 (12:53 +0000)]
Make sure all input archives are unmapped before persisting the output archive

18 months agoAuto merge of #2712 - RalfJung:rustup, r=RalfJung
bors [Sat, 3 Dec 2022 12:32:28 +0000 (12:32 +0000)]
Auto merge of #2712 - RalfJung:rustup, r=RalfJung

Rustup

18 months agoclippy
Ralf Jung [Sat, 3 Dec 2022 12:24:04 +0000 (13:24 +0100)]
clippy

18 months agoAuto merge of #105183 - GuillaumeGomez:merge-and-dedup-predicates, r=notriddle
bors [Sat, 3 Dec 2022 11:28:33 +0000 (11:28 +0000)]
Auto merge of #105183 - GuillaumeGomez:merge-and-dedup-predicates, r=notriddle

Merge generics and where predicates and prevent duplicates in where predicates

Part of #104886 (I didn't include bounds from parent trait yet as I think the PR is already big enough).

Also we'll need to run a perf check.

cc `@fmease` since you worked a bit on this.
r? `@notriddle`

18 months agoDo not call fn_sig on non-functions.
Camille GILLOT [Sat, 3 Dec 2022 09:32:29 +0000 (09:32 +0000)]
Do not call fn_sig on non-functions.

18 months agoRemove useless filter in unused extern crate check.
Camille GILLOT [Sat, 3 Dec 2022 09:23:03 +0000 (09:23 +0000)]
Remove useless filter in unused extern crate check.

18 months agoAuto merge of #105133 - oli-obk:promoted_def_ids, r=cjgillot
bors [Sat, 3 Dec 2022 08:17:46 +0000 (08:17 +0000)]
Auto merge of #105133 - oli-obk:promoted_def_ids, r=cjgillot

Ensure query backtraces work for `DefId`s created after ast lowering

r? `@cjgillot`

18 months agoAuto merge of #105196 - JohnTitor:rollup-8rxqnq6, r=JohnTitor
bors [Sat, 3 Dec 2022 05:24:35 +0000 (05:24 +0000)]
Auto merge of #105196 - JohnTitor:rollup-8rxqnq6, r=JohnTitor

Rollup of 7 pull requests

Successful merges:

 - #104903 (Use ocx.normalize in report_projection_error)
 - #105032 (improve doc of into_boxed_slice and impl From<Vec<T>> for Box<[T]>)
 - #105100 (Add missing intra-doc link)
 - #105181 (Don't add a note for implementing a trait if its inner type is erroneous)
 - #105182 (Rustdoc-Json: Don't inline foreign traits)
 - #105188 (Don't elide type information when printing E0308 with `-Zverbose`)
 - #105189 (rustdoc: clean up redundant CSS on `.rustdoc-toggle.hideme`)

Failed merges:

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

18 months agoRollup merge of #105189 - notriddle:notriddle/rustdoc-toggle-hideme, r=GuillaumeGomez
Yuki Okushi [Sat, 3 Dec 2022 03:51:30 +0000 (12:51 +0900)]
Rollup merge of #105189 - notriddle:notriddle/rustdoc-toggle-hideme, r=GuillaumeGomez

rustdoc: clean up redundant CSS on `.rustdoc-toggle.hideme`

18 months agoRollup merge of #105188 - compiler-errors:verbose-ty-err, r=TaKO8Ki
Yuki Okushi [Sat, 3 Dec 2022 03:51:30 +0000 (12:51 +0900)]
Rollup merge of #105188 - compiler-errors:verbose-ty-err, r=TaKO8Ki

Don't elide type information when printing E0308 with `-Zverbose`

When we pass `-Zverbose`, we kinda expect for all `_` to be replaced with more descriptive information, for example --

```
   = note: expected fn pointer `fn(_, u32)`
                 found fn item `fn(_, i32) {foo}`
```

Where `_` is the "identical" part of the fn signatures, now gets rendered as:

```
   = note: expected fn pointer `fn(i32, u32)`
                 found fn item `fn(i32, i32) {foo}`
```

18 months agoRollup merge of #105182 - aDotInTheVoid:rdj-no-foreign-traits, r=Enselic,GuillaumeGomez
Yuki Okushi [Sat, 3 Dec 2022 03:51:29 +0000 (12:51 +0900)]
Rollup merge of #105182 - aDotInTheVoid:rdj-no-foreign-traits, r=Enselic,GuillaumeGomez

Rustdoc-Json: Don't inline foreign traits

It wasn't done correctly, and [we want to move towards only having local items in the index, and making foreign items easier to resolved](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/Rustdoc.20JSON.3A.20Include.20All.20Foreign.20Items.3F)

Fixes #105025. This means #105015 is included to test this

Fixes #105022

r? `@GuillaumeGomez`

18 months agoRollup merge of #105181 - bhbs:skip-note, r=estebank
Yuki Okushi [Sat, 3 Dec 2022 03:51:29 +0000 (12:51 +0900)]
Rollup merge of #105181 - bhbs:skip-note, r=estebank

Don't add a note for implementing a trait if its inner type is erroneous

Fix #105138

18 months agoRollup merge of #105100 - jhpratt:fix-docs, r=JohnTitor
Yuki Okushi [Sat, 3 Dec 2022 03:51:28 +0000 (12:51 +0900)]
Rollup merge of #105100 - jhpratt:fix-docs, r=JohnTitor

Add missing intra-doc link

Trivial change. This makes the plain text into inline code and makes it a link.

`@rustbot` label +A-docs

18 months agoRollup merge of #105032 - HintringerFabian:improve_docs, r=JohnTitor
Yuki Okushi [Sat, 3 Dec 2022 03:51:27 +0000 (12:51 +0900)]
Rollup merge of #105032 - HintringerFabian:improve_docs, r=JohnTitor

improve doc of into_boxed_slice and impl From<Vec<T>> for Box<[T]>

Improves description of `into_boxed_slice`, and adds example to `impl From<Vec<T>> for Box<[T]>`.
Fixes #98908

18 months agoRollup merge of #104903 - spastorino:consolidate-normalize-in-report_projection_error...
Yuki Okushi [Sat, 3 Dec 2022 03:51:27 +0000 (12:51 +0900)]
Rollup merge of #104903 - spastorino:consolidate-normalize-in-report_projection_error, r=lcnr

Use ocx.normalize in report_projection_error

r? `@lcnr`

cc `@compiler-errors`

18 months agoAuto merge of #105073 - weihanglo:update-cargo, r=weihanglo
bors [Sat, 3 Dec 2022 02:12:48 +0000 (02:12 +0000)]
Auto merge of #105073 - weihanglo:update-cargo, r=weihanglo

Update cargo

9 commits in e027c4b5d25af2119b1956fac42863b9b3242744..f6e737b1e3386adb89333bf06a01f68a91ac5306
2022-11-25 19:44:46 +0000 to 2022-12-02 20:21:24 +0000
- Refactor generate_targets into separate module (https://github.com/rust-lang/cargo/pull/11445)
- Improve file found in multiple build targets warning (https://github.com/rust-lang/cargo/pull/11299)
- Error when precise without -p flag (https://github.com/rust-lang/cargo/pull/11349)
- Improve strategy for selecting targets to be scraped for examples (https://github.com/rust-lang/cargo/pull/11430)
- Aware of compression ratio for unpack size limit (https://github.com/rust-lang/cargo/pull/11337)
- Add test for rustdoc-map generation when using sparse registries (https://github.com/rust-lang/cargo/pull/11403)
- Add error message when `cargo fix` on an empty repo (https://github.com/rust-lang/cargo/pull/11400)
- Store the sparse+ prefix in the SourceId for sparse registries (https://github.com/rust-lang/cargo/pull/11387)
- Update documentation for -Zrustdoc-scrape-examples in the Cargo Book (https://github.com/rust-lang/cargo/pull/11425)

18 months agoUpdate cargo
Weihang Lo [Sat, 3 Dec 2022 01:10:54 +0000 (01:10 +0000)]
Update cargo

9 commits in e027c4b5d25af2119b1956fac42863b9b3242744..f6e737b1e3386adb89333bf06a01f68a91ac5306
2022-11-25 19:44:46 +0000 to 2022-12-02 20:21:24 +0000
- Refactor generate_targets into separate module (rust-lang/cargo#11445)
- Improve file found in multiple build targets warning (rust-lang/cargo#11299)
- Error when precise without -p flag (rust-lang/cargo#11349)
- Improve strategy for selecting targets to be scraped for examples (rust-lang/cargo#11430)
- Aware of compression ratio for unpack size limit (rust-lang/cargo#11337)
- Add test for rustdoc-map generation when using sparse registries (rust-lang/cargo#11403)
- Add error message when `cargo fix` on an empty repo (rust-lang/cargo#11400)
- Store the sparse+ prefix in the SourceId for sparse registries (rust-lang/cargo#11387)
- Update documentation for -Zrustdoc-scrape-examples in the Cargo Book (rust-lang/cargo#11425)

18 months agoFix passing MACOSX_DEPLOYMENT_TARGET to the linker
BlackHoleFox [Thu, 1 Dec 2022 09:02:36 +0000 (03:02 -0600)]
Fix passing MACOSX_DEPLOYMENT_TARGET to the linker

18 months agoDon't add a note for implementing a trait if its inner type is erroneous
bhbs [Sat, 3 Dec 2022 00:06:47 +0000 (09:06 +0900)]
Don't add a note for implementing a trait if its inner type is erroneous

18 months agoMark naked functions as never inline in codegen_fn_attrs
Tomasz Miąsko [Fri, 2 Dec 2022 00:00:00 +0000 (00:00 +0000)]
Mark naked functions as never inline in codegen_fn_attrs

Use code generation attributes to ensure that naked functions are never
inline, replacing separate checks in MIR inliner and LLVM code
generation.

18 months agoDisable coverage instrumentation for naked functions
Tomasz Miąsko [Fri, 2 Dec 2022 00:00:00 +0000 (00:00 +0000)]
Disable coverage instrumentation for naked functions

18 months agoAuto merge of #105187 - matthiaskrgr:rollup-nxyxpko, r=matthiaskrgr
bors [Fri, 2 Dec 2022 23:00:48 +0000 (23:00 +0000)]
Auto merge of #105187 - matthiaskrgr:rollup-nxyxpko, r=matthiaskrgr

Rollup of 7 pull requests

Successful merges:

 - #105026 (v8a as default aarch64 target)
 - #105033 (sparc-struct-abi: work around new tail-call optimization)
 - #105144 (Document normalization methods `At::{normalize,query_normalize}`)
 - #105155 (rustdoc: clean up help and settings button CSS)
 - #105162 (Properly synthesize `FnSig` value during cycle)
 - #105163 (Check lifetime param count in `collect_trait_impl_trait_tys`)
 - #105185 (Move `normalize_fn_sig` to `TypeErrCtxt`)

Failed merges:

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

18 months agorustdoc: clean up redundant CSS on `.rustdoc-toggle.hideme`
Michael Howell [Fri, 2 Dec 2022 21:39:06 +0000 (14:39 -0700)]
rustdoc: clean up redundant CSS on `.rustdoc-toggle.hideme`

18 months agoDon't elide information when printing E0308 with Zverbose
Michael Goulet [Fri, 2 Dec 2022 21:01:34 +0000 (21:01 +0000)]
Don't elide information when printing E0308 with Zverbose

18 months agoDefine values and err as non mutable
Santiago Pastorino [Wed, 30 Nov 2022 15:59:22 +0000 (12:59 -0300)]
Define values and err as non mutable