Commit Graph

212157 Commits

Author SHA1 Message Date
Matthias Krüger
785b47d92a
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`
2022-12-04 11:38:50 +01:00
Camille GILLOT
12473d3f36 Use parent function WfCheckingContext to check RPITIT. 2022-12-04 10:33:07 +00:00
Jakob Degen
01a4898210 Fix --pass in compiletest 2022-12-04 02:27:40 -08:00
Ralf Jung
c823dfa8b2 remove no-op 'let _ = ' 2022-12-04 10:32:00 +01:00
bors
9e772114e6 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;
}
```
2022-12-04 08:28:22 +00:00
bors
fd02567705 Auto merge of #105121 - oli-obk:simpler-cheaper-dump_mir, r=nnethercote
Cheaper `dump_mir` take two

alternative to #105083

r? `@nnethercote`
2022-12-04 05:47:10 +00:00
est31
a59a2d3f6a 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.
2022-12-04 04:09:40 +01:00
est31
a2076dc0a6 Improve comments 2022-12-04 04:09:40 +01:00
bors
1195b672fb 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`
2022-12-04 02:56:45 +00:00
Yuki Okushi
047fda2fc5
Add regression test for #79450
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-04 09:55:43 +09:00
Yuki Okushi
c366129205
Add regression test for #47814
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-04 09:43:05 +09:00
bors
2a39e45afb 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.
2022-12-04 00:27:32 +00:00
Ben Kimock
74a270ac93 Re-enable removal of ZST writes to unions 2022-12-03 19:17:45 -05:00
Lukas Markeffsky
c808d0b289 more comments 2022-12-03 23:54:06 +01:00
Camille GILLOT
b1514108e2 Skip recording resolution for duplicated generic params. 2022-12-03 22:40:30 +00:00
est31
8cf521d80e 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.
2022-12-03 23:32:08 +01:00
bors
b8a52e3a4b 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
2022-12-03 21:25:45 +00:00
Camille GILLOT
8a7ae23f75 Properly substitute inherent associated types. 2022-12-03 19:08:00 +00:00
Lukas Markeffsky
35c00a9731 suggest parenthesis around ExprWithBlock BinOp ExprWithBlock 2022-12-03 20:02:39 +01:00
David CARLIER
71cf892235 std update libc version and freebsd image build dependencies 2022-12-03 19:01:55 +00:00
bors
2341517696 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.
2022-12-03 18:11:40 +00:00
bors
faec28970f 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.
2022-12-03 18:08:05 +00:00
Ralf Jung
3fa692c8b2 for now, do not do fake reads on non-Unpin mutable references 2022-12-03 19:05:56 +01:00
Ralf Jung
3b4cbe9095 add test for self-referential future 2022-12-03 18:38:16 +01:00
Matthias Krüger
8be329de01
Rollup merge of #105214 - RalfJung:miri, r=RalfJung
update Miri

r? `@ghost`
2022-12-03 17:37:46 +01:00
Matthias Krüger
af8f72292b
Rollup merge of #105208 - chenyukang:yukang/fix-105069, r=cjgillot
Add AmbiguityError for inconsistent resolution for an import

Fixes #105069
Fixes #83950
2022-12-03 17:37:45 +01:00
Matthias Krüger
f91fa512d1
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
2022-12-03 17:37:45 +01:00
Matthias Krüger
b1e680650e
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
2022-12-03 17:37:44 +01:00
Matthias Krüger
ed9a21eb0c
Rollup merge of #105193 - tmiasko:naked-nocoverage, r=wesleywiser
Disable coverage instrumentation for naked functions

Fixes #105170.
2022-12-03 17:37:44 +01:00
Matthias Krüger
a739fc8153
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 88f2140d87 because I didn't understand that suggestion was actually useful...

Fixes #105159
2022-12-03 17:37:43 +01:00
Matthias Krüger
6f0a2adf6e
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
2022-12-03 17:37:42 +01:00
Matthias Krüger
1a2f79b82c
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>
2022-12-03 17:37:42 +01:00
Matthias Krüger
c89bff29e5
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`
2022-12-03 17:37:41 +01:00
Joshua Nelson
a0e56154f3 Don't exit with an error if there are no changes to submodules 2022-12-03 10:34:26 -06:00
Ralf Jung
229e65af51 update lockfile 2022-12-03 16:30:56 +01:00
bors
cab4fd678c 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
2022-12-03 15:07:39 +00:00
Pietro Albini
fcbae989ae
switch to the macos-12-xl builder 2022-12-03 15:46:18 +01:00
Yutaro Ohno
e4812583c7 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.
2022-12-03 23:41:42 +09:00
yukang
fb004e9a95 fix #101749, use . instead of :: when accessing a method of an object 2022-12-03 22:41:12 +08:00
yukang
795b2afd20 fix #105069, Add AmbiguityError for inconsistent resolution for an import 2022-12-03 22:28:35 +08:00
Yutaro Ohno
690addc6ec 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 }
```
2022-12-03 23:24:49 +09:00
bjorn3
a99838a115 Make sure all input archives are unmapped before persisting the output archive 2022-12-03 12:53:47 +00:00
Ralf Jung
51ac2af99f interpret: clobber return place when calling function 2022-12-03 13:37:13 +01:00
bors
840f227b00 Auto merge of #2712 - RalfJung:rustup, r=RalfJung
Rustup
2022-12-03 12:32:28 +00:00
Ralf Jung
29814f2e2a clippy 2022-12-03 13:31:57 +01:00
Oli Scherer
c38ff3b385 Remove all but one call site of prepare_outputs and fetch the value from the TyCtxt instead 2022-12-03 12:28:01 +00:00
bors
4bb15759d7 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`
2022-12-03 11:28:33 +00:00
Camille GILLOT
e973240d18 Do not call fn_sig on non-functions. 2022-12-03 09:34:06 +00:00
Camille GILLOT
59cc6cd4ac Remove useless filter in unused extern crate check. 2022-12-03 09:23:03 +00:00
bors
703d95e183 Auto merge of #105133 - oli-obk:promoted_def_ids, r=cjgillot
Ensure query backtraces work for `DefId`s created after ast lowering

r? `@cjgillot`
2022-12-03 08:17:46 +00:00