]> git.lizzy.rs Git - rust.git/log
rust.git
14 months agoAuto merge of #107843 - bjorn3:sync_cg_clif-2023-02-09, r=bjorn3 master
bors [Thu, 9 Feb 2023 14:12:59 +0000 (14:12 +0000)]
Auto merge of #107843 - bjorn3:sync_cg_clif-2023-02-09, r=bjorn3

Sync rustc_codegen_cranelift

* Couple of bugfixes
* A significant runtime perf improvement
* Implemented sym and const support for inline asm
* Improved self profile integration

r? `@ghost`

`@rustbot` label +A-codegen +A-cranelift +T-compiler

14 months agoMerge commit '7d53619064ab7045c383644cb445052d2a3d46db' into sync_cg_clif-2023-02-09
bjorn3 [Thu, 9 Feb 2023 11:38:16 +0000 (12:38 +0100)]
Merge commit '7d53619064ab7045c383644cb445052d2a3d46db' into sync_cg_clif-2023-02-09

14 months agoAuto merge of #107840 - matthiaskrgr:rollup-e6v7x0a, r=matthiaskrgr
bors [Thu, 9 Feb 2023 10:42:15 +0000 (10:42 +0000)]
Auto merge of #107840 - matthiaskrgr:rollup-e6v7x0a, r=matthiaskrgr

Rollup of 5 pull requests

Successful merges:

 - #107446 (Migrate some of `rustc_parse` to derive diagnostics)
 - #107752 (Specify dlltool prefix when generating import libs)
 - #107808 (bootstrap.py: fix build-failure message)
 - #107834 (create symlink for legacy rustfmt path)
 - #107835 (use idiomatic formatting)

Failed merges:

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

14 months agoRollup merge of #107835 - tshepang:fmt, r=WaffleLapkin
Matthias Krüger [Thu, 9 Feb 2023 10:21:59 +0000 (11:21 +0100)]
Rollup merge of #107835 - tshepang:fmt, r=WaffleLapkin

use idiomatic formatting

Also, remove needless `else`

14 months agoRollup merge of #107834 - zephaniahong:issue-107547-fix, r=albertlarsan68
Matthias Krüger [Thu, 9 Feb 2023 10:21:59 +0000 (11:21 +0100)]
Rollup merge of #107834 - zephaniahong:issue-107547-fix, r=albertlarsan68

create symlink for legacy rustfmt path

Fixes #107547 .
Main change is in the `download.rs` file. Created a symlink for the legacy rustfmt path to the new rustfmt path. Other file changes are simply as a result of porting over the symlink_file function from the Build struct to the config Struct

14 months agoRollup merge of #107808 - kadiwa4:built-unsuccessfully, r=albertlarsan68
Matthias Krüger [Thu, 9 Feb 2023 10:21:58 +0000 (11:21 +0100)]
Rollup merge of #107808 - kadiwa4:built-unsuccessfully, r=albertlarsan68

bootstrap.py: fix build-failure message

A small mistake I did.
Corrects #107470, fixes #107804

r? `@albertlarsan68` (since you reviewed the last one)

14 months agoRollup merge of #107752 - riverar:rafael/gnu_dlltool_temp_prefix, r=petrochenkov
Matthias Krüger [Thu, 9 Feb 2023 10:21:58 +0000 (11:21 +0100)]
Rollup merge of #107752 - riverar:rafael/gnu_dlltool_temp_prefix, r=petrochenkov

Specify dlltool prefix when generating import libs

Ref: https://github.com/rust-lang/rust/pull/106610#issuecomment-1418221274

tl;dr: This PR adds an explicit dlltool temporary filename prefix. The prefix resolves a race condition by ensuring dlltool temporary files are siloed in an appropriate/unique Rust temporary directory.

---

GNU dlltool, as part of its import library generation logic, uses a bunch of temporary files on disk. In the interest of deterministic build runs, dlltool supports deterministic temporary filenames. The temporary filename prefix is automatically generated internally or can be explicitly specified via a `--temp-prefix` argument.

GNU dlltool **2.38** (that ships with `x86_64-12.2.0-release-posix-seh-rt_v10-rev0` [installed during CI](https://github.com/rust-lang/rust/blob/master/src/ci/scripts/install-mingw.sh)) generates a prefix based on the target library name ([source](https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=binutils/dlltool.c;h=d95bf3f5470b999fa3b30bc887791859f48d81d1;hb=20756b0fbe065a84710aa38f2457563b57546440#l3992)). The tool writes to files such as `target_dll_h.s` and `target_dll_s00203.o` in the current working directory.

This presents a problem when multiple instances of rustc_codegen_llvm are running to generate an import library (as part of the raw_dylib feature) for the same target library (e.g. kernel32) ([source](https://github.com/rust-lang/rust/blob/master/compiler/rustc_codegen_llvm/src/back/archive.rs#L185-L196)). That is, dlltool instances race and may overwrite or delete files belonging to each other.

GNU dlltool **2.39**+ (not used in Rust CI) generates a prefix based on the output library path ([source](https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=binutils/dlltool.c;h=e2af20847009945b4c61a6fef08268fbb4429715;hb=b51c2fec1da205ea3e7354cbb3e253018d64873c#l3992)). The tool, when invoked as part of rustc_codegen_llvm, writes to files at paths such as `C_Users_Foo_AppData_Local_Temp_rustcOFqhXZ_target_lib_h.s`. (The output library path is normalized and non-alphanumeric characters are replaced with underscores.)

14 months agoRollup merge of #107446 - clubby789:rustc-parse-diag-migrate, r=compiler-errors
Matthias Krüger [Thu, 9 Feb 2023 10:21:57 +0000 (11:21 +0100)]
Rollup merge of #107446 - clubby789:rustc-parse-diag-migrate, r=compiler-errors

Migrate some of `rustc_parse` to derive diagnostics

`@rustbot` label +A-translation
r? rust-lang/diagnostics
cc #100717

14 months agouse idiomatic formatting
Tshepang Mbambo [Thu, 9 Feb 2023 08:57:52 +0000 (10:57 +0200)]
use idiomatic formatting

Also, remove needless else

14 months agoport over symlink_file function from Build to Config and create symlink for legacy...
Zephaniah Ong [Thu, 9 Feb 2023 08:01:29 +0000 (16:01 +0800)]
port over symlink_file function from Build to Config and create symlink for legacy rustfmt path

14 months agoAuto merge of #106938 - GuillaumeGomez:normalize-projection-field-ty, r=oli-obk
bors [Thu, 9 Feb 2023 07:08:19 +0000 (07:08 +0000)]
Auto merge of #106938 - GuillaumeGomez:normalize-projection-field-ty, r=oli-obk

Add missing normalization for union fields types

Overshadows https://github.com/rust-lang/rust/pull/106808.
From the experiment https://github.com/rust-lang/rust/pull/103985.

In short, it allows to use projections as a type for union's fields.

cc `@compiler-errors`
r? `@oli-obk`

14 months agoAuto merge of #107828 - compiler-errors:rollup-gyj6dgj, r=compiler-errors
bors [Thu, 9 Feb 2023 04:03:20 +0000 (04:03 +0000)]
Auto merge of #107828 - compiler-errors:rollup-gyj6dgj, r=compiler-errors

Rollup of 9 pull requests

Successful merges:

 - #107317 (Implement `AsFd` and `AsRawFd` for `Rc`)
 - #107429 (Stabilize feature `cstr_from_bytes_until_nul`)
 - #107713 (Extend `BYTE_SLICE_IN_PACKED_STRUCT_WITH_DERIVE`.)
 - #107761 (Replace a command line flag with an env var to allow tools to initialize the tracing loggers at their own discretion)
 - #107790 ( x.py fails all downloads that use a tempdir with snap curl #107722)
 - #107799 (correctly update goals in the cache)
 - #107813 (Do not eagerly recover for bad `impl Trait` types in macros)
 - #107817 (rustdoc: use svgo to shrink `wheel.svg`)
 - #107819 (Set `rust-analyzer.check.invocationLocation` to `root`)

Failed merges:

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

14 months agoRollup merge of #107819 - clubby789:x-py-root, r=jyn514
Michael Goulet [Thu, 9 Feb 2023 04:01:28 +0000 (20:01 -0800)]
Rollup merge of #107819 - clubby789:x-py-root, r=jyn514

Set `rust-analyzer.check.invocationLocation` to `root`

Add
```json
    "rust-analyzer.check.invocationLocation": "root",
    "rust-analyzer.check.invocationStrategy": "once",
```
to the bundled VS code config. This prevents an error with r-a invoking `python3 x.py` in `src/bootstrap` where `x.py` does not exist.

r? ``@jyn514``

14 months agoRollup merge of #107817 - notriddle:notriddle/wheel-svg, r=GuillaumeGomez
Michael Goulet [Thu, 9 Feb 2023 04:01:27 +0000 (20:01 -0800)]
Rollup merge of #107817 - notriddle:notriddle/wheel-svg, r=GuillaumeGomez

rustdoc: use svgo to shrink `wheel.svg`

use [svgo] to shrink `wheel.svg`

[svgo]: https://github.com/svg/svgo

    $ du -bs src/librustdoc/html/static/images/wheel.svg wheel-old.svg
    2972    src/librustdoc/html/static/images/wheel.svg
    3764    wheel-old.svg

100*((2972-3764)/3764) = -21.04%

14 months agoRollup merge of #107813 - compiler-errors:bad-impl-trait-in-macro-is-ok, r=estebank
Michael Goulet [Thu, 9 Feb 2023 04:01:26 +0000 (20:01 -0800)]
Rollup merge of #107813 - compiler-errors:bad-impl-trait-in-macro-is-ok, r=estebank

Do not eagerly recover for bad `impl Trait` types in macros

Fixes #107796

cc #106712, ```@estebank``` and ```@Ezrashaw``` please make sure to use [`Parser::may_recover`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_parse/parser/struct.Parser.html#method.may_recover) for all eager-token-consuming parser recoveries.

This also fixes a separate regression from #99915, that was introduced before we added `may_recover` though.

14 months agoRollup merge of #107799 - lcnr:update-provisional-result, r=oli-obk
Michael Goulet [Thu, 9 Feb 2023 04:01:26 +0000 (20:01 -0800)]
Rollup merge of #107799 - lcnr:update-provisional-result, r=oli-obk

correctly update goals in the cache

we may want to actually write the response for our goal into the provisional or global cache instead of simply using the result from the last iteration '^^

r? ```@rust-lang/initiative-trait-system-refactor```

14 months agoRollup merge of #107790 - tharunsuresh-code:snap_curl, r=jyn514
Michael Goulet [Thu, 9 Feb 2023 04:01:25 +0000 (20:01 -0800)]
Rollup merge of #107790 - tharunsuresh-code:snap_curl, r=jyn514

 x.py fails all downloads that use a tempdir with snap curl #107722

Have used the open() library from python to capture the binary output of the curl command and write it to a file using stdout of the subprocess. Added a single-line comment mentioning the redirect operator.

14 months agoRollup merge of #107761 - oli-obk:miri_🪵, r=TaKO8Ki
Michael Goulet [Thu, 9 Feb 2023 04:01:25 +0000 (20:01 -0800)]
Rollup merge of #107761 - oli-obk:miri_🪵, r=TaKO8Ki

Replace a command line flag with an env var to allow tools to initialize the tracing loggers at their own discretion

fixes https://github.com/rust-lang/miri/issues/2778

this was introduced in https://github.com/rust-lang/rust/pull/104645, so this PR reverts the flag-part and uses an env var instead.

14 months agoRollup merge of #107713 - nnethercote:extend-BYTE_SLICE_IN_PACKED_STRUCT_WITH_DERIVE...
Michael Goulet [Thu, 9 Feb 2023 04:01:25 +0000 (20:01 -0800)]
Rollup merge of #107713 - nnethercote:extend-BYTE_SLICE_IN_PACKED_STRUCT_WITH_DERIVE, r=RalfJung

Extend `BYTE_SLICE_IN_PACKED_STRUCT_WITH_DERIVE`.

To temporarily allow a `str` field in a packed struct using `derive`, along with `[u8]`.

r? ``@RalfJung``

14 months agoRollup merge of #107429 - tgross35:from-bytes-until-null-stabilization, r=dtolnay
Michael Goulet [Thu, 9 Feb 2023 04:01:24 +0000 (20:01 -0800)]
Rollup merge of #107429 - tgross35:from-bytes-until-null-stabilization, r=dtolnay

Stabilize feature `cstr_from_bytes_until_nul`

This PR seeks to stabilize `cstr_from_bytes_until_nul`.

Partially addresses #95027

This function has only been on nightly for about 10 months, but I think it is simple enough that there isn't harm discussing stabilization. It has also had at least a handful of mentions on both the user forum and the discord, so it seems like it's already in use or at least known.

This needs FCP still.

Comment on potential discussion points:
- eventual conversion of `CStr` to be a single thin pointer: this function will still be useful to provide a safe way to create a `CStr` after this change.
- should this return a length too, to address concerns about the `CStr` change? I don't see it as being particularly useful, and it seems less ergonomic (i.e. returning `Result<(&CStr, usize), FromBytesUntilNulError>`). I think users that also need this length without the additional `strlen` call are likely better off using a combination of other methods, but this is up for discussion
- `CString::from_vec_until_nul`: this is also useful, but it doesn't even have a nightly implementation merged yet. I propose feature gating that separately, as opposed to blocking this `CStr` implementation on that

Possible alternatives:

A user can use `from_bytes_with_nul` on a slice up to `my_slice[..my_slice.iter().find(|c| c == 0).unwrap()]`. However; that is significantly less ergonomic, and is a bit more work for the compiler to optimize compared the direct `memchr` call that this wraps.

## New stable API

```rs
// both in core::ffi

pub struct FromBytesUntilNulError(());

impl CStr {
    pub const fn from_bytes_until_nul(
        bytes: &[u8]
    ) -> Result<&CStr, FromBytesUntilNulError>
}
```

cc ```@ericseppanen``` original author, ```@Mark-Simulacrum``` original reviewer, ```@m-ou-se``` brought up some issues on the thin pointer CStr

```@rustbot``` modify labels: +T-libs-api +needs-fcp

14 months agoRollup merge of #107317 - ids1024:asfd-rc, r=dtolnay
Michael Goulet [Thu, 9 Feb 2023 04:01:24 +0000 (20:01 -0800)]
Rollup merge of #107317 - ids1024:asfd-rc, r=dtolnay

Implement `AsFd` and `AsRawFd` for `Rc`

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

14 months agoExtend `BYTE_SLICE_IN_PACKED_STRUCT_WITH_DERIVE`.
Nicholas Nethercote [Mon, 6 Feb 2023 01:58:39 +0000 (12:58 +1100)]
Extend `BYTE_SLICE_IN_PACKED_STRUCT_WITH_DERIVE`.

To temporarily allow a `str` field in a packed struct using `derive`,
along with `[u8]`.

14 months agoAuto merge of #107717 - nnethercote:opt-TyKind-eq, r=compiler-errors
bors [Thu, 9 Feb 2023 00:41:31 +0000 (00:41 +0000)]
Auto merge of #107717 - nnethercote:opt-TyKind-eq, r=compiler-errors

Optimize `TyKind::eq`.

r? `@ghost`

14 months agoSet `rust-analyzer.check.invocationLocation` to `root`
clubby789 [Wed, 8 Feb 2023 22:38:20 +0000 (22:38 +0000)]
Set `rust-analyzer.check.invocationLocation` to `root`

14 months agorustdoc: use [svgo] to shrink `wheel.svg`
Michael Howell [Wed, 8 Feb 2023 21:05:20 +0000 (14:05 -0700)]
rustdoc: use [svgo] to shrink `wheel.svg`

[svgo]: https://github.com/svg/svgo

    $ du -bs src/librustdoc/html/static/images/wheel.svg wheel-old.svg
    2972    src/librustdoc/html/static/images/wheel.svg
    3764    wheel-old.svg

100*((2972-3764)/3764) = -21.04%

14 months agoAuto merge of #107811 - matthiaskrgr:rollup-rpjzshk, r=matthiaskrgr
bors [Wed, 8 Feb 2023 20:11:35 +0000 (20:11 +0000)]
Auto merge of #107811 - matthiaskrgr:rollup-rpjzshk, r=matthiaskrgr

Rollup of 8 pull requests

Successful merges:

 - #105641 (Implement cursors for BTreeMap)
 - #107271 (Treat Drop as a rmw operation)
 - #107710 (Update strip-ansi-escapes and vte)
 - #107758 (Change `arena_cache` to not alter the declared query result)
 - #107777 (Make `derive_const` derive properly const-if-const impls)
 - #107780 (Rename `replace_bound_vars_with_*` to `instantiate_binder_with_*`)
 - #107793 (Add missing tracking issue for `RawOsError`)
 - #107807 (Fix small debug typo)

Failed merges:

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

14 months agobootstrap.py: fix build-failure message
KaDiWa [Wed, 8 Feb 2023 18:19:23 +0000 (19:19 +0100)]
bootstrap.py: fix build-failure message

14 months agoadd (currently ICEing) test
lcnr [Wed, 8 Feb 2023 13:16:22 +0000 (14:16 +0100)]
add (currently ICEing) test

14 months agocorrectly update goals in the cache
lcnr [Wed, 8 Feb 2023 12:50:27 +0000 (13:50 +0100)]
correctly update goals in the cache

14 months agoDo not eagerly recover for bad impl-trait in macros
Michael Goulet [Wed, 8 Feb 2023 17:56:04 +0000 (17:56 +0000)]
Do not eagerly recover for bad impl-trait in macros

14 months agoRollup merge of #107807 - GuillaumeGomez:fix-small-debug-typo, r=notriddle
Matthias Krüger [Wed, 8 Feb 2023 17:32:45 +0000 (18:32 +0100)]
Rollup merge of #107807 - GuillaumeGomez:fix-small-debug-typo, r=notriddle

Fix small debug typo

r? ``@notriddle``

14 months agoRollup merge of #107793 - joboet:raw_os_error_ty_tracking, r=Dylan-DPC
Matthias Krüger [Wed, 8 Feb 2023 17:32:44 +0000 (18:32 +0100)]
Rollup merge of #107793 - joboet:raw_os_error_ty_tracking, r=Dylan-DPC

Add missing tracking issue for `RawOsError`

I forgot to add it in the original PR…

See #107792.

```@rustbot``` label +T-libs-api -T-libs

14 months agoRollup merge of #107780 - compiler-errors:instantiate-binder, r=lcnr
Matthias Krüger [Wed, 8 Feb 2023 17:32:44 +0000 (18:32 +0100)]
Rollup merge of #107780 - compiler-errors:instantiate-binder, r=lcnr

Rename `replace_bound_vars_with_*` to `instantiate_binder_with_*`

Mentioning "binder" rather than "bound vars", imo, makes it clearer that we're doing something to the binder as a whole.

Also, "instantiate" is the verb that I'm always reaching for when I'm looking for these functions, and the name that we use in the new solver anyways.

r? types

14 months agoRollup merge of #107777 - compiler-errors:derive_const-actually-derive-const, r=fee1...
Matthias Krüger [Wed, 8 Feb 2023 17:32:43 +0000 (18:32 +0100)]
Rollup merge of #107777 - compiler-errors:derive_const-actually-derive-const, r=fee1-dead

Make `derive_const` derive properly const-if-const impls

Fixes #107774
Fixes #107666

Also fixes rendering of const-if-const bounds in pretty printing.

r? ```@oli-obk``` or ```@fee1-dead```

14 months agoRollup merge of #107758 - Zoxc:arena-enref, r=cjgillot
Matthias Krüger [Wed, 8 Feb 2023 17:32:43 +0000 (18:32 +0100)]
Rollup merge of #107758 - Zoxc:arena-enref, r=cjgillot

Change `arena_cache` to not alter the declared query result

This makes the return types a bit clearer, limiting `arena_cache`'s effect to just the computation side. It also makes it easier to potentially remove `arena_cache`.

r? ```@cjgillot```

14 months agoRollup merge of #107710 - ehuss:update-strip-ansi-escapes, r=Mark-Simulacrum
Matthias Krüger [Wed, 8 Feb 2023 17:32:42 +0000 (18:32 +0100)]
Rollup merge of #107710 - ehuss:update-strip-ansi-escapes, r=Mark-Simulacrum

Update strip-ansi-escapes and vte

This updates strip-ansi-escapes from 0.1.0 to 0.1.1 (and consequently vte).
Changes: https://github.com/luser/strip-ansi-escapes/compare/0.1.0...0.1.1
The only change really is updating vte which fixes some parsing issues (and drops the vendored source size by several megabytes).

Closes #107708

14 months agoRollup merge of #107271 - Zeegomo:drop-rmw, r=oli-obk
Matthias Krüger [Wed, 8 Feb 2023 17:32:41 +0000 (18:32 +0100)]
Rollup merge of #107271 - Zeegomo:drop-rmw, r=oli-obk

Treat Drop as a rmw operation

Previously, a Drop terminator was considered a move in MIR. This commit changes the behavior to only treat Drop as a mutable access to the dropped place.

In order for this change to be correct, we need to guarantee that

1.  A dropped value won't be used again
   2.  Places that appear in a drop won't be used again before a
     subsequent initialization.

We can ensure this to be correct at MIR construction because Drop will only be emitted when a variable goes out of scope, thus having:
*   (1) as there is no way of reaching the old value. drop-elaboration
     will also remove any uninitialized drop.
 * (2) as the place can't be named following the end of the scope.

However, the initialization status, previously tracked by moves, should also be tied to the execution of a Drop, hence the additional logic in the dataflow analyses.

From discussion in [this thread](https://rust-lang.zulipchat.com/#narrow/stream/233931-t-compiler.2Fmajor-changes/topic/.60DROP.60.20to.20.60DROP_IF.60.20compiler-team.23558), originating from https://github.com/rust-lang/compiler-team/issues/558.
See also https://github.com/rust-lang/rust/pull/104488#discussion_r1085556010

14 months agoRollup merge of #105641 - Amanieu:btree_cursor, r=m-ou-se
Matthias Krüger [Wed, 8 Feb 2023 17:32:41 +0000 (18:32 +0100)]
Rollup merge of #105641 - Amanieu:btree_cursor, r=m-ou-se

Implement cursors for BTreeMap

See the ACP for an overview of the API: https://github.com/rust-lang/libs-team/issues/141

The implementation is split into 2 commits:
- The first changes the internal insertion functions to return a handle to the newly inserted element. The lifetimes involved are a bit hairy since we need a mutable handle to both the `BTreeMap` itself (which holds the root) and the nodes allocated in memory. I have tested that this passes the standard library testsuite under miri.
- The second commit implements the cursor API itself. This is more straightforward to follow but still involves some unsafe code to deal with simultaneous mutable borrows of the tree root and the node that is currently being iterated.

14 months agoAuto merge of #107644 - Zoxc:query-cache-tweak, r=cjgillot
bors [Wed, 8 Feb 2023 16:59:18 +0000 (16:59 +0000)]
Auto merge of #107644 - Zoxc:query-cache-tweak, r=cjgillot

Remove QueryStorage::store_nocache

This method was added in https://github.com/rust-lang/rust/pull/70674 but it doesn't seem to serve any purpose.

14 months agoFix small debug typo
Guillaume Gomez [Wed, 8 Feb 2023 16:31:54 +0000 (17:31 +0100)]
Fix small debug typo

14 months agostd: add tracking issue for `RawOsError`
joboet [Wed, 8 Feb 2023 11:35:27 +0000 (12:35 +0100)]
std: add tracking issue for `RawOsError`

14 months agoAuto merge of #107529 - Zoxc:inline-tweak-profile, r=cjgillot
bors [Wed, 8 Feb 2023 10:35:46 +0000 (10:35 +0000)]
Auto merge of #107529 - Zoxc:inline-tweak-profile, r=cjgillot

Optimize query_cache_hit to reduce code size of the query hot path.

A small tweak which improves performance on check builds by 0.33% and reduces `rustc_driver` size by 1%.
<table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><b>Before</b></th><td colspan="2"><b>After</b></th></tr><tr><td align="right">Time</td><td align="right">Time</td><td align="right">%</th><td align="right">Time</td><td align="right">%</th></tr><tr><td>🟣 <b>clap</b>:check</td><td align="right">1.7978s</td><td align="right">1.7980s</td><td align="right"> 0.01%</td><td align="right">1.7930s</td><td align="right"> -0.27%</td></tr><tr><td>🟣 <b>hyper</b>:check</td><td align="right">0.2594s</td><td align="right">0.2591s</td><td align="right"> -0.12%</td><td align="right">0.2592s</td><td align="right"> -0.09%</td></tr><tr><td>🟣 <b>syntex_syntax</b>:check</td><td align="right">6.2522s</td><td align="right">6.2540s</td><td align="right"> 0.03%</td><td align="right">6.2358s</td><td align="right"> -0.26%</td></tr><tr><td>🟣 <b>syn</b>:check</td><td align="right">1.5889s</td><td align="right">1.5880s</td><td align="right"> -0.05%</td><td align="right">1.5799s</td><td align="right"> -0.57%</td></tr><tr><td>🟣 <b>regex</b>:check</td><td align="right">0.9941s</td><td align="right">0.9939s</td><td align="right"> -0.02%</td><td align="right">0.9893s</td><td align="right"> -0.49%</td></tr><tr><td>Total</td><td align="right">10.8925s</td><td align="right">10.8930s</td><td align="right"> 0.01%</td><td align="right">10.8572s</td><td align="right"> -0.32%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">0.9997s</td><td align="right"> -0.03%</td><td align="right">0.9967s</td><td align="right"> -0.33%</td></tr></table>

r? `@cjgillot`

14 months agoChange `arena_cache` to not alter the declared query result
John Kåre Alsaker [Tue, 7 Feb 2023 11:23:31 +0000 (12:23 +0100)]
Change `arena_cache` to not alter the declared query result

14 months ago x.py fails all downloads that use a tempdir with snap curl #107722
Tharun Suresh [Wed, 8 Feb 2023 08:07:15 +0000 (13:37 +0530)]
 x.py fails all downloads that use a tempdir with snap curl #107722

14 months agoAuto merge of #107788 - matthiaskrgr:rollup-mw10sli, r=matthiaskrgr
bors [Wed, 8 Feb 2023 07:43:37 +0000 (07:43 +0000)]
Auto merge of #107788 - matthiaskrgr:rollup-mw10sli, r=matthiaskrgr

Rollup of 8 pull requests

Successful merges:

 - #107656 (Bump rust-installer)
 - #107757 (Allow automatically creating vscode `settings.json` with `x setup`)
 - #107769 (Rename `PointerSized` to `PointerLike`)
 - #107770 (rustdoc: use a newline instead of `<br>` to format code headers)
 - #107771 (Tweak ICE message)
 - #107773 (Clearly signal purpose of the yaml template)
 - #107776 (Docs: Fix format of headings in String::reserve)
 - #107779 (Remove astconv usage in diagnostic)

Failed merges:

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

14 months agoRollup merge of #107779 - compiler-errors:issue-107775, r=jackh726
Matthias Krüger [Wed, 8 Feb 2023 06:13:29 +0000 (07:13 +0100)]
Rollup merge of #107779 - compiler-errors:issue-107775, r=jackh726

Remove astconv usage in diagnostic

Fixes #107775

Location of the test sucks, I know, but I needed to put it somewhere :sweat:
The issue here is that the root cause of the issue has nothing to do with what's being tested, so I couldn't really give it a better name. Oh well.

14 months agoRollup merge of #107776 - dbrgn:docs-string-reserve-headings, r=cuviper
Matthias Krüger [Wed, 8 Feb 2023 06:13:28 +0000 (07:13 +0100)]
Rollup merge of #107776 - dbrgn:docs-string-reserve-headings, r=cuviper

Docs: Fix format of headings in String::reserve

It was inconsistent with other doc comments in the same module (and the rest of the rust std docs).

14 months agoRollup merge of #107773 - Mark-Simulacrum:rename-auto-template, r=estebank
Matthias Krüger [Wed, 8 Feb 2023 06:13:28 +0000 (07:13 +0100)]
Rollup merge of #107773 - Mark-Simulacrum:rename-auto-template, r=estebank

Clearly signal purpose of the yaml template

Following up on https://github.com/rust-lang/rust/pull/106898#issuecomment-1383238532

14 months agoRollup merge of #107771 - estebank:ice-msg, r=compiler-errors
Matthias Krüger [Wed, 8 Feb 2023 06:13:27 +0000 (07:13 +0100)]
Rollup merge of #107771 - estebank:ice-msg, r=compiler-errors

Tweak ICE message

Modify main message to be more conversational and emit one fewer note.

14 months agoRollup merge of #107770 - notriddle:notriddle/br2nl, r=GuillaumeGomez
Matthias Krüger [Wed, 8 Feb 2023 06:13:27 +0000 (07:13 +0100)]
Rollup merge of #107770 - notriddle:notriddle/br2nl, r=GuillaumeGomez

rustdoc: use a newline instead of `<br>` to format code headers

Since these elements now use `white-space: pre-wrap` since #107615, it's fine to use newlines for formatting, which is smaller and a bit less complicated.

14 months agoRollup merge of #107769 - compiler-errors:pointer-like, r=eholk
Matthias Krüger [Wed, 8 Feb 2023 06:13:26 +0000 (07:13 +0100)]
Rollup merge of #107769 - compiler-errors:pointer-like, r=eholk

Rename `PointerSized` to `PointerLike`

The old name was unnecessarily vague. This PR renames a nightly language feature that I added, so I don't think it needs any additional approval, though anyone can feel free to speak up if you dislike the rename.

It's still unsatisfying that we don't the user which of {size, alignment} is wrong, but this trait really is just a stepping stone for a more generalized mechanism to create `dyn*`, just meant for nightly testing, so I don't think it really deserves additional diagnostic machinery for now.

Fixes #107696, cc ``@RalfJung``
r? ``@eholk``

14 months agoRollup merge of #107757 - clubby789:setup-settings-json, r=jyn514
Matthias Krüger [Wed, 8 Feb 2023 06:13:26 +0000 (07:13 +0100)]
Rollup merge of #107757 - clubby789:setup-settings-json, r=jyn514

Allow automatically creating vscode `settings.json` with `x setup`

Closes #107703

14 months agoRollup merge of #107656 - jonhoo:bump-rust-installer, r=Mark-Simulacrum
Matthias Krüger [Wed, 8 Feb 2023 06:13:26 +0000 (07:13 +0100)]
Rollup merge of #107656 - jonhoo:bump-rust-installer, r=Mark-Simulacrum

Bump rust-installer

Makes generation of `manifest.in` deterministic:
https://github.com/rust-lang/rust-installer/pull/120

14 months agoAuto merge of #107778 - weihanglo:update-cargo, r=weihanglo
bors [Wed, 8 Feb 2023 04:04:58 +0000 (04:04 +0000)]
Auto merge of #107778 - weihanglo:update-cargo, r=weihanglo

Update cargo

12 commits in e84a7928d93a31f284b497c214a2ece69b4d7719..82c3bb79e3a19a5164e33819ef81bfc2c984bc56 2023-01-31 22:18:09 +0000 to 2023-02-04 22:52:16 +0000

- util toml targets: Do not infer directory as a file (rust-lang/cargo#11678)
- Add more guidance on how to implement unstable features (rust-lang/cargo#11675)
- Fix unstable chapter layout for codegen-backend (rust-lang/cargo#11676)
- refactor: mod.rs over "name".rs for consistency (rust-lang/cargo#11673)
- Verify source before recompile (rust-lang/cargo#11672)
- doc: more doc comments and intra-doc links (rust-lang/cargo#11669)
- Turn off debuginfo for build dependencies v2 (rust-lang/cargo#11252)
- config: Deny CARGO_HOME in [env] table (fixes rust-lang/cargo#11590) (rust-lang/cargo#11644)
- Fix the wrong comment (rust-lang/cargo#11651)
- Add partial support for SSH known hosts markers (rust-lang/cargo#11635)
- Replace `winapi` with `windows-sys` crate. (rust-lang/cargo#11656)
- Handle .cargo-ok being truncated (rust-lang/cargo#11665)

r? `@ghost`

14 months agoAuto merge of #107688 - lukas-code:projection-with-lifetime, r=jackh726
bors [Wed, 8 Feb 2023 00:34:18 +0000 (00:34 +0000)]
Auto merge of #107688 - lukas-code:projection-with-lifetime, r=jackh726

ReErased regions are local

fix https://github.com/rust-lang/rust/issues/107678
fix https://github.com/rust-lang/rust/issues/107684
fix https://github.com/rust-lang/rust/issues/107686
fix https://github.com/rust-lang/rust/issues/107691
fix https://github.com/rust-lang/rust/issues/107730

14 months agoReplacing bound vars is actually instantiating a binder
Michael Goulet [Tue, 7 Feb 2023 23:13:22 +0000 (23:13 +0000)]
Replacing bound vars is actually instantiating a binder

14 months agoRemove astconv usage in diagnostic
Michael Goulet [Tue, 7 Feb 2023 23:08:25 +0000 (23:08 +0000)]
Remove astconv usage in diagnostic

14 months agoUpdate cargo
Weihang Lo [Tue, 7 Feb 2023 22:26:22 +0000 (22:26 +0000)]
Update cargo

12 commits in e84a7928d93a31f284b497c214a2ece69b4d7719..82c3bb79e3a19a5164e33819ef81bfc2c984bc56
2023-01-31 22:18:09 +0000 to 2023-02-04 22:52:16 +0000

- util toml targets: Do not infer directory as a file (rust-lang/cargo#11678)
- Add more guidance on how to implement unstable features (rust-lang/cargo#11675)
- Fix unstable chapter layout for codegen-backend (rust-lang/cargo#11676)
- refactor: mod.rs over "name".rs for consistency (rust-lang/cargo#11673)
- Verify source before recompile (rust-lang/cargo#11672)
- doc: more doc comments and intra-doc links (rust-lang/cargo#11669)
- Turn off debuginfo for build dependencies v2 (rust-lang/cargo#11252)
- config: Deny CARGO_HOME in [env] table (fixes rust-lang/cargo#11590) (rust-lang/cargo#11644)
- Fix the wrong comment (rust-lang/cargo#11651)
- Add partial support for SSH known hosts markers (rust-lang/cargo#11635)
- Replace `winapi` with `windows-sys` crate. (rust-lang/cargo#11656)
- Handle .cargo-ok being truncated (rust-lang/cargo#11665)

14 months agoAdd ~const bounds trait bounds when using derive_const
Michael Goulet [Tue, 7 Feb 2023 20:59:48 +0000 (20:59 +0000)]
Add ~const bounds trait bounds when using derive_const

14 months agoExpand const-if-const trait bounds correctly
Michael Goulet [Tue, 7 Feb 2023 20:22:42 +0000 (20:22 +0000)]
Expand const-if-const trait bounds correctly

14 months agoAuto merge of #107768 - matthiaskrgr:rollup-9u4cal4, r=matthiaskrgr
bors [Tue, 7 Feb 2023 20:58:20 +0000 (20:58 +0000)]
Auto merge of #107768 - matthiaskrgr:rollup-9u4cal4, r=matthiaskrgr

Rollup of 8 pull requests

Successful merges:

 - #107719 (Remove `arena_cache` modifier from `upstream_monomorphizations_for`)
 - #107740 (Avoid locking the global context across the `after_expansion` callback)
 - #107746 (Split fn_ctxt/adjust_fulfillment_errors from fn_ctxt/checks)
 - #107749 (allow quick-edit convenience)
 - #107750 (make more readable)
 - #107755 (remove binder from query constraints)
 - #107756 (miri: fix ICE when running out of address space)
 - #107764 (llvm-16: Use Triple.h from new header location.)

Failed merges:

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

14 months agoDocs: Fix format of headings in String::reserve
Danilo Bargen [Tue, 7 Feb 2023 20:32:11 +0000 (21:32 +0100)]
Docs: Fix format of headings in String::reserve

14 months agoClearly signal purpose of the yaml template
Mark Rousskov [Tue, 7 Feb 2023 19:31:38 +0000 (14:31 -0500)]
Clearly signal purpose of the yaml template

14 months agoTweak ICE message
Esteban Küber [Tue, 7 Feb 2023 19:17:24 +0000 (19:17 +0000)]
Tweak ICE message

Modify main message to be more conversational and emit one fewer note.

14 months agoRename PointerSized to PointerLike
Michael Goulet [Tue, 7 Feb 2023 18:02:20 +0000 (18:02 +0000)]
Rename PointerSized to PointerLike

14 months agorustdoc: use a newline instead of `<br>` to format code headers
Michael Howell [Tue, 7 Feb 2023 18:23:25 +0000 (11:23 -0700)]
rustdoc: use a newline instead of `<br>` to format code headers

Since these elements now use `white-space: pre-wrap` since
784665d4ce59c5239791f1f96fa2137e47ca1817, it's fine to use newlines
for formatting, which is smaller and a bit less complicated.

14 months agoAuto merge of #107767 - matthiaskrgr:rollup-9m1qfso, r=matthiaskrgr
bors [Tue, 7 Feb 2023 17:19:47 +0000 (17:19 +0000)]
Auto merge of #107767 - matthiaskrgr:rollup-9m1qfso, r=matthiaskrgr

Rollup of 8 pull requests

Successful merges:

 - #100599 (Add compiler error E0523 long description and test)
 - #107471 (rustdoc: do not include empty default-settings tag in HTML)
 - #107555 (Modify existing bounds if they exist)
 - #107662 (Turn projections into copies in CopyProp.)
 - #107695 (Add test for Future inflating arg size to 3x )
 - #107700 (Run the tools builder on all PRs)
 - #107706 (Mark 'atomic_mut_ptr' methods const)
 - #107709 (Fix problem noticed in PR106859 with char -> u8 suggestion)

Failed merges:

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

14 months agoAllow automatically creating vscode `settings.json` from bootstrap
clubby789 [Tue, 7 Feb 2023 11:40:55 +0000 (11:40 +0000)]
Allow automatically creating vscode `settings.json` from bootstrap

14 months agoRollup merge of #107764 - maurer:llvm-16, r=cuviper
Matthias Krüger [Tue, 7 Feb 2023 16:57:18 +0000 (17:57 +0100)]
Rollup merge of #107764 - maurer:llvm-16, r=cuviper

llvm-16: Use Triple.h from new header location.

LLVM 16 has moved Triple.h from ADT and into TargetParser.

LLVM [landed a commit](https://github.com/llvm/llvm-project/commit/62c7f035b4392c1933550eead6ddab35122720bc) this morning moving the header. This change should make rustc continue to build against LLVM main.

14 months agoRollup merge of #107756 - RalfJung:miri-out-of-addresses, r=oli-obk
Matthias Krüger [Tue, 7 Feb 2023 16:57:18 +0000 (17:57 +0100)]
Rollup merge of #107756 - RalfJung:miri-out-of-addresses, r=oli-obk

miri: fix ICE when running out of address space

Fixes https://github.com/rust-lang/miri/issues/2769
r? `@oli-obk`

I didn't add a test since that requires https://github.com/oli-obk/ui_test/issues/38 (host must be 64bit and target 32bit). Also the test takes ~30s, so I am not sure if we want to have it in the test suite?

14 months agoRollup merge of #107709 - tialaramex:master, r=compiler-errors
Matthias Krüger [Tue, 7 Feb 2023 16:57:17 +0000 (17:57 +0100)]
Rollup merge of #107709 - tialaramex:master, r=compiler-errors

Fix problem noticed in PR106859 with char -> u8 suggestion

HN reader `@ayosec` noticed that my #106859 a few weeks back, malfunctions if you have a Unicode escape, the code suggested b'\u{0}' if you tried to use '\u{0}' where a byte should be, when of course b'\u{0}' is not a byte literal, regardless of the codepoint you can't write Unicode escapes in a byte literal at all.

My proposed fix here just checks that the "character" you wrote is fewer than 5 bytes, thus allowing \x7F and similar escapes but conveniently forbidding even the smallest Unicode escape \u{0} before offering the suggestion as before.

I have provided an updated test which includes examples which do and don't work because of this additional rule.

14 months agoRollup merge of #107755 - lcnr:no-binder, r=oli-obk
Matthias Krüger [Tue, 7 Feb 2023 16:57:17 +0000 (17:57 +0100)]
Rollup merge of #107755 - lcnr:no-binder, r=oli-obk

remove binder from query constraints

r? types

14 months agoRollup merge of #107750 - tshepang:readability, r=GuillaumeGomez
Matthias Krüger [Tue, 7 Feb 2023 16:57:17 +0000 (17:57 +0100)]
Rollup merge of #107750 - tshepang:readability, r=GuillaumeGomez

make more readable

14 months agoRollup merge of #107706 - tgross35:atomic-as-mut-ptr, r=m-ou-se
Matthias Krüger [Tue, 7 Feb 2023 16:57:16 +0000 (17:57 +0100)]
Rollup merge of #107706 - tgross35:atomic-as-mut-ptr, r=m-ou-se

Mark 'atomic_mut_ptr' methods const

There's nothing that would block these methods from being const (just an UnsafeCell get), and it would be helpful for FFI interfaces in static contexts

Related tracking issue: #66893

14 months agoRollup merge of #107749 - tshepang:editing-convenience, r=michaelwoerister
Matthias Krüger [Tue, 7 Feb 2023 16:57:16 +0000 (17:57 +0100)]
Rollup merge of #107749 - tshepang:editing-convenience, r=michaelwoerister

allow quick-edit convenience

14 months agoRollup merge of #107700 - jyn514:tools-builder, r=Mark-Simulacrum
Matthias Krüger [Tue, 7 Feb 2023 16:57:16 +0000 (17:57 +0100)]
Rollup merge of #107700 - jyn514:tools-builder, r=Mark-Simulacrum

Run the tools builder on all PRs

Previously, it would only run on changes to subtrees, submodules, or select directories. That made it so that changes to the compiler that broke tools would only be detected on a full bors merge. This makes it so the tools builder runs by default, making it easier to catch breaking changes to clippy (which was the most affected).

r? ``@Mark-Simulacrum`` cc ``@pietroalbini`` ``@flip1995`` ``@m-ou-se``

14 months agoRollup merge of #107746 - Nathan-Fenner:nathanf/clean-up-adjust_fulfillment_errors...
Matthias Krüger [Tue, 7 Feb 2023 16:57:16 +0000 (17:57 +0100)]
Rollup merge of #107746 - Nathan-Fenner:nathanf/clean-up-adjust_fulfillment_errors, r=compiler-errors

Split fn_ctxt/adjust_fulfillment_errors from fn_ctxt/checks

This is a follow-up from #106477, addressing a small number of the `FIXME`s that were added, by moving some functions into the new(er) `adjust_fulfillment_errors` module.

More cleanup is possible for this file (and I'll hopefully get around to doing some of that soon) but the very first thing is to just move these functions out.

There should be no "real" changes in this PR, besides minor adjustments to imports and the functions being transferred.

14 months agoRollup merge of #107695 - Swatinem:futcallx3, r=compiler-errors
Matthias Krüger [Tue, 7 Feb 2023 16:57:15 +0000 (17:57 +0100)]
Rollup merge of #107695 - Swatinem:futcallx3, r=compiler-errors

Add test for Future inflating arg size to 3x

This adds one more test that should track improvements to generator
layout, like https://github.com/rust-lang/rust/issues/62958 and https://github.com/rust-lang/rust/issues/62575.

In particular, this test highlights suboptimal layout, as the storage
for the argument future is not being reused across its usage as `upvar`,
`local` and `awaitee` (being polled to completion).

This is on top of https://github.com/rust-lang/rust/pull/107692 (as those would conflict with each other)

It is a minimal repro for code mentioned in https://github.com/moka-rs/moka/issues/212#issuecomment-1416914616 (CC `@tatsuya6502)`

14 months agoRollup merge of #107740 - oli-obk:lock_tcx, r=petrochenkov
Matthias Krüger [Tue, 7 Feb 2023 16:57:15 +0000 (17:57 +0100)]
Rollup merge of #107740 - oli-obk:lock_tcx, r=petrochenkov

Avoid locking the global context across the `after_expansion` callback

r? `@petrochenkov`

This was noticed in https://github.com/model-checking/kani/pull/2184#issuecomment-1416566982

This didn't have a perf impact, as it's just an additional 2 or 3 RefCell locks being created.

14 months agoRollup merge of #107662 - cjgillot:copy-projection, r=oli-obk
Matthias Krüger [Tue, 7 Feb 2023 16:57:15 +0000 (17:57 +0100)]
Rollup merge of #107662 - cjgillot:copy-projection, r=oli-obk

Turn projections into copies in CopyProp.

The current implementation can leave behind projections that are moved out several times.

This PR widens the check to turn such moves into copies: a move out of a projection of a copy is equivalent to a copy of the original projection.

14 months agoRollup merge of #107719 - WaffleLapkin:de-arena-allocates-you-UwU, r=cjgillot
Matthias Krüger [Tue, 7 Feb 2023 16:57:15 +0000 (17:57 +0100)]
Rollup merge of #107719 - WaffleLapkin:de-arena-allocates-you-UwU, r=cjgillot

Remove `arena_cache` modifier from `upstream_monomorphizations_for`

Arena-caching a pointer is pretty meaningless as far as I can tell.

14 months agoRollup merge of #107555 - edward-shen:edward-shen/dup-trait-suggestion, r=compiler...
Matthias Krüger [Tue, 7 Feb 2023 16:57:14 +0000 (17:57 +0100)]
Rollup merge of #107555 - edward-shen:edward-shen/dup-trait-suggestion, r=compiler-errors

Modify existing bounds if they exist

Fixes #107335.

This implementation is kinda gross but I don't really see a better way to do it.

This primarily does two things: Modifies `suggest_constraining_type_param` to accept a new parameter that indicates a span to be replaced instead of added, if presented, and limit the additive suggestions to either suggest a new bound on an existing bound (see newly added unit test) or add the generics argument if a generics argument wasn't found.

The former change is required to retain the capability to add an entirely new bounds if it was entirely omitted.

r? ``@compiler-errors``

14 months agoRollup merge of #107471 - notriddle:notriddle/default-settings, r=GuillaumeGomez
Matthias Krüger [Tue, 7 Feb 2023 16:57:14 +0000 (17:57 +0100)]
Rollup merge of #107471 - notriddle:notriddle/default-settings, r=GuillaumeGomez

rustdoc: do not include empty default-settings tag in HTML

14 months agoRollup merge of #100599 - MatthewPeterKelly:add-E0523-description-and-test, r=compile...
Matthias Krüger [Tue, 7 Feb 2023 16:57:13 +0000 (17:57 +0100)]
Rollup merge of #100599 - MatthewPeterKelly:add-E0523-description-and-test, r=compiler-errors,GuillaumeGomez

Add compiler error E0523 long description and test

This PR is one step towards addressing:  https://github.com/rust-lang/rust/issues/61137.

14 months agoRemove QueryStorage::store_nocache
John Kåre Alsaker [Fri, 3 Feb 2023 18:13:45 +0000 (19:13 +0100)]
Remove QueryStorage::store_nocache

14 months agoReplace a command line flag with an env var to allow tools to initialize the tracing...
Oli Scherer [Tue, 7 Feb 2023 14:24:35 +0000 (14:24 +0000)]
Replace a command line flag with an env var to allow tools to initialize the tracing loggers at their own discretion

14 months agollvm-16: Use Triple.h from new header location.
Matthew Maurer [Tue, 7 Feb 2023 14:48:54 +0000 (06:48 -0800)]
llvm-16: Use Triple.h from new header location.

LLVM 16 has moved Triple.h from ADT and into TargetParser

14 months agoForce the allocator to be looked up from the perspective of the rustc binary
bjorn3 [Mon, 6 Feb 2023 18:27:27 +0000 (19:27 +0100)]
Force the allocator to be looked up from the perspective of the rustc binary

Fixes #1303

14 months agoAuto merge of #107671 - CastilloDel:master, r=estebank
bors [Tue, 7 Feb 2023 13:29:45 +0000 (13:29 +0000)]
Auto merge of #107671 - CastilloDel:master, r=estebank

Fix suggestions rendering when the diff span is multiline

Fixes #92741

cc `@estebank`

I think, I finally fixed. I still want to go back and try to clean up the code a bit. I'm open to suggestions.

Some examples of the new suggestions:

```
help: consider removing the borrow
  |
2 -     &
  |
```
```
help: consider removing the borrow
  |
2 -     &
3 -     mut
  |
```
```
help: consider removing the borrow
  |
2 -     &
3 -     mut if true { true } else { false }
2 +     if true { true } else { false }
  |
```

Should we add a test to ensure this behavior doesn't disappear in the future?

14 months agomiri: fix ICE when running out of address space
Ralf Jung [Tue, 7 Feb 2023 10:39:07 +0000 (11:39 +0100)]
miri: fix ICE when running out of address space

14 months agoremove binder from query constraints
lcnr [Tue, 7 Feb 2023 09:59:18 +0000 (10:59 +0100)]
remove binder from query constraints

14 months agoAuto merge of #107704 - jyn514:tidy-ci, r=Mark-Simulacrum
bors [Tue, 7 Feb 2023 09:58:58 +0000 (09:58 +0000)]
Auto merge of #107704 - jyn514:tidy-ci, r=Mark-Simulacrum

Run `expand-yaml-anchors` in `x test tidy`

Previously, the pre-commit hook which runs `x test tidy` could pass only to have CI fail within the first 30 seconds. This adds about 30 seconds to `test tidy` (for an initial run, much less after the tool is built the first time) in exchange for catching errors in `.github/workflows/ci.yml` before they're pushed.

14 months agoAdd test for Future inflating arg size to 3x
Arpad Borsos [Sun, 5 Feb 2023 16:32:52 +0000 (17:32 +0100)]
Add test for Future inflating arg size to 3x

This adds one more test that should track improvements to generator
layout, like #62958 and #62575.

In particular, this test highlights suboptimal layout, as the storage
for the argument future is not being reused across its usage as `upvar`,
`local` and `awaitee` (being polled to completion).

14 months agoSpecify dlltool prefix when generating import libs
Rafael Rivera [Tue, 7 Feb 2023 05:17:06 +0000 (21:17 -0800)]
Specify dlltool prefix when generating import libs

14 months agoAuto merge of #106180 - RalfJung:dereferenceable-generators, r=nbdd0121
bors [Tue, 7 Feb 2023 03:35:10 +0000 (03:35 +0000)]
Auto merge of #106180 - RalfJung:dereferenceable-generators, r=nbdd0121

make &mut !Unpin not dereferenceable, and Box<!Unpin> not noalias

See https://github.com/rust-lang/unsafe-code-guidelines/issues/381 and [this LLVM discussion](https://discourse.llvm.org/t/interaction-of-noalias-and-dereferenceable/66979). The exact semantics of how `noalias` and `dereferenceable` interact are unclear, and `@comex` found a case of LLVM actually exploiting that ambiguity for optimizations. I think for now we should treat LLVM `dereferenceable` as implying a "fake read" to happen immediately at the top of the function (standing in for the spurious reads that LLVM might introduce), and that fake read is subject to all the usual `noalias` restrictions. This means we cannot put `dereferenceable` on `&mut !Unpin` references as those references can alias with other references that are being read and written inside the function (e.g. for self-referential generators), meaning the fake read introduces aliasing conflicts with those other accesses.

For `&` this is already not a problem due to https://github.com/rust-lang/rust/pull/98017 which removed the `dereferenceable` attribute for other reasons.

Regular `&mut Unpin` references are unaffected, so I hope the impact of this is going to be tiny.

The first commit does some refactoring of the `PointerKind` enum since I found the old code very confusing each time I had to touch it. It doesn't change behavior.

Fixes https://github.com/rust-lang/miri/issues/2714

EDIT: Turns out our `Box<!Unpin>` treatment was incorrect, too, so the PR also fixes that now (in codegen and Miri): we do not put `noalias` on these boxes any more.

14 months agomake more readable
Tshepang Mbambo [Tue, 7 Feb 2023 02:54:01 +0000 (04:54 +0200)]
make more readable

14 months agoallow quick-edit convenience
Tshepang Mbambo [Tue, 7 Feb 2023 02:41:13 +0000 (04:41 +0200)]
allow quick-edit convenience

14 months agoSplit fn_ctxt/adjust_fulfillment_errors from fn_ctxt/checks
Nathan Fenner [Tue, 7 Feb 2023 01:21:16 +0000 (17:21 -0800)]
Split fn_ctxt/adjust_fulfillment_errors from fn_ctxt/checks

14 months agoAuto merge of #107693 - petrochenkov:metable, r=oli-obk
bors [Tue, 7 Feb 2023 00:03:02 +0000 (00:03 +0000)]
Auto merge of #107693 - petrochenkov:metable, r=oli-obk

rustc_metadata: Encode/decode some `LazyArrays` without an `Option`

and a couple of related changes, see individual commits.

Addresses comments in https://github.com/rust-lang/rust/pull/107166#discussion_r1083417124 and https://github.com/rust-lang/rust/pull/107166#discussion_r1083768417, cc `@cjgillot` `@oli-obk.`

14 months agoFix problem noticed in PR106859 with char -> u8 suggestion
Nick Lamb [Sun, 5 Feb 2023 23:37:47 +0000 (23:37 +0000)]
Fix problem noticed in PR106859 with char -> u8 suggestion