]> git.lizzy.rs Git - rust.git/log
rust.git
20 months agoDo anonymous lifetimes remapping correctly for nested rpits
Santiago Pastorino [Tue, 18 Oct 2022 17:05:17 +0000 (14:05 -0300)]
Do anonymous lifetimes remapping correctly for nested rpits

20 months agoExtract orig_opt_local_def_id as a function
Santiago Pastorino [Wed, 19 Oct 2022 19:49:21 +0000 (16:49 -0300)]
Extract orig_opt_local_def_id as a function

20 months agoAuto merge of #103214 - Nilstrieb:set-theory, r=petrochenkov
bors [Wed, 19 Oct 2022 13:53:06 +0000 (13:53 +0000)]
Auto merge of #103214 - Nilstrieb:set-theory, r=petrochenkov

Use Set instead of Vec in transitive_relation

Helps with #103195. It doesn't fix the underlying quadraticness but it makes it _a lot_ faster to an extent where even doubling the amount of nested references still takes less than two seconds (50s on nightly).

I want to see whether this causes regressions (because the vec was usually quite small) or improvements (as lookup for bigger sets is now much faster) in real code.

20 months agoAuto merge of #103228 - Dylan-DPC:rollup-31yiauw, r=Dylan-DPC
bors [Wed, 19 Oct 2022 11:12:10 +0000 (11:12 +0000)]
Auto merge of #103228 - Dylan-DPC:rollup-31yiauw, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #102863 (Standardize "use parentheses to call" suggestions between typeck and trait selection)
 - #103034 (Let expressions on RHS shouldn't be terminating scopes)
 - #103127 (Make transpose const and inline)
 - #103153 (Allow `Vec::leak` when using `no_global_oom_handling`)
 - #103182 (Clean up query descriptions)
 - #103216 (Consider patterns in fn params in an `Elided(Infer)` lifetime rib.)

Failed merges:

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

20 months agoUse Set instead of Vec in transitive_relation
nils [Tue, 18 Oct 2022 20:13:26 +0000 (22:13 +0200)]
Use Set instead of Vec in transitive_relation

20 months agoRollup merge of #103216 - cjgillot:issue-103210, r=jackh726
Dylan DPC [Wed, 19 Oct 2022 08:35:54 +0000 (14:05 +0530)]
Rollup merge of #103216 - cjgillot:issue-103210, r=jackh726

Consider patterns in fn params in an `Elided(Infer)` lifetime rib.

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

20 months agoRollup merge of #103182 - Nilstrieb:query-desc-cleanup, r=oli-obk
Dylan DPC [Wed, 19 Oct 2022 08:35:53 +0000 (14:05 +0530)]
Rollup merge of #103182 - Nilstrieb:query-desc-cleanup, r=oli-obk

Clean up query descriptions

Use the same tense everywhere and prefer display over debug, as these descriptions are user facing.

20 months agoRollup merge of #103153 - ChrisDenton:leak-oom, r=m-ou-se
Dylan DPC [Wed, 19 Oct 2022 08:35:53 +0000 (14:05 +0530)]
Rollup merge of #103153 - ChrisDenton:leak-oom, r=m-ou-se

Allow `Vec::leak` when using `no_global_oom_handling`

As [the documentation notes](https://doc.rust-lang.org/std/vec/struct.Vec.html#method.leak), `Vec::leak` hasn't allocated since 1.57.

cc `@Ericson2314` in case I'm missing something.

20 months agoRollup merge of #103127 - SUPERCILEX:inline-const-uninit, r=scottmcm
Dylan DPC [Wed, 19 Oct 2022 08:35:52 +0000 (14:05 +0530)]
Rollup merge of #103127 - SUPERCILEX:inline-const-uninit, r=scottmcm

Make transpose const and inline

r? `@scottmcm`

- These should have been const from the beginning since we're never going to do more than a transmute.
- Inline these always because that's what every other method in MaybeUninit which simply casts does. :) Ok, but a stronger justification is that because we're taking in arrays by `self`, not inlining would defeat the whole purpose of using `MaybeUninit` due to the copying.

20 months agoRollup merge of #103034 - nathanwhit:let-chains-rhs-temporaries, r=wesleywiser
Dylan DPC [Wed, 19 Oct 2022 08:35:52 +0000 (14:05 +0530)]
Rollup merge of #103034 - nathanwhit:let-chains-rhs-temporaries, r=wesleywiser

Let expressions on RHS shouldn't be terminating scopes

Fixes #100276.

Before this PR, we were unconditionally marking the RHS of short-circuiting binary expressions as a terminating scope.

In the case of a let chain where the `let` expression was on the RHS, this meant that temporaries within the `let` expr would only live until the end of the expression. Since this only affected the RHS, this led to surprising behavior ([example](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=d1b0a5d1f01882f9c89c2194a75eb19f)).

After this PR, we only mark the RHS as a terminating scope if it is not a `let` expression.

20 months agoRollup merge of #102863 - compiler-errors:call-suggestion-on-unimplemented, r=nagisa
Dylan DPC [Wed, 19 Oct 2022 08:35:51 +0000 (14:05 +0530)]
Rollup merge of #102863 - compiler-errors:call-suggestion-on-unimplemented, r=nagisa

Standardize "use parentheses to call" suggestions between typeck and trait selection

1. Suggest calling constructors, since they're basically `FnDef`s but they have a different def kind and hir representation, so we were leaving them out.
2. Standardize the call suggestions between trait fulfillment errors and type mismatch. In the type mismatch suggestion, we suggest `/* Ty */` as the placeholder for an arg, and not the parameter's name, which is less helpful.
3. Use `predicate_must_hold_modulo_regions` instead of matching on `EvaluationResult` -- this might cause some suggestions to be filtered out, but we really shouldn't be suggesting a call if it "may" hold, only when it "must" hold.
4. Borrow some logic from `extract_callable_info` to generalize this suggestion to fn pointers, type parameters, and opaque types.

Fixes #102852

20 months agoAuto merge of #103180 - ferrocene:pa-qemu-user-mode, r=Mark-Simulacrum
bors [Wed, 19 Oct 2022 08:26:55 +0000 (08:26 +0000)]
Auto merge of #103180 - ferrocene:pa-qemu-user-mode, r=Mark-Simulacrum

Handle core dumps output in QEMU user mode

In addition to the whole-system emulation/virtualization, QEMU also supports user-mode emulation, where the emulation happens as a normal process inside the parent system. This allows running most tests by simply spawning remote-test-server inside user-mode emulation.

Unfortunately, QEMU always writes its own message in addition to the system one when a core dump happens, which breaks a few tests which match on the exact output of the system.

This PR changes those tests to strip the (possible) QEMU output before checking if the output is expected.

20 months agoAuto merge of #103225 - matthiaskrgr:rollup-1zkv87y, r=matthiaskrgr
bors [Wed, 19 Oct 2022 05:41:14 +0000 (05:41 +0000)]
Auto merge of #103225 - matthiaskrgr:rollup-1zkv87y, r=matthiaskrgr

Rollup of 4 pull requests

Successful merges:

 - #103166 (Optimize `slice_iter.copied().next_chunk()`)
 - #103176 (Fix `TyKind::is_simple_path`)
 - #103178 (Partially fix `src/test/run-make/coverage-reports` when cross-compiling)
 - #103198 (Update cargo)

Failed merges:

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

20 months agoRollup merge of #103198 - weihanglo:update-cargo, r=ehuss
Matthias Krüger [Wed, 19 Oct 2022 05:15:32 +0000 (07:15 +0200)]
Rollup merge of #103198 - weihanglo:update-cargo, r=ehuss

Update cargo

6 commits in b332991a57c9d055f1864de1eed93e2178d49440..3ff044334f0567ce1481c78603aeee7211b91623 2022-10-13 22:05:28 +0000 to 2022-10-17 20:25:00 +0000
- Some tiny refactors around `ops::cargo_compile` (rust-lang/cargo#11243)
- Polish docs for module `build_context` (rust-lang/cargo#11241)
- Remove sparse+ prefix for index.crates.io (rust-lang/cargo#11247)
- docs(add): Add missing flags to reference (rust-lang/cargo#11240)
- Document `cargo remove` (rust-lang/cargo#11227)
- fix: Update help headings to  match clap (rust-lang/cargo#11239)

20 months agoRollup merge of #103178 - ferrocene:pa-coverage-reports-tests, r=Mark-Simulacrum
Matthias Krüger [Wed, 19 Oct 2022 05:15:31 +0000 (07:15 +0200)]
Rollup merge of #103178 - ferrocene:pa-coverage-reports-tests, r=Mark-Simulacrum

Partially fix `src/test/run-make/coverage-reports` when cross-compiling

The test does not work on cross-compiled targets because the --target flag was not passed to rustc inside the test. This commit fixes that by adding the flag to the invocations.

Note that the test still fails on cross-compiled targets using remote-test, as remote-test is not capable (yet) of sending back to the host system the `*.profraw` file generated by the instrumentation.

Because of that, this is only a partial fix, and the test has been ignored on cross-compilation.

20 months agoRollup merge of #103176 - nnethercote:fix-TyKind-is_simple_path, r=spastorino
Matthias Krüger [Wed, 19 Oct 2022 05:15:31 +0000 (07:15 +0200)]
Rollup merge of #103176 - nnethercote:fix-TyKind-is_simple_path, r=spastorino

Fix `TyKind::is_simple_path`

Fixes #103157.

r? `@spastorino`

20 months agoRollup merge of #103166 - the8472:copied-next-chunk, r=m-ou-se
Matthias Krüger [Wed, 19 Oct 2022 05:15:30 +0000 (07:15 +0200)]
Rollup merge of #103166 - the8472:copied-next-chunk, r=m-ou-se

Optimize `slice_iter.copied().next_chunk()`

```
OLD:
test iter::bench_copied_array_chunks                               ... bench:         371 ns/iter (+/- 7)
NEW:
test iter::bench_copied_array_chunks                               ... bench:          31 ns/iter (+/- 0)
```

The default `next_chunk` implementation suffers from having to assemble the array byte by byte via `next()`, checking the `Option<&T>` and then dereferencing `&T`. The specialization copies the chunk directly from the slice.

20 months agoinstantiate -> construct
Michael Goulet [Wed, 19 Oct 2022 02:53:47 +0000 (02:53 +0000)]
instantiate -> construct

20 months agoAuto merge of #103213 - matthiaskrgr:rollup-diloxg3, r=matthiaskrgr
bors [Wed, 19 Oct 2022 02:53:24 +0000 (02:53 +0000)]
Auto merge of #103213 - matthiaskrgr:rollup-diloxg3, r=matthiaskrgr

Rollup of 6 pull requests

Successful merges:

 - #101889 (doc: rewrite doc for uint::{carrying_add,borrowing_sub})
 - #102507 (More slice::partition_point examples)
 - #103164 (rustdoc: remove CSS ``@media` (min-width: 701px)`)
 - #103189 (Clean up code-color and headers-color rustdoc GUI tests)
 - #103203 (Retrieve LLVM version from llvm-filecheck binary if it is not set yet)
 - #103204 (Add some more autolabels)

Failed merges:

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

20 months agoGeneralize call suggestion for unsatisfied predicate
Michael Goulet [Sun, 9 Oct 2022 22:25:52 +0000 (22:25 +0000)]
Generalize call suggestion for unsatisfied predicate

20 months agoStandardize arg suggestions between typeck and trait selection
Michael Goulet [Sun, 9 Oct 2022 21:39:57 +0000 (21:39 +0000)]
Standardize arg suggestions between typeck and trait selection

20 months agoUse predicate_must_hold_modulo_regions
Michael Goulet [Sun, 9 Oct 2022 21:06:59 +0000 (21:06 +0000)]
Use predicate_must_hold_modulo_regions

20 months agoSuggest calling ctor when trait is unimplemented
Michael Goulet [Sun, 9 Oct 2022 21:02:12 +0000 (21:02 +0000)]
Suggest calling ctor when trait is unimplemented

20 months agoAuto merge of #102769 - nnethercote:rustdoc-startup, r=jyn514
bors [Wed, 19 Oct 2022 00:02:40 +0000 (00:02 +0000)]
Auto merge of #102769 - nnethercote:rustdoc-startup, r=jyn514

Clean up rustdoc startup

Startup is pretty hairy, in both rustdoc and rustc. The first commit here improves the rustdoc situation quite a bit. The remaining commits are smaller but also help.

Best reviewed one commit at a time.

r? `@jyn514`

20 months agospecialize slice_iter.copied().next_chunk()
The 8472 [Mon, 17 Oct 2022 20:49:32 +0000 (22:49 +0200)]
specialize slice_iter.copied().next_chunk()

20 months agoConsider patterns in fn params in an `Elided(Infer)` lifetime rib.
Camille GILLOT [Tue, 18 Oct 2022 20:53:24 +0000 (20:53 +0000)]
Consider patterns in fn params in an `Elided(Infer)` lifetime rib.

20 months agoAvoid cloning `RenderOptions`.
Nicholas Nethercote [Sun, 16 Oct 2022 23:51:40 +0000 (10:51 +1100)]
Avoid cloning `RenderOptions`.

By moving `RenderOptions` out of `Option`, because the two structs' uses
are almost entirely separate.

The only complication is that `unstable_features` is needed in both
structs, but it's a tiny `Copy` type so its duplication seems fine.

20 months agoUse `interface::run_compiler` for `markdown::render`.
Nicholas Nethercote [Sun, 16 Oct 2022 23:19:46 +0000 (10:19 +1100)]
Use `interface::run_compiler` for `markdown::render`.

It turns out `markdown::render` is more complex than it first appears,
because it can invoke `doctest::make_test`, which requires session
globals and a thread pool.

So this commit changes it to use `interface::run_compiler`. Three of the
four paths in `main_args` now use `interface::run_compiler`.

20 months agoReplace a `spawn_unchecked` with `spawn_scoped`.
Nicholas Nethercote [Fri, 7 Oct 2022 20:43:15 +0000 (07:43 +1100)]
Replace a `spawn_unchecked` with `spawn_scoped`.

20 months agoApply `Lrc` later to `sess` and `codegen_backend`.
Nicholas Nethercote [Fri, 7 Oct 2022 05:20:20 +0000 (16:20 +1100)]
Apply `Lrc` later to `sess` and `codegen_backend`.

This avoids the need for a degenerate `Lrc::get_mut` call.

20 months agoInline and remove `create_compiler_and_run`.
Nicholas Nethercote [Fri, 7 Oct 2022 05:17:57 +0000 (16:17 +1100)]
Inline and remove `create_compiler_and_run`.

It has a single call site.

20 months agoReduce visibility of some functions.
Nicholas Nethercote [Fri, 7 Oct 2022 04:35:42 +0000 (15:35 +1100)]
Reduce visibility of some functions.

20 months agoInline and remove `scoped_thread`.
Nicholas Nethercote [Fri, 7 Oct 2022 00:57:25 +0000 (11:57 +1100)]
Inline and remove `scoped_thread`.

It has a single call site, and removing it slightly improves the
confusing tangle of nested closures present at startup.

20 months agoMerge `main_options` into `main_args`.
Nicholas Nethercote [Fri, 7 Oct 2022 04:36:44 +0000 (15:36 +1100)]
Merge `main_options` into `main_args`.

There is no longer any need for them to be separate.

20 months agoClean up rustdoc startup.
Nicholas Nethercote [Fri, 7 Oct 2022 02:57:32 +0000 (13:57 +1100)]
Clean up rustdoc startup.

rustc's startup has several layers, including:
- `interface::run_compiler` passes a closure, `f`, to
  `run_in_thread_pool_with_globals`, which creates a thread pool, sets
  up session globals, and passes `f` to `create_compiler_and_run`.
- `create_compiler_and_run` creates a `Session`, a `Compiler`, sets the
  source map, and calls `f`.

rustdoc is a bit different.
- `main_args` calls `main_options` via
  `run_in_thread_pool_with_globals`, which (again) creates a thread pool
  (hardcoded to a single thread!) and sets up session globals.
- `main_options` has four different paths.
  - The second one calls `interface::run_compiler`, which redoes the
    `run_in_thread_pool_with_globals`! This is bad.
  - The fourth one calls `interface::create_compiler_and_run`, which is
    reasonable.
  - The first and third ones don't do anything of note involving the
    above functions, except for some symbol interning which requires
    session globals.

In other words, rustdoc calls into `rustc_interface` at three different
levels. It's a bit confused, and feels like code where functionality has
been added by different people at different times without fully
understanding how the globally accessible stuff is set up.

This commit tidies things up. It removes the
`run_in_thread_pool_with_globals` call in `main_args`, and adjust the
four paths in `main_options` as follows.
- `markdown::test` calls `test::test_main`, which provides its own
  parallelism and so doesn't need a thread pool. It had one small use of
  symbol interning, which required session globals, but the commit
  removes this.
- `doctest::run` already calls `interface::run_compiler`, so it doesn't
  need further adjustment.
- `markdown::render` is simple but needs session globals for interning
  (which can't easily be removed), so it's now wrapped in
  `create_session_globals_then`.
- The fourth path now uses `interface::run_compiler`, which is
  equivalent to the old `run_in_thread_pool_with_globals` +
  `create_compiler_and_run` pairing.

20 months agoRollup merge of #103204 - jyn514:autolabels, r=Mark-Simulacrum
Matthias Krüger [Tue, 18 Oct 2022 19:18:48 +0000 (21:18 +0200)]
Rollup merge of #103204 - jyn514:autolabels, r=Mark-Simulacrum

Add some more autolabels

20 months agoRollup merge of #103203 - GuillaumeGomez:fix-llvm-runtools-condition, r=Amanieu
Matthias Krüger [Tue, 18 Oct 2022 19:18:48 +0000 (21:18 +0200)]
Rollup merge of #103203 - GuillaumeGomez:fix-llvm-runtools-condition, r=Amanieu

Retrieve LLVM version from llvm-filecheck binary if it is not set yet

In `rustc_codegen_gcc`, we run the `ASM` test suite. The problem is that, if a too recent version of the `llvm-filecheck` binary is provided, an extra argument needs to be passed and the to detect this version, it currently only expects a `--llvm-version` argument. With this, the version can be determined directly from the `llvm-filecheck` binary.

r? ``@Amanieu``

20 months agoRollup merge of #103189 - GuillaumeGomez:clean-up-gui-tests, r=notriddle
Matthias Krüger [Tue, 18 Oct 2022 19:18:47 +0000 (21:18 +0200)]
Rollup merge of #103189 - GuillaumeGomez:clean-up-gui-tests, r=notriddle

Clean up code-color and headers-color rustdoc GUI tests

r? ``@notriddle``

20 months agoRollup merge of #103164 - notriddle:notriddle/media-min-width, r=GuillaumeGomez
Matthias Krüger [Tue, 18 Oct 2022 19:18:47 +0000 (21:18 +0200)]
Rollup merge of #103164 - notriddle:notriddle/media-min-width, r=GuillaumeGomez

rustdoc: remove CSS `@media (min-width: 701px)`

The two rules within it can and should be done without the separate media query:

  * There ain't no rule saying a viewport can't be `700.5px` wide, since hardware pixels can be finer than CSS pixels.

    <details><summary>Screenshot</summary>

    ![image](https://user-images.githubusercontent.com/1593513/196283804-e946fbe3-d914-4819-ba2d-b4a6a07f190a.png)

    </details>

  * The rule for the first example-wrap child should probably apply on mobile.

    <details><summary>Screenshots</summary>

    ## Before

    ![rustdoc-before](https://user-images.githubusercontent.com/1593513/196282813-88b861c7-7b05-4de5-a421-914396f86a04.png)

    ## After

    ![rustdoc-after](https://user-images.githubusercontent.com/1593513/196282842-e57760c2-72d5-4dad-94f5-1d7175043326.png)

    </details>

  * The rule for the source sidebar is overriden by the mobile rule setting `max-width: 100vw`, so it can be merged with the rest of the styles.

20 months agoRollup merge of #102507 - scottmcm:more-binary-search-docs, r=m-ou-se
Matthias Krüger [Tue, 18 Oct 2022 19:18:46 +0000 (21:18 +0200)]
Rollup merge of #102507 - scottmcm:more-binary-search-docs, r=m-ou-se

More slice::partition_point examples

After seeing the discussion of `binary_search` vs `partition_point` in #101999, I thought some more example code could be helpful.

20 months agoRollup merge of #101889 - tspiteri:redoc-uint-adc-sbb, r=m-ou-se
Matthias Krüger [Tue, 18 Oct 2022 19:18:46 +0000 (21:18 +0200)]
Rollup merge of #101889 - tspiteri:redoc-uint-adc-sbb, r=m-ou-se

doc: rewrite doc for uint::{carrying_add,borrowing_sub}

Reword the documentation for bigint helper methods `uint::{carrying_add,borrowing_sub}` (#85532).

The examples were also rewritten to demonstrate how the methods can be used in bignum arithmetic. No loops are used in the examples, but the variable names were chosen to include indices so that it is clear how this can be used in a loop if required.

Also, previously `carrying_add` had an example to say that if the input carry is false, the method is equivalent to `overflowing_add`. While the note was kept, the example was removed and an extra note was added to make sure this equivalence is not assumed for signed integers as well.

20 months agoAuto merge of #102418 - citrus-it:illumos-strip-debug, r=nagisa
bors [Tue, 18 Oct 2022 16:32:41 +0000 (16:32 +0000)]
Auto merge of #102418 - citrus-it:illumos-strip-debug, r=nagisa

The illumos linker does not support --strip-debug

When building and testing rust 1.64.0 on illumos, we saw a large number of failing tests associated with:

```
   = note: ld: fatal: unrecognized option '--strip-debug'
           ld: fatal: use the -z help option for usage information
           collect2: error: ld returned 1 exit status
```

The illumos linker does not support the `--strip-debug` option (although it does support `--strip-all`).

20 months agoRetrieve LLVM version from llvm-filecheck binary if it is not set yet
Guillaume Gomez [Tue, 18 Oct 2022 16:26:26 +0000 (18:26 +0200)]
Retrieve LLVM version from llvm-filecheck binary if it is not set yet

20 months agoAdd some more autolabels
Joshua Nelson [Tue, 18 Oct 2022 16:20:49 +0000 (11:20 -0500)]
Add some more autolabels

20 months agoClean up query descriptions
nils [Mon, 17 Oct 2022 19:30:41 +0000 (21:30 +0200)]
Clean up query descriptions

Use the same tense everywhere and prefer display over debug, as these
descriptions are user facing.

20 months agoUpdate cargo
Weihang Lo [Tue, 18 Oct 2022 15:13:57 +0000 (23:13 +0800)]
Update cargo

6 commits in b332991a57c9d055f1864de1eed93e2178d49440..3ff044334f0567ce1481c78603aeee7211b91623
2022-10-13 22:05:28 +0000 to 2022-10-17 20:25:00 +0000
- Some tiny refactors around `ops::cargo_compile` (rust-lang/cargo#11243)
- Polish docs for module `build_context` (rust-lang/cargo#11241)
- Remove sparse+ prefix for index.crates.io (rust-lang/cargo#11247)
- docs(add): Add missing flags to reference (rust-lang/cargo#11240)
- Document `cargo remove` (rust-lang/cargo#11227)
- fix: Update help headings to  match clap (rust-lang/cargo#11239)

20 months agoAuto merge of #103188 - JohnTitor:rollup-pwilam1, r=JohnTitor
bors [Tue, 18 Oct 2022 13:35:43 +0000 (13:35 +0000)]
Auto merge of #103188 - JohnTitor:rollup-pwilam1, r=JohnTitor

Rollup of 6 pull requests

Successful merges:

 - #103023 (Adding `fuchsia-ignore` and `needs-unwind` to compiler test cases)
 - #103142 (Make diagnostic for unsatisfied `Termination` bounds more precise)
 - #103154 (Fix typo in `ReverseSearcher` docs)
 - #103159 (Remove the redundant `Some(try_opt!(..))` in `checked_pow`)
 - #103163 (Remove all uses of array_assume_init)
 - #103168 (Stabilize asm_sym)

Failed merges:

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

20 months agoClean up code-color and headers-color rustdoc GUI tests
Guillaume Gomez [Tue, 18 Oct 2022 13:18:45 +0000 (15:18 +0200)]
Clean up code-color and headers-color rustdoc GUI tests

20 months agoRollup merge of #103168 - Amanieu:stable_asm_sym, r=davidtwco
Yuki Okushi [Tue, 18 Oct 2022 12:21:32 +0000 (21:21 +0900)]
Rollup merge of #103168 - Amanieu:stable_asm_sym, r=davidtwco

Stabilize asm_sym

Tracking issue #93333

Reference PR: https://github.com/rust-lang/reference/pull/1270

20 months agoRollup merge of #103163 - SUPERCILEX:uninit-array-assume2, r=scottmcm
Yuki Okushi [Tue, 18 Oct 2022 12:21:32 +0000 (21:21 +0900)]
Rollup merge of #103163 - SUPERCILEX:uninit-array-assume2, r=scottmcm

Remove all uses of array_assume_init

See https://github.com/rust-lang/rust/pull/103134#discussion_r997462733

r? `@scottmcm`

20 months agoRollup merge of #103159 - cuviper:check_pow-final-try_opt, r=Mark-Simulacrum
Yuki Okushi [Tue, 18 Oct 2022 12:21:31 +0000 (21:21 +0900)]
Rollup merge of #103159 - cuviper:check_pow-final-try_opt, r=Mark-Simulacrum

Remove the redundant `Some(try_opt!(..))` in `checked_pow`

The final return value doesn't need to be tried at all -- we can just
return the checked option directly. The optimizer can probably figure
this out anyway, but there's no need to make it work here.

20 months agoRollup merge of #103154 - H4x5:reverse-searcher-typo, r=Mark-Simulacrum
Yuki Okushi [Tue, 18 Oct 2022 12:21:31 +0000 (21:21 +0900)]
Rollup merge of #103154 - H4x5:reverse-searcher-typo, r=Mark-Simulacrum

Fix typo in `ReverseSearcher` docs

20 months agoRollup merge of #103142 - fmease:fix-103052, r=oli-obk
Yuki Okushi [Tue, 18 Oct 2022 12:21:30 +0000 (21:21 +0900)]
Rollup merge of #103142 - fmease:fix-103052, r=oli-obk

Make diagnostic for unsatisfied `Termination` bounds more precise

Don't blindly emit a diagnostic claiming that “*`main` has an invalid return type*” if we encounter a type that should but doesn't implement `std::process::Termination` and isn't actually the return type of the program entry `main`.

Fixes #103052.

``@rustbot`` label A-diagnostics T-compiler T-libs
r? diagnostics

20 months agoRollup merge of #103023 - andrewpollack:i-fuchsia-finals, r=tmandry
Yuki Okushi [Tue, 18 Oct 2022 12:21:29 +0000 (21:21 +0900)]
Rollup merge of #103023 - andrewpollack:i-fuchsia-finals, r=tmandry

Adding `fuchsia-ignore` and `needs-unwind` to compiler test cases

Final tests covering missing privileges

r? ``@tmandry``

cc. ``@djkoloski``

20 months agoAuto merge of #103075 - SUPERCILEX:miri-metadata, r=thomcc
bors [Tue, 18 Oct 2022 10:54:53 +0000 (10:54 +0000)]
Auto merge of #103075 - SUPERCILEX:miri-metadata, r=thomcc

Support DirEntry metadata calls in miri

This should work as it uses lstat64 which is supported here: ~https://github.com/rust-lang/miri/blob/d9ad25ee4bbd9364c498959cdc82b5fa6c41e63c/src/shims/unix/macos/foreign_items.rs#L42~ just noticed that's macos, linux would be using statx: https://github.com/rust-lang/miri/blob/86f0e63b21721fe2c14608644f467b9cb21945eb/src/shims/unix/linux/foreign_items.rs#L112

The failing syscall is `dirfd`, so maybe that should actually be added to the shims?

20 months agohandle core dumps output in qemu user mode
Pietro Albini [Mon, 10 Oct 2022 14:29:57 +0000 (16:29 +0200)]
handle core dumps output in qemu user mode

In addition to the whole-system emulation/virtualization, QEMU also
supports user-mode emulation, where the emulation happens as a normal
process inside the parent system. This allows running most tests by
simply spawning remote-test-server inside user-mode emulation.

Unfortunately, QEMU always writes its own message in addition to the
system one when a core dump happens, which breaks a few tests which
match on the exact output of the system.

This PR changes those tests to strip the (possible) QEMU output before
checking if the output is expected.

20 months agoAuto merge of #103177 - lnicola:rust-analyzer-2022-10-18, r=lnicola
bors [Tue, 18 Oct 2022 07:46:49 +0000 (07:46 +0000)]
Auto merge of #103177 - lnicola:rust-analyzer-2022-10-18, r=lnicola

:arrow_up: rust-analyzer

r? `@ghost`

20 months agopartially fix src/test/run-make/coverage-reports when cross-compiling
Pietro Albini [Tue, 27 Sep 2022 08:11:43 +0000 (10:11 +0200)]
partially fix src/test/run-make/coverage-reports when cross-compiling

The test does not work on cross-compiled targets because the --target
flag was not passed to rustc inside the test. This commit fixes that by
adding the flag to the invocations.

Note that the test still fails on cross-compiled targets using
remote-test, as remote-test is not capable (yet) of sending back to the
host system the *.profraw file generated by the instrumentation.

Because of that, this is only a partial fix, and the test has been
ignored on cross-compilation.

20 months ago:arrow_up: rust-analyzer
Laurențiu Nicola [Tue, 18 Oct 2022 06:12:49 +0000 (09:12 +0300)]
:arrow_up: rust-analyzer

20 months agoAuto merge of #102992 - nnethercote:rm-RunCompiler-emitter, r=bjorn3
bors [Tue, 18 Oct 2022 05:06:04 +0000 (05:06 +0000)]
Auto merge of #102992 - nnethercote:rm-RunCompiler-emitter, r=bjorn3

Remove `RunCompiler::emitter`.

It's no longer used.

r? `@bjorn3`

20 months agoFix `TyKind::is_simple_path`.
Nicholas Nethercote [Tue, 18 Oct 2022 02:07:20 +0000 (13:07 +1100)]
Fix `TyKind::is_simple_path`.

PR #98758 introduced code to avoid redundant assertions in derived code
like this:
```
let _: ::core::clone::AssertParamIsClone<u32>;
let _: ::core::clone::AssertParamIsClone<u32>;
```
But the predicate `is_simple_path` introduced as part of this failed to
account for generic arguments. Therefore the deriving code erroneously
considers types like `Option<bool>` and `Option<f32>` to be the same.

This commit fixes `is_simple_path`.

Fixes #103157.

20 months agoTweak `deriving-all-codegen.rs`.
Nicholas Nethercote [Tue, 18 Oct 2022 03:31:33 +0000 (14:31 +1100)]
Tweak `deriving-all-codegen.rs`.

To include some `Option<>` fields of different types in a single enum.
The test output is currently buggy, but the next commit will fix that.

20 months agorustdoc: change mobile breakpoint to match CSS
Michael Howell [Mon, 17 Oct 2022 21:20:04 +0000 (14:20 -0700)]
rustdoc: change mobile breakpoint to match CSS

Since it's possible to have a 700.5px viewport width, the JS needs to not
switch to mobile mode in such a setup.

20 months agorustdoc: remove CSS `@media (min-width: 701px)`
Michael Howell [Mon, 17 Oct 2022 20:54:42 +0000 (13:54 -0700)]
rustdoc: remove CSS `@media (min-width: 701px)`

The two rules within it can and should be done without the separate
media query:

  * There ain't no rule saying a viewport can't be `700.5px` wide, since
    hardware pixels can be finer than CSS pixels.

  * The rule for the first example-wrap child should probably apply
    on mobile.

  * The rule for the source sidebar is overriden by the mobile rule
    setting `max-width: 100vw`, so it can be merged with the rest
    of the styles.

20 months agoAuto merge of #102543 - daym:patch-1, r=joshtriplett
bors [Tue, 18 Oct 2022 02:04:24 +0000 (02:04 +0000)]
Auto merge of #102543 - daym:patch-1, r=joshtriplett

Remove "execute" bit from lock file permissions

Previously, flock would set the "execute" bit on Rust lock files. That makes no sense.

This patch clears the "execute" bit on Rust lock files.

See issue #102531.

20 months agoAuto merge of #103165 - matthiaskrgr:rollup-guw8oh6, r=matthiaskrgr
bors [Mon, 17 Oct 2022 23:16:57 +0000 (23:16 +0000)]
Auto merge of #103165 - matthiaskrgr:rollup-guw8oh6, r=matthiaskrgr

Rollup of 4 pull requests

Successful merges:

 - #103152 (Use named arguments to make GUI test more clear)
 - #103160 (rustdoc: factor JS mobile scroll lock into its own function)
 - #103161 (rustdoc: remove redundant CSS on `#copy-path`)
 - #103162 (rustdoc: remove redundant CSS `#crate-search { border-radius }`)

Failed merges:

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

20 months agoRemove `RunCompiler::emitter`.
Nicholas Nethercote [Wed, 12 Oct 2022 23:23:23 +0000 (10:23 +1100)]
Remove `RunCompiler::emitter`.

It's no longer used.

20 months agoadd a benchmark for slice_iter.copied().array_chunks()
The 8472 [Mon, 17 Oct 2022 20:47:39 +0000 (22:47 +0200)]
add a benchmark for slice_iter.copied().array_chunks()

20 months agoStabilize asm_sym
Amanieu d'Antras [Mon, 17 Oct 2022 21:38:37 +0000 (22:38 +0100)]
Stabilize asm_sym

20 months agoRollup merge of #103162 - notriddle:notriddle/crate-search, r=GuillaumeGomez
Matthias Krüger [Mon, 17 Oct 2022 21:09:08 +0000 (23:09 +0200)]
Rollup merge of #103162 - notriddle:notriddle/crate-search, r=GuillaumeGomez

rustdoc: remove redundant CSS `#crate-search { border-radius }`

This is the same border-radius that's always set on that ID:

https://github.com/rust-lang/rust/blob/a9d1cafa878ecc04a4aa7aaa7df0414a29a2bd0b/src/librustdoc/html/static/css/rustdoc.css#L825-L836

20 months agoRollup merge of #103161 - notriddle:notriddle/copy-path-settings-help-button, r=Guill...
Matthias Krüger [Mon, 17 Oct 2022 21:09:07 +0000 (23:09 +0200)]
Rollup merge of #103161 - notriddle:notriddle/copy-path-settings-help-button, r=GuillaumeGomez

rustdoc: remove redundant CSS on `#copy-path`

The border and background were removed in 5d004c1e2020eaa9bc336f09b6b0475c0eef4d78, but not all the CSS was.

20 months agoRollup merge of #103160 - notriddle:notriddle/js-mobile-scroll, r=GuillaumeGomez
Matthias Krüger [Mon, 17 Oct 2022 21:09:07 +0000 (23:09 +0200)]
Rollup merge of #103160 - notriddle:notriddle/js-mobile-scroll, r=GuillaumeGomez

rustdoc: factor JS mobile scroll lock into its own function

https://github.com/rust-lang/rust/pull/98775#issuecomment-1172728308

20 months agoRollup merge of #103152 - GuillaumeGomez:named-arguments, r=notriddle
Matthias Krüger [Mon, 17 Oct 2022 21:09:06 +0000 (23:09 +0200)]
Rollup merge of #103152 - GuillaumeGomez:named-arguments, r=notriddle

Use named arguments to make GUI test more clear

As you suggested `@notriddle.` The result looks like this.

r? `@notriddle`

20 months agoRemove all uses of array_assume_init
Alex Saveau [Mon, 17 Oct 2022 04:01:28 +0000 (21:01 -0700)]
Remove all uses of array_assume_init

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
20 months agoAuto merge of #101837 - scottmcm:box-array-from-vec, r=m-ou-se
bors [Mon, 17 Oct 2022 19:46:04 +0000 (19:46 +0000)]
Auto merge of #101837 - scottmcm:box-array-from-vec, r=m-ou-se

Add `Box<[T; N]>: TryFrom<Vec<T>>`

We have `[T; N]: TryFrom<Vec<T>>` (#76310) and `Box<[T; N]>: TryFrom<Box<[T]>>`, but not this combination.

`vec.into_boxed_slice().try_into()` isn't quite a replacement for this, as that'll reallocate unnecessarily in the error case.

**Insta-stable, so needs an FCP**

(I tried to make this work with `, A`, but that's disallowed because of `#[fundamental]` https://github.com/rust-lang/rust/issues/29635#issuecomment-1247598385)

20 months agorustdoc: remove redundant CSS `#crate-search { border-radius }`
Michael Howell [Mon, 17 Oct 2022 19:16:40 +0000 (12:16 -0700)]
rustdoc: remove redundant CSS `#crate-search { border-radius }`

This is the same border-radius that's always set on that ID:

https://github.com/rust-lang/rust/blob/a9d1cafa878ecc04a4aa7aaa7df0414a29a2bd0b/src/librustdoc/html/static/css/rustdoc.css#L825-L836

20 months agoRemove execute bit from lock file permissions
Danny Milosavljevic [Sat, 1 Oct 2022 01:50:05 +0000 (03:50 +0200)]
Remove execute bit from lock file permissions

20 months agorustdoc: remove redundant CSS on `#copy-path`
Michael Howell [Mon, 17 Oct 2022 18:53:42 +0000 (11:53 -0700)]
rustdoc: remove redundant CSS on `#copy-path`

The border and background were removed in
5d004c1e2020eaa9bc336f09b6b0475c0eef4d78, but not all the CSS was.

20 months agorustdoc: factor JS mobile scroll lock into its own function
Michael Howell [Mon, 17 Oct 2022 18:41:39 +0000 (11:41 -0700)]
rustdoc: factor JS mobile scroll lock into its own function

https://github.com/rust-lang/rust/pull/98775#issuecomment-1172728308

20 months agoRemove the redundant `Some(try_opt!(..))` in `checked_pow`
Josh Stone [Mon, 17 Oct 2022 18:21:50 +0000 (11:21 -0700)]
Remove the redundant `Some(try_opt!(..))` in `checked_pow`

The final return value doesn't need to be tried at all -- we can just
return the checked option directly. The optimizer can probably figure
this out anyway, but there's no need to make it work here.

20 months agoFix typo in `ReverseSearcher` docs
Sky [Mon, 17 Oct 2022 17:14:15 +0000 (13:14 -0400)]
Fix typo in `ReverseSearcher` docs

20 months agoAuto merge of #103151 - matthiaskrgr:rollup-t3mmnsg, r=matthiaskrgr
bors [Mon, 17 Oct 2022 17:05:17 +0000 (17:05 +0000)]
Auto merge of #103151 - matthiaskrgr:rollup-t3mmnsg, r=matthiaskrgr

Rollup of 4 pull requests

Successful merges:

 - #102454 (Suggest parentheses for possible range method calling)
 - #102466 (only allow `ConstEquate` with `feature(gce)`)
 - #102945 (Do not register placeholder `RegionOutlives` obligations when `considering_regions` is false)
 - #103091 (rustdoc: remove unused HTML class `sidebar-title`)

Failed merges:

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

20 months agoAllow `Vec::leak` with `no_global_oom_handling`
Chris Denton [Mon, 17 Oct 2022 16:12:32 +0000 (17:12 +0100)]
Allow `Vec::leak` with `no_global_oom_handling`

20 months agoUse named arguments to make test clearer
Guillaume Gomez [Mon, 17 Oct 2022 16:08:53 +0000 (18:08 +0200)]
Use named arguments to make test clearer

20 months agoUpdate browser-ui-test version to 0.12.6
Guillaume Gomez [Mon, 17 Oct 2022 16:08:40 +0000 (18:08 +0200)]
Update browser-ui-test version to 0.12.6

20 months agoRollup merge of #103091 - notriddle:notriddle/sidebar-title, r=GuillaumeGomez
Matthias Krüger [Mon, 17 Oct 2022 15:15:51 +0000 (17:15 +0200)]
Rollup merge of #103091 - notriddle:notriddle/sidebar-title, r=GuillaumeGomez

rustdoc: remove unused HTML class `sidebar-title`

Since 6a5f8b1aef1417d7dc85b5d0a229d2db1930eb7c, this class is no longer styled.

20 months agoRollup merge of #102945 - compiler-errors:placeholder-region-outlives, r=lcnr
Matthias Krüger [Mon, 17 Oct 2022 15:15:50 +0000 (17:15 +0200)]
Rollup merge of #102945 - compiler-errors:placeholder-region-outlives, r=lcnr

Do not register placeholder `RegionOutlives` obligations when `considering_regions` is false

**NOTE:** I'm kinda just putting this up for discussion. I'm not certain this is correct...?

This was introduced in [`608625d`](https://github.com/rust-lang/rust/commit/608625dae95cde00e4570eb6c2d63b2244bbf34c#diff-6e54b18681342ec725d75591dbf384ad08cd73df29db00485fe51b4e90f76ff7R361).

Interestingly, we only check `data.has_placeholders()` for `RegionOutlives`, and not for `TypeOutlives`... why? For the record, that different treatment between `RegionOutlives` and `TypeOutlives` is why the fix "The compiling succeeds when all `'a : 'b` are replaced with `&'a () : 'b`" in #100689 _"works"_, but it seems like an implementation detail considering this.

Also, why do we care about placeholder regions being registered if `considering_regions` is false? It doesn't seem to affect any UI tests, for example.

r? `@lcnr`

Fixes #102899
Fixes #100689

20 months agoRollup merge of #102466 - lcnr:const-equate-uwu, r=BoxyUwU
Matthias Krüger [Mon, 17 Oct 2022 15:15:50 +0000 (17:15 +0200)]
Rollup merge of #102466 - lcnr:const-equate-uwu, r=BoxyUwU

only allow `ConstEquate` with `feature(gce)`

20 months agoRollup merge of #102454 - chenyukang:fix-102396-missing-parentheses, r=lcnr
Matthias Krüger [Mon, 17 Oct 2022 15:15:49 +0000 (17:15 +0200)]
Rollup merge of #102454 - chenyukang:fix-102396-missing-parentheses, r=lcnr

Suggest parentheses for possible range method calling

Fixes #102396

20 months agoAuto merge of #102355 - lcnr:bye-bye-type-traversal, r=oli-obk
bors [Mon, 17 Oct 2022 14:19:28 +0000 (14:19 +0000)]
Auto merge of #102355 - lcnr:bye-bye-type-traversal, r=oli-obk

remove type traversal for mir constants

r? `@oli-obk` cc `@b-naber`

20 months agoAuto merge of #103145 - matthiaskrgr:rollup-mxwsysv, r=matthiaskrgr
bors [Mon, 17 Oct 2022 11:33:40 +0000 (11:33 +0000)]
Auto merge of #103145 - matthiaskrgr:rollup-mxwsysv, r=matthiaskrgr

Rollup of 4 pull requests

Successful merges:

 - #102962 (remote-test-server: Show command line arguments)
 - #103129 (rustdoc: remove unused `.sub-logo-container` DOM on non-source pages)
 - #103136 (Fix types in documentation for `Alignment::as_usize` and `Alignmnet::as_nonzero`)
 - #103139 (Duplicate comment in mod.rs)

Failed merges:

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

20 months agoRollup merge of #103139 - smoelius:patch-2, r=Dylan-DPC
Matthias Krüger [Mon, 17 Oct 2022 11:11:08 +0000 (13:11 +0200)]
Rollup merge of #103139 - smoelius:patch-2, r=Dylan-DPC

Duplicate comment in mod.rs

20 months agoRollup merge of #103136 - tmccombs:alignment-doc-fixes, r=Dylan-DPC
Matthias Krüger [Mon, 17 Oct 2022 11:11:07 +0000 (13:11 +0200)]
Rollup merge of #103136 - tmccombs:alignment-doc-fixes, r=Dylan-DPC

Fix types in documentation for `Alignment::as_usize` and `Alignmnet::as_nonzero`

20 months agoRollup merge of #103129 - notriddle:notriddle/sub-logo-container, r=GuillaumeGomez
Matthias Krüger [Mon, 17 Oct 2022 11:11:07 +0000 (13:11 +0200)]
Rollup merge of #103129 - notriddle:notriddle/sub-logo-container, r=GuillaumeGomez

rustdoc: remove unused `.sub-logo-container` DOM on non-source pages

20 months agoRollup merge of #102962 - flba-eb:remote_test_server_help, r=pietroalbini
Matthias Krüger [Mon, 17 Oct 2022 11:11:07 +0000 (13:11 +0200)]
Rollup merge of #102962 - flba-eb:remote_test_server_help, r=pietroalbini

remote-test-server: Show command line arguments

The user of remote-test-server should get at least some minimal command line help as this is often started manually.

r? `@pietroalbini`

20 months agoMake diagnostic for unsatisfied Termination bounds more precise
León Orell Valerian Liehr [Mon, 17 Oct 2022 10:04:16 +0000 (12:04 +0200)]
Make diagnostic for unsatisfied Termination bounds more precise

20 months agoadd inline to `TrivialTypeTraversalImpls`
lcnr [Wed, 5 Oct 2022 16:26:48 +0000 (18:26 +0200)]
add inline to `TrivialTypeTraversalImpls`

20 months agorm `try_normalize_mir_const_after_erasing_regions`
lcnr [Thu, 29 Sep 2022 10:39:35 +0000 (12:39 +0200)]
rm `try_normalize_mir_const_after_erasing_regions`

20 months agomir constants: type traversing bye bye
lcnr [Tue, 27 Sep 2022 09:59:25 +0000 (11:59 +0200)]
mir constants: type traversing bye bye

20 months agoAuto merge of #103116 - TaKO8Ki:fix-103053, r=lcnr
bors [Mon, 17 Oct 2022 08:04:52 +0000 (08:04 +0000)]
Auto merge of #103116 - TaKO8Ki:fix-103053, r=lcnr

Fix `own_substs` ICE

Fixes #103053