Commit Graph

212401 Commits

Author SHA1 Message Date
bors
8e440b0376 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
2022-12-05 21:46:58 +00:00
Will Crichton
d595884302 Move -Z maximal-hir-to-mir-coverage implementation to new maybe_new_source_scope method 2022-12-05 12:47:44 -08:00
Michael Howell
32765fbe10 rustdoc: simplify CSS selectors on top-doc and non-exhaustive toggles
This code uses a special `hideme` class anyway, so just style that.
2022-12-05 13:01:29 -07:00
Matthias Krüger
612e89a1fb
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.
2022-12-05 20:43:45 +01:00
Matthias Krüger
4ebbb20dad
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
2022-12-05 20:43:44 +01:00
Matthias Krüger
66a4cb5368
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
2022-12-05 20:43:44 +01:00
Matthias Krüger
e84e8f4165
Rollup merge of #105222 - devnexen:fbsd_update_img, r=petrochenkov
std update libc version and freebsd image build dependencies
2022-12-05 20:43:43 +01:00
Matthias Krüger
78cf0b916a
Rollup merge of #105180 - nbdd0121:async_track_caller, r=compiler-errors
Use proper HirId for async track_caller attribute check

Fix #105134
2022-12-05 20:43:42 +01:00
Matthias Krüger
f4643f59cb
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.
2022-12-05 20:43:42 +01:00
Matthias Krüger
4b6010cbb7
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
2022-12-05 20:43:41 +01:00
Matthias Krüger
8ad447c479
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.
2022-12-05 20:43:40 +01:00
Michael Goulet
a1fbc14372 Point at GAT where clause when unsatisfied 2022-12-05 19:11:31 +00:00
Michael Goulet
da929fa63c Make get_impl_future_output_ty work with AFIT 2022-12-05 17:34:42 +00:00
bors
e1d819583f 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.
2022-12-05 17:26:19 +00:00
León Orell Valerian Liehr
d5cb5fb185
normalize inherent associated types after substitution 2022-12-05 18:02:47 +01:00
rustbot
a192284a94 Update books 2022-12-05 12:01:18 -05:00
Michael Howell
65072ee775 rustdoc: remove no-op mobile CSS .sidebar { margin: 0; padding: 0 }
This isn't overriding anything, because the sidebar never has a margin or
padding on it.
2022-12-05 09:15:43 -07:00
Michael Goulet
f4c76b193d Be more careful about unresolved exprs in suggestion 2022-12-05 08:15:30 -08:00
bors
552b63c161 Auto merge of #2715 - RalfJung:rustup, r=RalfJung
Rustup
2022-12-05 12:55:36 +00:00
Ralf Jung
7481ba7746 Merge from rustc 2022-12-05 13:52:53 +01:00
Ralf Jung
16a9fdf663 Preparing for merge from rustc 2022-12-05 13:51:41 +01:00
Oli Scherer
f693b7848e feed resolver_for_lowering instead of storing it in a field 2022-12-05 10:58:55 +00:00
Oli Scherer
125b729ddd Allow arbitrary keys in feeding API 2022-12-05 10:58:55 +00:00
Ralf Jung
ee21454e61 attempt to clarify align_to docs 2022-12-05 11:37:55 +01:00
Michael Woerister
56aacb245c StableOrd: Address review comments. 2022-12-05 10:45:31 +01:00
Nicholas Nethercote
8980d9a76d Remove {Early,Late}LintPassObjects.
`EarlyContextAndPass` wraps a single early lint pass. We aggregate
multiple passes into that single pass by using `EarlyLintPassObjects`.

This commit removes `EarlyLintPassObjects` by changing
`EarlyContextAndPass` into `EarlyContextAndPasses`. I.e. it just removes
a level of indirection. This makes the code simpler and slightly faster.

The commit does likewise for late lints.
2022-12-05 19:50:10 +11:00
bors
203c8765ea 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.
2022-12-05 08:45:03 +00:00
Rageking8
58110572fb fix dupe word typos 2022-12-05 16:42:36 +08:00
Will Crichton
3bf7d88ef1 Add -Z maximal-hir-to-mir-coverage flag 2022-12-04 23:58:20 -08:00
bors
e72ea1dc37 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`)
2022-12-05 05:54:33 +00:00
Michael Goulet
19175e9b75 Synthesize generics for bad auto traits in dyn types 2022-12-05 05:45:12 +00:00
Nicholas Nethercote
7e0c6dba0d Remove LitKind::synthesize_token_lit.
It has a single call site in the HIR pretty printer, where the resulting
token lit is immediately converted to a string.

This commit replaces `LitKind::synthesize_token_lit` with a `Display`
impl for `LitKind`, which can be used by the HIR pretty printer.
2022-12-05 16:33:24 +11:00
Nicholas Nethercote
568e647047 Remove three uses of LitKind::synthesize_token_lit. 2022-12-05 16:33:20 +11:00
Nicholas Nethercote
d887615b4c Parameterise Parser::{recover_unclosed_char,handle_missing_lit}.
These two methods both produce a `MetaItemLit`, and then some of the
call sites convert the `MetaItemLit` to a `token::Lit` with
`as_token_lit`.

This commit parameterises these two methods with a `mk_lit_char`
closure, which can be used to produce either `MetaItemLit` or
`token::Lit` directly as necessary.
2022-12-05 15:04:33 +11:00
Nicholas Nethercote
4ae956f600 Remove ExtCtxt::expr_lit. 2022-12-05 14:20:38 +11:00
Michael Goulet
64ad337a3b Don't call diagnostic_hir_wf_check query if we have infer variables 2022-12-05 03:18:57 +00:00
Gary Guo
34c377335b Add fixme note 2022-12-05 03:18:26 +00:00
bors
b9341bfdb1 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
2022-12-05 02:51:06 +00:00
Michael Goulet
1c81540206 Unconditional check FRU expression, even if there are errors present 2022-12-05 00:42:40 +00:00
Nicholas Nethercote
7d30472180 Remove mk_name_value_item{,_str}.
There are better ways to create the meta items.
- In the rustdoc tests, the commit adds `dummy_meta_item_name_value`,
  which matches the existing `dummy_meta_item_word` function and
  `dummy_meta_item_list` macro.
- In `types.rs` the commit clones the existing meta item and then
  modifies the clone.
2022-12-05 11:24:48 +11:00
bors
d1449560e3 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`
2022-12-04 22:46:11 +00:00
Eduardo Sánchez Muñoz
2e51122647 Make integer-to-integer From impls #[inline(always)] 2022-12-04 22:55:18 +01:00
Michael Goulet
a68eae2f70 Avoid InferCtxt::build in generic_arg_mismatch_err 2022-12-04 20:54:30 +00:00
Michael Goulet
e3072a24ad Avoid InferCtxt::build in report_similar_impl_candidates 2022-12-04 20:54:30 +00:00
bors
53e4b9dd74 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
2022-12-04 20:05:32 +00:00
Michael Goulet
d442c015d6 Don't ICE in ExprUseVisitor on FRU for non-existent struct 2022-12-04 18:53:50 +00:00
Michael Goulet
26b24cd755 drive-by: move field_index to typeck results 2022-12-04 17:59:21 +00:00
bors
0f0d5d716a 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
2022-12-04 16:32:21 +00:00
Matthias Krüger
d0335c399f
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.
2022-12-04 16:25:34 +01:00
Matthias Krüger
d055d6ad5e
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 fd2766e7fd

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
2022-12-04 16:25:34 +01:00