]> git.lizzy.rs Git - rust.git/log
rust.git
18 months agoFix a typo.
Nicholas Nethercote [Thu, 8 Dec 2022 04:53:31 +0000 (15:53 +1100)]
Fix a typo.

18 months agoRemove `UnsafetyState`.
Nicholas Nethercote [Thu, 8 Dec 2022 04:42:12 +0000 (15:42 +1100)]
Remove `UnsafetyState`.

`FnCtxt::ps` is the only occurrence. It gets updated during HIR
typechecking, but is never looked at.

18 months agoAuto merge of #105291 - nnethercote:remove-LintPassObjects, r=cjgillot
bors [Wed, 7 Dec 2022 03:52:19 +0000 (03:52 +0000)]
Auto merge of #105291 - nnethercote:remove-LintPassObjects, r=cjgillot

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.

r? `@cjgillot`

18 months agoAuto merge of #105397 - matthiaskrgr:rollup-xv5imz8, r=matthiaskrgr
bors [Wed, 7 Dec 2022 00:32:57 +0000 (00:32 +0000)]
Auto merge of #105397 - matthiaskrgr:rollup-xv5imz8, r=matthiaskrgr

Rollup of 6 pull requests

Successful merges:

 - #105298 (llvm-wrapper: adapt for an LLVM API change)
 - #105358 (Add a test for #104260)
 - #105380 (add const generics ping files things for me)
 - #105382 (remove an excess `this`)
 - #105388 (rustdoc: remove redundant CSS `.import-item .stab { font-size }`)
 - #105390 (unstable-book: Add `ignore` to `abi_efiapi` example code)

Failed merges:

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

18 months agoRollup merge of #105390 - nicholasbishop:bishop-example-ignore, r=ehuss
Matthias Krüger [Tue, 6 Dec 2022 22:13:52 +0000 (23:13 +0100)]
Rollup merge of #105390 - nicholasbishop:bishop-example-ignore, r=ehuss

unstable-book: Add `ignore` to `abi_efiapi` example code

This example doesn't compile on targets that don't support UEFI, as reported here:
https://github.com/rust-lang/rust/pull/104793#issuecomment-1339783727

18 months agoRollup merge of #105388 - notriddle:notriddle/item-stab-font-size, r=GuillaumeGomez
Matthias Krüger [Tue, 6 Dec 2022 22:13:51 +0000 (23:13 +0100)]
Rollup merge of #105388 - notriddle:notriddle/item-stab-font-size, r=GuillaumeGomez

rustdoc: remove redundant CSS `.import-item .stab { font-size }`

This sets the exact same font size that `.stab` has by default anyway. It used to be slightly different, but dd5ff428edbc7cd4fa600b81f27bbec28589704f made it identical.

18 months agoRollup merge of #105382 - BoxyUwU:fixme_typo_sadface, r=lcnr
Matthias Krüger [Tue, 6 Dec 2022 22:13:51 +0000 (23:13 +0100)]
Rollup merge of #105382 - BoxyUwU:fixme_typo_sadface, r=lcnr

remove an excess `this`

18 months agoRollup merge of #105380 - BoxyUwU:triagebot_ping_pls, r=lcnr
Matthias Krüger [Tue, 6 Dec 2022 22:13:50 +0000 (23:13 +0100)]
Rollup merge of #105380 - BoxyUwU:triagebot_ping_pls, r=lcnr

add const generics ping files things for me

r? `@lcnr`

18 months agoRollup merge of #105358 - TaKO8Ki:fix-104260, r=estebank
Matthias Krüger [Tue, 6 Dec 2022 22:13:50 +0000 (23:13 +0100)]
Rollup merge of #105358 - TaKO8Ki:fix-104260, r=estebank

Add a test for #104260

Fixes #104260

18 months agoRollup merge of #105298 - krasimirgg:llvm-16-dec-1, r=cuviper
Matthias Krüger [Tue, 6 Dec 2022 22:13:49 +0000 (23:13 +0100)]
Rollup merge of #105298 - krasimirgg:llvm-16-dec-1, r=cuviper

llvm-wrapper: adapt for an LLVM API change

Adapts llvm-wrapper for https://github.com/llvm/llvm-project/commit/8c7c20f033c7036a8bf231ca6f9e02172cb581f0.
No functional changes intended.

Found via our experimental rust + llvm @ HEAD bot: https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/15404#0184d95d-5a68-4db6-ad32-51ddbc3ab543/202-571

18 months agoAuto merge of #105271 - eduardosm:inline-always-int-conv, r=scottmcm
bors [Tue, 6 Dec 2022 21:41:04 +0000 (21:41 +0000)]
Auto merge of #105271 - eduardosm:inline-always-int-conv, r=scottmcm

Make integer-to-integer `From` impls `#[inline(always)]`

Splited from https://github.com/rust-lang/rust/pull/105262

18 months agounstable-book: Add `ignore` to `abi_efiapi` example code
Nicholas Bishop [Tue, 6 Dec 2022 19:22:56 +0000 (14:22 -0500)]
unstable-book: Add `ignore` to `abi_efiapi` example code

This example doesn't compile on targets that don't support UEFI, as
reported here:
https://github.com/rust-lang/rust/pull/104793#issuecomment-1339783727

18 months agorustdoc: remove redundant CSS `.import-item .stab { font-size }`
Michael Howell [Tue, 6 Dec 2022 18:56:22 +0000 (11:56 -0700)]
rustdoc: remove redundant CSS `.import-item .stab { font-size }`

This sets the exact same font size that `.stab` has by default anyway.
It used to be slightly different, but
dd5ff428edbc7cd4fa600b81f27bbec28589704f made it identical.

18 months agoAuto merge of #105378 - matthiaskrgr:rollup-fjeorw5, r=matthiaskrgr
bors [Tue, 6 Dec 2022 18:51:14 +0000 (18:51 +0000)]
Auto merge of #105378 - matthiaskrgr:rollup-fjeorw5, r=matthiaskrgr

Rollup of 9 pull requests

Successful merges:

 - #104898 (Put all cached values into a central struct instead of just the stable hash)
 - #105004 (Fix `emit_unused_delims_expr` ICE)
 - #105174 (Suggest removing struct field from destructive binding only in shorthand scenario)
 - #105250 (Replace usage of `ResumeTy` in async lowering with `Context`)
 - #105286 (Add -Z maximal-hir-to-mir-coverage flag)
 - #105320 (rustdoc: simplify CSS selectors on top-doc and non-exhaustive toggles)
 - #105349 (Point at args in associated const fn pointers)
 - #105362 (Cleanup macro-expanded code in `rustc_type_ir`)
 - #105370 (Remove outdated syntax from trait alias pretty printing)

Failed merges:

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

18 months agollvm-wrapper: adapt for and LLVM API change
Krasimir Georgiev [Mon, 5 Dec 2022 12:04:25 +0000 (12:04 +0000)]
llvm-wrapper: adapt for and LLVM API change

18 months agoCONSISTENCY
Boxy [Tue, 6 Dec 2022 16:45:11 +0000 (16:45 +0000)]
CONSISTENCY

Co-authored-by: lcnr <rust@lcnr.de>
18 months agotypo :(
Boxy [Tue, 6 Dec 2022 16:40:57 +0000 (16:40 +0000)]
typo :(

18 months agoadd cg ping files things
Boxy [Tue, 6 Dec 2022 16:33:19 +0000 (16:33 +0000)]
add cg ping files things

18 months agoRollup merge of #105370 - WaffleLapkin:pp, r=oli-obk
Matthias Krüger [Tue, 6 Dec 2022 15:54:57 +0000 (16:54 +0100)]
Rollup merge of #105370 - WaffleLapkin:pp, r=oli-obk

Remove outdated syntax from trait alias pretty printing

Given the following program:
```rust
#![feature(trait_alias)]
trait A = ?Sized;

fn main() {}
```
Old output of `rustc +nightly ./t.rs -Zunpretty=normal`:
```rust
#![feature(trait_alias)]
trait A for ? Sized ;

fn main() {}
```
New output of `rustc +a ./t.rs -Zunpretty=normal`:
```rust
#![feature(trait_alias)]
trait A = ?Sized;

fn main() {}
```

cc `@durka` (you've written the `FIXME` in #45047, see https://github.com/rust-lang/rust/pull/45047#discussion_r144960751)

18 months agoRollup merge of #105362 - WaffleLapkin:🙅, r=oli-obk
Matthias Krüger [Tue, 6 Dec 2022 15:54:56 +0000 (16:54 +0100)]
Rollup merge of #105362 - WaffleLapkin:🙅, r=oli-obk

Cleanup macro-expanded code in `rustc_type_ir`

We could of course just leave this as-is, but every time I go-to-def to this file it's painful to see all this `(&A(ref __self_1_0),)` stuff.

18 months agoRollup merge of #105349 - compiler-errors:point-at-assoc-ct-fn-ptr-arg, r=cjgillot
Matthias Krüger [Tue, 6 Dec 2022 15:54:56 +0000 (16:54 +0100)]
Rollup merge of #105349 - compiler-errors:point-at-assoc-ct-fn-ptr-arg, r=cjgillot

Point at args in associated const fn pointers

Tiny follow-up to #105201, not so sure it's worth it but :shrug:

The UI test example is a bit more compelling when it's `GlUniformScalar::FACTORY`

r? `@cjgillot`

18 months agoRollup merge of #105320 - notriddle:notriddle/rustdoc-toggle-hideme-2, r=GuillaumeGomez
Matthias Krüger [Tue, 6 Dec 2022 15:54:55 +0000 (16:54 +0100)]
Rollup merge of #105320 - notriddle:notriddle/rustdoc-toggle-hideme-2, r=GuillaumeGomez

rustdoc: simplify CSS selectors on top-doc and non-exhaustive toggles

This code uses a special `hideme` class anyway, so just style that.

18 months agoRollup merge of #105286 - willcrichton:maximal-hir-to-mir-coverage, r=cjgillot
Matthias Krüger [Tue, 6 Dec 2022 15:54:55 +0000 (16:54 +0100)]
Rollup merge of #105286 - willcrichton:maximal-hir-to-mir-coverage, r=cjgillot

Add -Z maximal-hir-to-mir-coverage flag

This PR adds a new unstable flag `-Z maximal-hir-to-mir-coverage` that changes the behavior of `maybe_lint_level_root_bounded`, pursuant to [a discussion on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Mapping.20MIR.20to.20HIR). When enabled, this function will not search upwards for a lint root, but rather immediately return the provided HIR node ID. This change increases the granularity of the mapping between MIR locations and HIR nodes inside the `SourceScopeLocalData` data structures. This increase in granularity is useful for rustc consumers like [Flowistry](https://github.com/willcrichton/flowistry) that rely on getting source-mapping information about the MIR CFG that is as precise as possible.

A test `maximal_mir_to_hir_coverage.rs` has been added to verify that this flag does not break anything.

r? `@cjgillot`

cc `@gavinleroy`

18 months agoRollup merge of #105250 - Swatinem:async-rm-resumety, r=oli-obk
Matthias Krüger [Tue, 6 Dec 2022 15:54:54 +0000 (16:54 +0100)]
Rollup merge of #105250 - Swatinem:async-rm-resumety, r=oli-obk

Replace usage of `ResumeTy` in async lowering with `Context`

Replaces using `ResumeTy` / `get_context` in favor of using `&'static mut Context<'_>`.

Usage of the `'static` lifetime here is technically "cheating", and replaces the raw pointer in `ResumeTy` and the `get_context` fn that pulls the correct lifetimes out of thin air.

fixes https://github.com/rust-lang/rust/issues/104828 and https://github.com/rust-lang/rust/pull/104321#issuecomment-1336363077

r? `@oli-obk`

18 months agoRollup merge of #105174 - chenyukang:yukang/fix-105028-unused, r=eholk
Matthias Krüger [Tue, 6 Dec 2022 15:54:53 +0000 (16:54 +0100)]
Rollup merge of #105174 - chenyukang:yukang/fix-105028-unused, r=eholk

Suggest removing struct field from destructive binding only in shorthand scenario

Fixes #105028

18 months agoRollup merge of #105004 - TaKO8Ki:fix-104897, r=wesleywiser
Matthias Krüger [Tue, 6 Dec 2022 15:54:53 +0000 (16:54 +0100)]
Rollup merge of #105004 - TaKO8Ki:fix-104897, r=wesleywiser

Fix `emit_unused_delims_expr` ICE

Fixes #104897

This is also related to #104433.

18 months agoRollup merge of #104898 - oli-obk:group_all_the_things, r=wesleywiser
Matthias Krüger [Tue, 6 Dec 2022 15:54:52 +0000 (16:54 +0100)]
Rollup merge of #104898 - oli-obk:group_all_the_things, r=wesleywiser

Put all cached values into a central struct instead of just the stable hash

cc `@nnethercote`

this allows re-use of the type for Predicate without duplicating all the logic for the non-hash cached fields

18 months agoAuto merge of #105229 - saethlin:zst-writes-to-unions, r=oli-obk
bors [Tue, 6 Dec 2022 15:35:55 +0000 (15:35 +0000)]
Auto merge of #105229 - saethlin:zst-writes-to-unions, r=oli-obk

Re-enable removal of ZST writes to unions

This was previously disabled because Miri was lazily allocating unsized locals. But we aren't doing that anymore since  https://github.com/rust-lang/rust/pull/98831, so we can have this optimization back.

18 months agoRemove outdated syntax from trait alias pretty printing
Maybe Waffle [Tue, 6 Dec 2022 13:45:11 +0000 (13:45 +0000)]
Remove outdated syntax from trait alias pretty printing

18 months agoAdd debug asserts to hand-implemented `Ord`/`Eq` impls
Maybe Waffle [Tue, 6 Dec 2022 12:20:02 +0000 (12:20 +0000)]
Add debug asserts to hand-implemented `Ord`/`Eq` impls

18 months agoAuto merge of #105365 - matthiaskrgr:rollup-g0mrrt7, r=matthiaskrgr
bors [Tue, 6 Dec 2022 12:29:38 +0000 (12:29 +0000)]
Auto merge of #105365 - matthiaskrgr:rollup-g0mrrt7, r=matthiaskrgr

Rollup of 11 pull requests

Successful merges:

 - #104439 (Add prototype to generate `COPYRIGHT` from REUSE metadata)
 - #105005 (On E0195 point at where clause lifetime bounds)
 - #105098 (propagate the error from parsing enum variant to the parser and emit out)
 - #105243 (remove no-op 'let _ = ')
 - #105254 (Recurse into nested impl-trait when computing variance.)
 - #105287 (Synthesize substitutions for bad auto traits in dyn types)
 - #105310 (Be more careful about unresolved exprs in suggestion)
 - #105318 (Make `get_impl_future_output_ty` work with AFIT)
 - #105339 (support `ConstKind::Expr` in `is_const_evaluatable` and `WfPredicates::compute`)
 - #105340 (Avoid ICE by accounting for missing type)
 - #105342 (Make `note_obligation_cause_code`  take a `impl ToPredicate` for predicate)

Failed merges:

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

18 months agoRollup merge of #105342 - compiler-errors:note_cause_code-takes-predicate, r=fee1...
Matthias Krüger [Tue, 6 Dec 2022 12:27:45 +0000 (13:27 +0100)]
Rollup merge of #105342 - compiler-errors:note_cause_code-takes-predicate, r=fee1-dead

Make `note_obligation_cause_code`  take a `impl ToPredicate` for predicate

The only usecase that wasn't `impl ToPredicate` was noting overflow errors while revealing opaque types, which passed in an `Obligation<'tcx, Ty<'tcx>>`... Since this only happens in a `RevealAll` environment, which is after typeck (and probably primarily within `normalize_erasing_regions`) we're unlikely to display anything useful while noting this code, evidenced by the lack of UI test changes.

18 months agoRollup merge of #105340 - estebank:ice-ice-baby, r=compiler-errors
Matthias Krüger [Tue, 6 Dec 2022 12:27:45 +0000 (13:27 +0100)]
Rollup merge of #105340 - estebank:ice-ice-baby, r=compiler-errors

Avoid ICE by accounting for missing type

Fix #105330

18 months agoRollup merge of #105339 - BoxyUwU:wf_ct_kind_expr, r=TaKO8Ki
Matthias Krüger [Tue, 6 Dec 2022 12:27:44 +0000 (13:27 +0100)]
Rollup merge of #105339 - BoxyUwU:wf_ct_kind_expr, r=TaKO8Ki

support `ConstKind::Expr` in `is_const_evaluatable` and `WfPredicates::compute`

Fixes #105205

Currently we haven't implemented a way to evaluate `ConstKind::Expr(Expr::Binop(Add, 1, 2))` so I just left that with a `FIXME` and a `delay_span_bug` since I have no idea how to do that and it would make this a much larger (and more complicated) PR :P

18 months agoRollup merge of #105318 - compiler-errors:issue-105304, r=jackh726
Matthias Krüger [Tue, 6 Dec 2022 12:27:44 +0000 (13:27 +0100)]
Rollup merge of #105318 - compiler-errors:issue-105304, r=jackh726

Make `get_impl_future_output_ty` work with AFIT

Fixes #105304

18 months agoRollup merge of #105310 - compiler-errors:issue-105288, r=eholk
Matthias Krüger [Tue, 6 Dec 2022 12:27:43 +0000 (13:27 +0100)]
Rollup merge of #105310 - compiler-errors:issue-105288, r=eholk

Be more careful about unresolved exprs in suggestion

Fixes #105288

18 months agoRollup merge of #105287 - compiler-errors:issue-105275, r=eholk
Matthias Krüger [Tue, 6 Dec 2022 12:27:43 +0000 (13:27 +0100)]
Rollup merge of #105287 - compiler-errors:issue-105275, r=eholk

Synthesize substitutions for bad auto traits in dyn types

Auto traits are stored as just `DefId`s inside a `dyn Trait`'s existential predicates list. This is usually fine, since auto traits are forbidden to have generics -- but this becomes a problem for an ill-formed auto trait.

But since this will always result in an error, just synthesize some dummy (error) substitutions which are used at least to keep trait selection code happy about the number of substs in a trait ref.

Fixes #104808

18 months agoRollup merge of #105254 - cjgillot:issue-105251, r=oli-obk
Matthias Krüger [Tue, 6 Dec 2022 12:27:42 +0000 (13:27 +0100)]
Rollup merge of #105254 - cjgillot:issue-105251, r=oli-obk

Recurse into nested impl-trait when computing variance.

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

18 months agoRollup merge of #105243 - RalfJung:no-op-let, r=Mark-Simulacrum
Matthias Krüger [Tue, 6 Dec 2022 12:27:42 +0000 (13:27 +0100)]
Rollup merge of #105243 - RalfJung:no-op-let, r=Mark-Simulacrum

remove no-op 'let _ = '

Also see the discussion at https://github.com/rust-lang/rust/pull/93563#discussion_r1034057555.

I don't know why these `Drop` implementations exist to begin with, given that their body does literally nothing, but did not want to change that. (It might affect dropck.)

Cc `````@ibraheemdev````` `````@Amanieu`````

18 months agoRollup merge of #105098 - lyming2007:issue-103869-fix, r=eholk
Matthias Krüger [Tue, 6 Dec 2022 12:27:41 +0000 (13:27 +0100)]
Rollup merge of #105098 - lyming2007:issue-103869-fix, r=eholk

propagate the error from parsing enum variant to the parser and emit out

While parsing enum variant, the error message always disappear
Because the error message that emit out is from main error of parser
The information of enum variant disappears while parsing enum variant with error
We only check the syntax of expecting token, i.e, in case https://github.com/rust-lang/rust/issues/103869
It will error it without telling the message that this error is from pasring enum variant.
Propagate the sub-error from parsing enum variant to the main error of parser by chaining it with map_err
Check the sub-error before emitting the main error of parser and attach it.
Fix https://github.com/rust-lang/rust/issues/103869

18 months agoRollup merge of #105005 - estebank:where-clause-lts, r=compiler-errors
Matthias Krüger [Tue, 6 Dec 2022 12:27:41 +0000 (13:27 +0100)]
Rollup merge of #105005 - estebank:where-clause-lts, r=compiler-errors

On E0195 point at where clause lifetime bounds

Fix #104733

18 months agoRollup merge of #104439 - ferrocene:pa-generate-copyright, r=pnkfelix
Matthias Krüger [Tue, 6 Dec 2022 12:27:40 +0000 (13:27 +0100)]
Rollup merge of #104439 - ferrocene:pa-generate-copyright, r=pnkfelix

Add prototype to generate `COPYRIGHT` from REUSE metadata

This PR adds a prototype to generate the `COPYRIGHT` file from the metadata gathered with REUSE. There are two new tools:

* `src/tools/collect-license-metadata` invokes REUSE, parses its output and stores a concise JSON representation of the metadata in `src/etc/license-metadata.json`.
* `src/tools/generate-copyright` parses the metadata generated above, (in the future will) gather crate dependencies metadata, and renders the `COPYRIGHT.md` file.

Note that since the contents of those files are currently incorrect, rather than outputting in the paths above, the files will be stored in `build/` and not committed. This will be changed once we're confident about the metadata.

Eventually, `src/etc/license-metadata.json` will be committed into the repository and verified to be up to date by CI (similar to our GitHub Actions configuration), to avoid having people install REUSE on their local machine in most cases.

You can see the (incorrect) generated files in https://gist.github.com/pietroalbini/3f3f22b6f9cc8533abf7494b6a50cf97.

r? `@pnkfelix`

18 months agoCleanup macro-expanded code in `rustc_type_ir`
Maybe Waffle [Tue, 6 Dec 2022 11:17:49 +0000 (11:17 +0000)]
Cleanup macro-expanded code in `rustc_type_ir`

18 months agoAuto merge of #105175 - michaelwoerister:add-stable-ord-trait, r=nagisa
bors [Tue, 6 Dec 2022 09:21:49 +0000 (09:21 +0000)]
Auto merge of #105175 - michaelwoerister:add-stable-ord-trait, r=nagisa

Add StableOrd trait as proposed in MCP 533.

The `StableOrd` trait can be used to mark types as having a stable sort order across compilation sessions. Collections that sort their items in a stable way can safely implement HashStable by hashing items in sort order.

See https://github.com/rust-lang/compiler-team/issues/533 for more information.

18 months agoReplace usage of `ResumeTy` in async lowering with `Context`
Arpad Borsos [Sun, 4 Dec 2022 11:32:15 +0000 (12:32 +0100)]
Replace usage of `ResumeTy` in async lowering with `Context`

Replaces using `ResumeTy` / `get_context` in favor of using `&'static mut Context<'_>`.

Usage of the `'static` lifetime here is technically "cheating", and replaces
the raw pointer in `ResumeTy` and the `get_context` fn that pulls the
correct lifetimes out of thin air.

18 months agoadd a test for #104260
Takayuki Maeda [Tue, 6 Dec 2022 08:49:24 +0000 (17:49 +0900)]
add a test for #104260

18 months agoAuto merge of #105348 - JohnTitor:rollup-q9bichr, r=JohnTitor
bors [Tue, 6 Dec 2022 06:34:13 +0000 (06:34 +0000)]
Auto merge of #105348 - JohnTitor:rollup-q9bichr, r=JohnTitor

Rollup of 10 pull requests

Successful merges:

 - #104967 (Fix UI issues with Rustdoc scrape-examples feature.)
 - #105207 (interpret: clobber return place when calling function)
 - #105246 (Fix --pass in compiletest)
 - #105256 (Add small comment explaining what `method-margins.goml` test is about)
 - #105289 (Fix dupe word typos)
 - #105309 (rustdoc: remove no-op mobile CSS `.sidebar { margin: 0; padding: 0 }`)
 - #105313 (Update books)
 - #105315 (Normalize inherent associated types after substitution)
 - #105324 (Point at GAT `where` clause when an obligation is unsatisfied)
 - #105338 (Tweak "the following other types implement trait")

Failed merges:

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

18 months agoreview comment: add test case
Esteban Küber [Mon, 28 Nov 2022 22:04:46 +0000 (14:04 -0800)]
review comment: add test case

18 months agoOn E0195 point at where clause lifetime bounds
Esteban Küber [Mon, 28 Nov 2022 08:03:57 +0000 (00:03 -0800)]
On E0195 point at where clause lifetime bounds

Fix #104733

18 months agoAvoid ICE by accounting for missing type
Esteban Küber [Tue, 6 Dec 2022 00:13:32 +0000 (16:13 -0800)]
Avoid ICE by accounting for missing type

Fix #105330

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 agoRollup merge of #105338 - estebank:other-impls, r=compiler-errors
Yuki Okushi [Tue, 6 Dec 2022 03:48:54 +0000 (12:48 +0900)]
Rollup merge of #105338 - estebank:other-impls, r=compiler-errors

Tweak "the following other types implement trait"

When *any* of the suggested impls is an exact match, *only* show the exact matches. This is particularly relevant for integer types.

r? `@compiler-errors`

18 months agoRollup merge of #105324 - compiler-errors:gat-where-clause-binding-obl, r=jackh726
Yuki Okushi [Tue, 6 Dec 2022 03:48:54 +0000 (12:48 +0900)]
Rollup merge of #105324 - compiler-errors:gat-where-clause-binding-obl, r=jackh726

Point at GAT `where` clause when an obligation is unsatisfied

Slightly helps with #105306

18 months agoRollup merge of #105315 - fmease:norm-subst-iat, r=compiler-errors
Yuki Okushi [Tue, 6 Dec 2022 03:48:53 +0000 (12:48 +0900)]
Rollup merge of #105315 - fmease:norm-subst-iat, r=compiler-errors

Normalize inherent associated types after substitution

Fixes #105314.

r? ````@cjgillot```` (#105224)
````@rustbot```` label F-inherent_associated_types

18 months agoRollup merge of #105313 - rustbot:docs-update, r=ehuss
Yuki Okushi [Tue, 6 Dec 2022 03:48:53 +0000 (12:48 +0900)]
Rollup merge of #105313 - rustbot:docs-update, r=ehuss

Update books

## rust-lang/book

1 commits in 3f64052c048c6def93b94a2b514ee88bba918744..a60f4316ec923a5ac2ed6a2eba6960edb832d855
2022-11-16 15:07:18 UTC to 2022-11-16 15:07:18 UTC

- Fix Install MdBook command (rust-lang/book#3424)

## rust-embedded/book

4 commits in c533348edd69f11a8f4225d633a05d7093fddbf3..19f798d448835a4888e3b3eae7fe69f1d61d8681
2022-11-17 15:08:11 UTC to 2022-11-08 23:27:57 UTC

- start/hardware.md: Fix typo (rust-embedded/book#336)
- doc: Fix `arm-none-eabi-gdb` installation instruction for Fedora 27 or newer to just use `gdb` (rust-embedded/book#335)
- Update singletons.md (rust-embedded/book#334)
- Remove incorrect claim HashMap is avail in no_std (rust-embedded/book#333)

## rust-lang/nomicon

2 commits in 05532356e7a4dbea2330aabb77611f5179493bb8..ae406aa5287a9e025abb72343aaceec98458c117
2022-11-21 22:48:20 UTC to 2022-11-15 00:29:20 UTC

- Improve chapter about `Vec<T>` (rust-lang/nomicon#381)
- Grammar change for 3.4: Limits of Lifetimes (lifetime-mismatch.md) (rust-lang/nomicon#386)

## rust-lang/reference

9 commits in 9f0cc13ffcd27c1fbe1ab766a9491e15ddcf4d19..3ae62681ff236d5528ef7c8c28ba7c6b2ecc6731
2022-12-05 00:51:50 UTC to 2022-11-15 20:43:30 UTC

- Document that type parameter `Self` is unsized by default (rust-lang/reference#1285)
- replace `crateid` term with `crate_name` (rust-lang/reference#1310)
- Document native library modifier `verbatim` (rust-lang/reference#1299)
- Update literal suffix docs for rust-lang/rust#102944 (rust-lang/reference#1305)
- update aliasing rules section of the reference (rust-lang/reference#1290)
- Document RFC 2867: instruction_set attribute (rust-lang/reference#1253)
- Fix a minor typo in the "Higher-ranked trait bounds" section (rust-lang/reference#1288)
- Disallow newline directly following `//` (rust-lang/reference#1294)
- Add an anchor to the "forwarding macro fragments" paragraph (rust-lang/reference#1300)

## rust-lang/rust-by-example

5 commits in 2b15c0abf2bada6e00553814336bc3e2d8399097..a9869b4a3c4cac3bc6099b41f088679e268400b8
2022-11-27 19:03:05 UTC to 2022-11-11 18:54:53 UTC

- Migrate from highfive to triagebot (rust-lang/rust-by-example#1647)
- Simpler version of the read_lines script. (rust-lang/rust-by-example#1641)
- Fix comment in "Formatted print" example code (rust-lang/rust-by-example#1638)
- Added a missing backtick in a comment in chapter 15.4. (rust-lang/rust-by-example#1642)
- Clarify the confusing closure example #1611 (rust-lang/rust-by-example#1643)

## rust-lang/rustc-dev-guide

13 commits in d0dc6c97a6486f68bac782fff135086eae6d77ec..e269950a57fa6fcda356426545fb5aa3691a7ced
2022-12-03 23:09:24 UTC to 2022-11-08 21:35:38 UTC

- Remove duplicate paragraph (rust-lang/rustc-dev-guide#1523)
- clarify subtree tool policy (rust-lang/rustc-dev-guide#1518)
- Typo (rust-lang/rustc-dev-guide#1520)
- Link directly to the section on `--keep-stage` (rust-lang/rustc-dev-guide#1515)
- do an actual link to detect if it breaks in future (rust-lang/rustc-dev-guide#1517)
- Triage some date-check items (rust-lang/rustc-dev-guide#1513)
- Update path for `try_mark_green` implementation (rust-lang/rustc-dev-guide#1512)
- Fix a broken design docs link about unused substs bug (rust-lang/rustc-dev-guide#1511)
- updating-llvm: keep a calm tone (rust-lang/rustc-dev-guide#1449)
- date-check: updating-llvm (rust-lang/rustc-dev-guide#1424)
- rewrite the section about regions in the trait solver (rust-lang/rustc-dev-guide#1508)
- Consistent ordered list indexing (rust-lang/rustc-dev-guide#1509)
- Document multiple alternative suggestions on diagnostic structs (rust-lang/rustc-dev-guide#1486)

18 months agoRollup merge of #105309 - notriddle:notriddle/sidebar-margin-padding, r=GuillaumeGomez
Yuki Okushi [Tue, 6 Dec 2022 03:48:52 +0000 (12:48 +0900)]
Rollup merge of #105309 - notriddle:notriddle/sidebar-margin-padding, r=GuillaumeGomez

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.

18 months agoRollup merge of #105289 - Rageking8:fix-dupe-word-typos, r=cjgillot
Yuki Okushi [Tue, 6 Dec 2022 03:48:52 +0000 (12:48 +0900)]
Rollup merge of #105289 - Rageking8:fix-dupe-word-typos, r=cjgillot

Fix dupe word typos

18 months agoRollup merge of #105256 - GuillaumeGomez:comment-method-margins, r=notriddle
Yuki Okushi [Tue, 6 Dec 2022 03:48:51 +0000 (12:48 +0900)]
Rollup merge of #105256 - GuillaumeGomez:comment-method-margins, r=notriddle

Add small comment explaining what `method-margins.goml` test is about

r? `````@notriddle`````

18 months agoRollup merge of #105246 - JakobDegen:run-mir-tests, r=jyn514
Yuki Okushi [Tue, 6 Dec 2022 03:48:51 +0000 (12:48 +0900)]
Rollup merge of #105246 - JakobDegen:run-mir-tests, r=jyn514

Fix --pass in compiletest

This makes `x test src/test/mir-opt --pass run` actually do the thing it says it does. The resulting tests do not pass, I'll fix that in a follow up.

18 months agoRollup merge of #105207 - RalfJung:interpret-clobber-return, r=oli-obk
Yuki Okushi [Tue, 6 Dec 2022 03:48:50 +0000 (12:48 +0900)]
Rollup merge of #105207 - RalfJung:interpret-clobber-return, r=oli-obk

interpret: clobber return place when calling function

Makes sure the callee cannot observe the previous contents of the return place, and the caller cannot read any of the old return place contents even if the function unwinds.

I don't think we can test for this though, that would require some strange hand-written MIR.

r? `````@oli-obk`````

18 months agoRollup merge of #104967 - willcrichton:fix-scrape-examples, r=notriddle
Yuki Okushi [Tue, 6 Dec 2022 03:48:50 +0000 (12:48 +0900)]
Rollup merge of #104967 - willcrichton:fix-scrape-examples, r=notriddle

Fix UI issues with Rustdoc scrape-examples feature.

A few regressions have been introduced into scrape-examples in the last few months. This commit fixes those regressions:
* Help file was being loaded from the wrong place (introduced in f9e1f6ffdf03ec33cb29e20c88fc7bcc938c7f42).
* CSS selector in JS has a typo (introduced in 14897180ae6a0506a5ad0a9f6a30ae1f75916179).
* Line numbers in scraped example code snippets are overflowing (not sure if this was ever fixed). Changing from flexbox to grid display fixed this issue.

18 months agoAuto merge of #105220 - oli-obk:feeding, r=cjgillot
bors [Tue, 6 Dec 2022 03:47:41 +0000 (03:47 +0000)]
Auto merge of #105220 - oli-obk:feeding, r=cjgillot

feed resolver_for_lowering instead of storing it in a field

r? `@cjgillot`

opening this as

* a discussion for `no_hash` + `feedable` queries. I think we'll want those, but I don't quite understand why they are rejected beyond a double check of the stable hashes for situations where the query is fed but also read from incremental caches.
* and a discussion on removing all untracked fields from TyCtxt and setting it up so that they are fed queries instead

18 months agoAdd GenericParamDef::to_error and InternalSubsts::extend_with_error
Michael Goulet [Tue, 6 Dec 2022 01:52:02 +0000 (01:52 +0000)]
Add GenericParamDef::to_error and InternalSubsts::extend_with_error

18 months agoAuto merge of #105119 - JakobDegen:inline-experiments, r=cjgillot
bors [Tue, 6 Dec 2022 00:53:01 +0000 (00:53 +0000)]
Auto merge of #105119 - JakobDegen:inline-experiments, r=cjgillot

Disable top down MIR inlining

The current MIR inliner has exponential behavior in some cases: <https://godbolt.org/z/7jnWah4fE>. The cause of this is top-down inlining, where we repeatedly do inlining like `call_a() => { call_b(); call_b(); }`. Each decision on its own seems to make sense, but the result is exponential.

Disabling top-down inlining fundamentally prevents this. Each call site in the original, unoptimized source code is now considered for inlining exactly one time, which means that the total growth in MIR size is limited to number of call sites * inlining threshold.

Top down inlining may be worth re-introducing at some point, but it needs to be accompanied with a principled way to prevent this kind of behavior.

18 months agoAvoid noting cause code (which is usually misc, b/c codegen) for opaque type reveal...
Michael Goulet [Tue, 6 Dec 2022 00:19:42 +0000 (00:19 +0000)]
Avoid noting cause code (which is usually misc, b/c codegen) for opaque type reveal overflow

18 months agodrive-by: Default param for ToPredicate
Michael Goulet [Tue, 6 Dec 2022 00:00:01 +0000 (00:00 +0000)]
drive-by: Default param for ToPredicate

18 months agosupport `Expr` in `is_const_evaluatable` and `compute`
Boxy [Mon, 5 Dec 2022 23:17:55 +0000 (23:17 +0000)]
support `Expr` in `is_const_evaluatable` and `compute`

18 months agoTweak "the following other types implement trait"
Esteban Küber [Mon, 5 Dec 2022 22:24:48 +0000 (14:24 -0800)]
Tweak "the following other types implement trait"

When *any* of the suggested impls is an exact match, *only* show the
exact matches. This is particularly relevant for integer types.

fix fmt

18 months agoRestore missing newline
Will Crichton [Mon, 5 Dec 2022 22:04:57 +0000 (14:04 -0800)]
Restore missing newline

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 agoMove -Z maximal-hir-to-mir-coverage implementation to new `maybe_new_source_scope...
Will Crichton [Mon, 5 Dec 2022 19:22:35 +0000 (11:22 -0800)]
Move -Z maximal-hir-to-mir-coverage implementation to new `maybe_new_source_scope` method

18 months agorustdoc: simplify CSS selectors on top-doc and non-exhaustive toggles
Michael Howell [Mon, 5 Dec 2022 18:15:09 +0000 (11:15 -0700)]
rustdoc: simplify CSS selectors on top-doc and non-exhaustive toggles

This code uses a special `hideme` class anyway, so just style that.

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 agoPoint at GAT where clause when unsatisfied
Michael Goulet [Mon, 5 Dec 2022 19:06:32 +0000 (19:06 +0000)]
Point at GAT where clause when unsatisfied

18 months agoMake get_impl_future_output_ty work with AFIT
Michael Goulet [Mon, 5 Dec 2022 17:34:17 +0000 (17:34 +0000)]
Make get_impl_future_output_ty work with AFIT

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 agonormalize inherent associated types after substitution
León Orell Valerian Liehr [Mon, 5 Dec 2022 17:02:47 +0000 (18:02 +0100)]
normalize inherent associated types after substitution

18 months agoUpdate books
rustbot [Mon, 5 Dec 2022 17:01:18 +0000 (12:01 -0500)]
Update books

18 months agorustdoc: remove no-op mobile CSS `.sidebar { margin: 0; padding: 0 }`
Michael Howell [Mon, 5 Dec 2022 16:15:43 +0000 (09:15 -0700)]
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.

18 months agoBe more careful about unresolved exprs in suggestion
Michael Goulet [Mon, 5 Dec 2022 16:15:30 +0000 (08:15 -0800)]
Be more careful about unresolved exprs in suggestion

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 agofeed resolver_for_lowering instead of storing it in a field
Oli Scherer [Sat, 3 Dec 2022 18:06:39 +0000 (18:06 +0000)]
feed resolver_for_lowering instead of storing it in a field

18 months agoAllow arbitrary keys in feeding API
Oli Scherer [Sat, 3 Dec 2022 13:36:39 +0000 (13:36 +0000)]
Allow arbitrary keys in feeding API

18 months agoStableOrd: Address review comments.
Michael Woerister [Mon, 5 Dec 2022 09:45:31 +0000 (10:45 +0100)]
StableOrd: Address review comments.

18 months agoRemove `{Early,Late}LintPassObjects`.
Nicholas Nethercote [Mon, 5 Dec 2022 08:31:36 +0000 (19:31 +1100)]
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.

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 agofix dupe word typos
Rageking8 [Mon, 5 Dec 2022 08:42:36 +0000 (16:42 +0800)]
fix dupe word typos

18 months agoAdd -Z maximal-hir-to-mir-coverage flag
Will Crichton [Mon, 5 Dec 2022 05:07:55 +0000 (21:07 -0800)]
Add -Z maximal-hir-to-mir-coverage flag

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 agoSynthesize generics for bad auto traits in dyn types
Michael Goulet [Mon, 5 Dec 2022 05:44:24 +0000 (05:44 +0000)]
Synthesize generics for bad auto traits in dyn types

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