]> git.lizzy.rs Git - rust.git/log
rust.git
18 months agoCI: fix begingroup printing
Ralf Jung [Sun, 27 Nov 2022 12:20:44 +0000 (13:20 +0100)]
CI: fix begingroup printing

18 months agoAuto merge of #2696 - RalfJung:no-std-windows, r=RalfJung
bors [Sat, 26 Nov 2022 15:15:22 +0000 (15:15 +0000)]
Auto merge of #2696 - RalfJung:no-std-windows, r=RalfJung

make no_std work on Windows

Also fixes https://github.com/rust-lang/miri/issues/1123 by cherry-picking a patch by `@DrMeepster.`

18 months agosupport no_std on Windows
Ralf Jung [Sat, 26 Nov 2022 14:58:44 +0000 (15:58 +0100)]
support no_std on Windows

18 months agorefactor try_resolve_did and also support resolving crates/modules
Ralf Jung [Sat, 26 Nov 2022 14:58:28 +0000 (15:58 +0100)]
refactor try_resolve_did and also support resolving crates/modules

18 months agoadd namespace to resolve_path
DrMeepster [Wed, 9 Nov 2022 08:39:03 +0000 (00:39 -0800)]
add namespace to resolve_path

18 months agoAuto merge of #2695 - RalfJung:ci-pretty, r=RalfJung
bors [Sat, 26 Nov 2022 13:53:27 +0000 (13:53 +0000)]
Auto merge of #2695 - RalfJung:ci-pretty, r=RalfJung

prettify our CI logs

18 months agoprettify our CI logs
Ralf Jung [Sat, 26 Nov 2022 13:03:41 +0000 (14:03 +0100)]
prettify our CI logs

18 months agoAuto merge of #2690 - Nilstrieb:cargo-miri-smoke-test-ci-so-that-cargo-miri-actually...
bors [Sat, 26 Nov 2022 13:24:26 +0000 (13:24 +0000)]
Auto merge of #2690 - Nilstrieb:cargo-miri-smoke-test-ci-so-that-cargo-miri-actually-works-kinda, r=RalfJung

Test a small cargo-miri smoke test even in `run_tests_minimal`

This makes sure that cargo-miri works on all targets.

Implements the first step of https://github.com/rust-lang/miri/pull/2685#issuecomment-1325155967 to get that PR tested.

18 months agoupdate lockfile
Ralf Jung [Sat, 26 Nov 2022 13:16:45 +0000 (14:16 +0100)]
update lockfile

18 months agoAuto merge of #2647 - saethlin:current-span, r=RalfJung
bors [Sat, 26 Nov 2022 13:02:15 +0000 (13:02 +0000)]
Auto merge of #2647 - saethlin:current-span, r=RalfJung

Track local frames incrementally during execution

https://github.com/rust-lang/miri/pull/2646 currently introduces a performance regression. This change removes that regression, and provides a minor perf improvement.

The existing lazy strategy for tracking the span we want to display is as efficient as it is only because we often create a `CurrentSpan` then never call `.get()`. Most of the calls to the `before_memory_read` and `before_memory_write` hooks do not create any event that we store in `AllocHistory`. But data races are totally different, any memory read or write may race, so every call to those hooks needs to access to the current local span.

So this changes to a strategy where we update some state in a `Thread` and `FrameExtra` incrementally, upon entering and existing each function call.

Before:
```
Benchmark 1: cargo +miri miri run --manifest-path /home/ben/miri/bench-cargo-miri/backtraces/Cargo.toml
  Time (mean ± σ):      5.532 s ±  0.022 s    [User: 5.444 s, System: 0.073 s]
  Range (min … max):    5.516 s …  5.569 s    5 runs

Benchmark 1: cargo +miri miri run --manifest-path /home/ben/miri/bench-cargo-miri/mse/Cargo.toml
  Time (mean ± σ):     831.4 ms ±   3.0 ms    [User: 783.8 ms, System: 46.7 ms]
  Range (min … max):   828.7 ms … 836.1 ms    5 runs

Benchmark 1: cargo +miri miri run --manifest-path /home/ben/miri/bench-cargo-miri/serde1/Cargo.toml
  Time (mean ± σ):      1.975 s ±  0.021 s    [User: 1.914 s, System: 0.059 s]
  Range (min … max):    1.939 s …  1.990 s    5 runs

Benchmark 1: cargo +miri miri run --manifest-path /home/ben/miri/bench-cargo-miri/serde2/Cargo.toml
  Time (mean ± σ):      4.060 s ±  0.051 s    [User: 3.983 s, System: 0.071 s]
  Range (min … max):    3.972 s …  4.100 s    5 runs

Benchmark 1: cargo +miri miri run --manifest-path /home/ben/miri/bench-cargo-miri/slice-get-unchecked/Cargo.toml
  Time (mean ± σ):     784.9 ms ±   8.2 ms    [User: 746.5 ms, System: 37.7 ms]
  Range (min … max):   772.9 ms … 793.3 ms    5 runs

Benchmark 1: cargo +miri miri run --manifest-path /home/ben/miri/bench-cargo-miri/unicode/Cargo.toml
  Time (mean ± σ):      1.679 s ±  0.006 s    [User: 1.623 s, System: 0.055 s]
  Range (min … max):    1.673 s …  1.687 s    5 runs
```
After:
```
Benchmark 1: cargo +miri miri run --manifest-path /home/ben/miri/bench-cargo-miri/backtraces/Cargo.toml
  Time (mean ± σ):      5.330 s ±  0.037 s    [User: 5.232 s, System: 0.084 s]
  Range (min … max):    5.280 s …  5.383 s    5 runs

Benchmark 1: cargo +miri miri run --manifest-path /home/ben/miri/bench-cargo-miri/mse/Cargo.toml
  Time (mean ± σ):     818.9 ms ±   3.7 ms    [User: 776.8 ms, System: 41.3 ms]
  Range (min … max):   813.5 ms … 822.5 ms    5 runs

Benchmark 1: cargo +miri miri run --manifest-path /home/ben/miri/bench-cargo-miri/serde1/Cargo.toml
  Time (mean ± σ):      1.927 s ±  0.011 s    [User: 1.864 s, System: 0.061 s]
  Range (min … max):    1.917 s …  1.945 s    5 runs

Benchmark 1: cargo +miri miri run --manifest-path /home/ben/miri/bench-cargo-miri/serde2/Cargo.toml
  Time (mean ± σ):      3.974 s ±  0.020 s    [User: 3.893 s, System: 0.076 s]
  Range (min … max):    3.956 s …  4.004 s    5 runs

Benchmark 1: cargo +miri miri run --manifest-path /home/ben/miri/bench-cargo-miri/slice-get-unchecked/Cargo.toml
  Time (mean ± σ):     780.0 ms ±   5.3 ms    [User: 740.3 ms, System: 39.0 ms]
  Range (min … max):   771.2 ms … 784.5 ms    5 runs

Benchmark 1: cargo +miri miri run --manifest-path /home/ben/miri/bench-cargo-miri/unicode/Cargo.toml
  Time (mean ± σ):      1.643 s ±  0.007 s    [User: 1.584 s, System: 0.058 s]
  Range (min … max):    1.635 s …  1.654 s    5 runs
```
(This change is marginal, but the point is that it avoids a much more significant regression)

18 months agocaller_span only makes sense when there are 2 frames on the stack
Ralf Jung [Sat, 26 Nov 2022 13:01:05 +0000 (14:01 +0100)]
caller_span only makes sense when there are 2 frames on the stack

18 months agoUse None when the stack is empty
Ben Kimock [Fri, 25 Nov 2022 18:12:43 +0000 (13:12 -0500)]
Use None when the stack is empty

18 months agoTest a small cargo-miri smoke test even in `run_tests_minimal`
Nilstrieb [Thu, 24 Nov 2022 20:22:12 +0000 (21:22 +0100)]
Test a small cargo-miri smoke test even in `run_tests_minimal`

This makes sure that cargo-miri works on all targets.

19 months agoAuto merge of #2691 - RalfJung:get_mut, r=RalfJung
bors [Fri, 25 Nov 2022 07:58:00 +0000 (07:58 +0000)]
Auto merge of #2691 - RalfJung:get_mut, r=RalfJung

replace a borrow_mut by get_mut

19 months agoreplace a borrow_mut by get_mut
Ralf Jung [Fri, 25 Nov 2022 07:57:16 +0000 (08:57 +0100)]
replace a borrow_mut by get_mut

19 months agoUpdate src/machine.rs
Ben Kimock [Wed, 23 Nov 2022 03:22:47 +0000 (22:22 -0500)]
Update src/machine.rs

Co-authored-by: Ralf Jung <post@ralfj.de>
19 months agoDocument is_user_relevant
Ben Kimock [Tue, 22 Nov 2022 15:19:29 +0000 (10:19 -0500)]
Document is_user_relevant

Co-authored-by: Ralf Jung <post@ralfj.de>
19 months agoAuto merge of #2687 - RalfJung:getrandom, r=RalfJung
bors [Tue, 22 Nov 2022 11:16:51 +0000 (11:16 +0000)]
Auto merge of #2687 - RalfJung:getrandom, r=RalfJung

ensure current getrandom works with strict provenance

19 months agoupdate test_dependencies
Ralf Jung [Tue, 22 Nov 2022 10:54:04 +0000 (11:54 +0100)]
update test_dependencies

19 months agoensure current getrandom works with strict provenance
Ralf Jung [Tue, 22 Nov 2022 10:52:35 +0000 (11:52 +0100)]
ensure current getrandom works with strict provenance

19 months agoIncrementally track which frame to use for diagnostics
Ben Kimock [Thu, 3 Nov 2022 04:09:00 +0000 (00:09 -0400)]
Incrementally track which frame to use for diagnostics

19 months agoAuto merge of #2684 - RalfJung:stack-borrows-weak-protectors, r=saethlin
bors [Mon, 21 Nov 2022 07:57:33 +0000 (07:57 +0000)]
Auto merge of #2684 - RalfJung:stack-borrows-weak-protectors, r=saethlin

Stack borrows: weak protectors

This addresses the issue described in https://github.com/rust-lang/unsafe-code-guidelines/issues/376.

19 months agotweaks
Ralf Jung [Sun, 20 Nov 2022 21:22:38 +0000 (22:22 +0100)]
tweaks

19 months agosome things don't need to be mutable
Ralf Jung [Sun, 20 Nov 2022 17:11:30 +0000 (18:11 +0100)]
some things don't need to be mutable

19 months agoadd a weak form of protection that justifies Box noalias
Ralf Jung [Sun, 20 Nov 2022 17:07:51 +0000 (18:07 +0100)]
add a weak form of protection that justifies Box noalias

19 months agocfg(miri) no longer needed in sys/unix/time.rs
Ralf Jung [Sat, 19 Nov 2022 22:50:57 +0000 (23:50 +0100)]
cfg(miri) no longer needed in sys/unix/time.rs

19 months agoupdate lockfile
Ralf Jung [Sun, 20 Nov 2022 08:15:12 +0000 (09:15 +0100)]
update lockfile

19 months agoAuto merge of #2683 - RalfJung:align_offset, r=RalfJung
bors [Sun, 20 Nov 2022 10:16:02 +0000 (10:16 +0000)]
Auto merge of #2683 - RalfJung:align_offset, r=RalfJung

make align_offset always work on no-provenance pointers

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

19 months agomake align_offset always work on no-provenance pointers
Ralf Jung [Sun, 20 Nov 2022 10:01:00 +0000 (11:01 +0100)]
make align_offset always work on no-provenance pointers

19 months agoAuto merge of #2681 - RalfJung:seed, r=oli-obk
bors [Sun, 20 Nov 2022 09:49:34 +0000 (09:49 +0000)]
Auto merge of #2681 - RalfJung:seed, r=oli-obk

make miri-seed a regular integer, and also set layout-seed in many-seeds

This makes the seed format consistent between `-Zlayout-seed` and `-Zmiri-seed`.

19 months agomake miri-seed a regular integer, and also set layout-seed in many-seeds
Ralf Jung [Sun, 20 Nov 2022 08:38:02 +0000 (09:38 +0100)]
make miri-seed a regular integer, and also set layout-seed in many-seeds

19 months agoAuto merge of #2680 - RalfJung:rustup, r=RalfJung
bors [Sun, 20 Nov 2022 07:06:11 +0000 (07:06 +0000)]
Auto merge of #2680 - RalfJung:rustup, r=RalfJung

Rustup

19 months agofix unused warning in a test
Ralf Jung [Sun, 20 Nov 2022 07:04:36 +0000 (08:04 +0100)]
fix unused warning in a test

19 months agoMerge from rustc
Ralf Jung [Sun, 20 Nov 2022 06:48:27 +0000 (07:48 +0100)]
Merge from rustc

19 months agoPreparing for merge from rustc
Ralf Jung [Sun, 20 Nov 2022 06:48:21 +0000 (07:48 +0100)]
Preparing for merge from rustc

19 months agoAuto merge of #104522 - RalfJung:try_normalize_after_erasing_regions, r=oli-obk
bors [Sun, 20 Nov 2022 01:16:52 +0000 (01:16 +0000)]
Auto merge of #104522 - RalfJung:try_normalize_after_erasing_regions, r=oli-obk

try_normalize_after_erasing_regions: promote an assertion to always run

In https://github.com/rust-lang/miri/issues/2433 this assertion has been seen to trigger, so it might be worth actually checking this? Regressing debug assertions are very easy to miss until much later, and then they become quite hard to debug.

19 months agoAuto merge of #2679 - RalfJung:clock_gettime, r=RalfJung
bors [Sat, 19 Nov 2022 22:48:10 +0000 (22:48 +0000)]
Auto merge of #2679 - RalfJung:clock_gettime, r=RalfJung

implement clock_gettime on macos

and pull in rustc changes so we can test this against https://github.com/rust-lang/rust/pull/103594.

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

19 months agoimplement clock_gettime on macos
Ralf Jung [Sat, 19 Nov 2022 19:21:48 +0000 (20:21 +0100)]
implement clock_gettime on macos

19 months agoAuto merge of #104470 - ehuss:cdb-dupe-last-command, r=jyn514
bors [Sat, 19 Nov 2022 22:25:18 +0000 (22:25 +0000)]
Auto merge of #104470 - ehuss:cdb-dupe-last-command, r=jyn514

Don't duplicate last cdb debuginfo test command

cdb scripts interpret a blank line to mean "repeat the last command", similar to what happens when running the debugger from a console. The code for compiletest that constructs the debugger script was inserting a blank line between the last command and the "quit" command. This caused the last command to be executed twice. This can cause some confusion since the `-check` lines are expecting the output in a certain order. But printing the last command twice causes that order-assumption to fail, and that can cause confusion.

This fixes it by removing the blank line.

AFAICT, gdb and lldb scripts don't have the same behavior with blank lines (and the gdb code doesn't add any blank lines anyways).

19 months agoAuto merge of #102795 - lukas-code:constify-is-aligned-via-align-offset, r=oli-obk
bors [Sat, 19 Nov 2022 18:57:39 +0000 (18:57 +0000)]
Auto merge of #102795 - lukas-code:constify-is-aligned-via-align-offset, r=oli-obk

Constify `is_aligned` via `align_offset`

Alternative to https://github.com/rust-lang/rust/pull/102753

Make `align_offset` work in const eval (and not always return `usize::MAX`) and then use that to constify `is_aligned{_to}`.

Tracking Issue: https://github.com/rust-lang/rust/issues/104203

19 months agoupdate provenance test
Lukas Markeffsky [Fri, 18 Nov 2022 12:59:21 +0000 (13:59 +0100)]
update provenance test

* fix allocation alignment for 16bit platforms
* add edge case where `stride % align != 0` on pointers with provenance

19 months agofix assembly test on apple
Lukas Markeffsky [Wed, 16 Nov 2022 20:07:51 +0000 (21:07 +0100)]
fix assembly test on apple

19 months agoUpdate comment on pointer-to-usize transmute
Lukas [Wed, 16 Nov 2022 14:08:35 +0000 (15:08 +0100)]
Update comment on pointer-to-usize transmute

Co-authored-by: Ralf Jung <post@ralfj.de>
19 months agoRevert "don't call `align_offset` during const eval, ever"
Lukas Markeffsky [Wed, 16 Nov 2022 10:41:18 +0000 (11:41 +0100)]
Revert "don't call `align_offset` during const eval, ever"

This reverts commit f3a577bfae376c0222e934911865ed14cddd1539.

19 months agofix const `align_offset` implementation
Lukas Markeffsky [Tue, 15 Nov 2022 14:55:37 +0000 (15:55 +0100)]
fix const `align_offset` implementation

19 months agofix assembly test on windows
Lukas Markeffsky [Fri, 11 Nov 2022 14:52:49 +0000 (15:52 +0100)]
fix assembly test on windows

19 months agoreplace potential ICE with graceful error (`no_core` only)
Lukas Markeffsky [Fri, 11 Nov 2022 09:01:06 +0000 (10:01 +0100)]
replace potential ICE with graceful error (`no_core` only)

19 months agodocs cleanup
Lukas Markeffsky [Wed, 9 Nov 2022 19:18:00 +0000 (20:18 +0100)]
docs cleanup

* Fix doc examples for Platforms with underaligned integer primitives.
* Mutable pointer doc examples use mutable pointers.
* Fill out tracking issue.
* Minor formatting changes.

19 months agoalways use `align_offset` in `is_aligned_to` + add assembly test
Lukas Markeffsky [Sun, 23 Oct 2022 10:30:46 +0000 (12:30 +0200)]
always use `align_offset` in `is_aligned_to` + add assembly test

19 months agoSchrödinger's pointer
Lukas Markeffsky [Sat, 22 Oct 2022 22:47:21 +0000 (00:47 +0200)]
Schrödinger's pointer

It's aligned *and* not aligned!

19 months agoaddress more review comments
Lukas Markeffsky [Sat, 22 Oct 2022 19:20:04 +0000 (21:20 +0200)]
address more review comments

* `cfg` only the body of `align_offset`
* put explicit panics back
* explain why `ptr.align_offset(align) == 0` is slow

19 months agodocument `is_aligned{,_to}`
Lukas Markeffsky [Sat, 22 Oct 2022 17:15:03 +0000 (19:15 +0200)]
document `is_aligned{,_to}`

19 months agodon't call `align_offset` during const eval, ever
Lukas Markeffsky [Sat, 22 Oct 2022 15:31:07 +0000 (17:31 +0200)]
don't call `align_offset` during const eval, ever

19 months agomark `align_offset` as `#[must_use]`
Lukas Markeffsky [Thu, 20 Oct 2022 17:46:31 +0000 (19:46 +0200)]
mark `align_offset` as `#[must_use]`

19 months agoadd coretests for `is_aligned`
Lukas Markeffsky [Fri, 7 Oct 2022 19:46:28 +0000 (21:46 +0200)]
add coretests for `is_aligned`

19 months agoconstify `pointer::is_aligned{,_to}`
Lukas Markeffsky [Fri, 7 Oct 2022 20:24:31 +0000 (22:24 +0200)]
constify `pointer::is_aligned{,_to}`

19 months agoadd coretests for const `align_offset`
Lukas Markeffsky [Fri, 7 Oct 2022 18:59:23 +0000 (20:59 +0200)]
add coretests for const `align_offset`

19 months agoAuto merge of #104607 - matthiaskrgr:rollup-9s589me, r=matthiaskrgr
bors [Sat, 19 Nov 2022 15:40:04 +0000 (15:40 +0000)]
Auto merge of #104607 - matthiaskrgr:rollup-9s589me, r=matthiaskrgr

Rollup of 10 pull requests

Successful merges:

 - #103117 (Use `IsTerminal` in place of `atty`)
 - #103969 (Partial support for running UI tests with `download-rustc`)
 - #103989 (Fix build of std for thumbv7a-pc-windows-msvc)
 - #104076 (fix sysroot issue which appears for ci downloaded rustc)
 - #104469 (Make "long type" printing type aware and trim types in E0275)
 - #104497 (detect () to avoid redundant <> suggestion for type)
 - #104577 (Don't focus on notable trait parent when hiding it)
 - #104587 (Update cargo)
 - #104593 (Improve spans for RPITIT object-safety errors)
 - #104604 (Migrate top buttons style to CSS variables)

Failed merges:

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

19 months agomake const `align_offset` useful
Lukas Markeffsky [Fri, 7 Oct 2022 20:23:34 +0000 (22:23 +0200)]
make const `align_offset` useful

19 months agounify inherent impls of `CompileTimeEvalContext`
Lukas Markeffsky [Thu, 20 Oct 2022 18:15:37 +0000 (20:15 +0200)]
unify inherent impls of `CompileTimeEvalContext`

19 months agoconstify `exact_div` intrinsic
Lukas Markeffsky [Fri, 7 Oct 2022 18:57:34 +0000 (20:57 +0200)]
constify `exact_div` intrinsic

19 months agoRollup merge of #104604 - GuillaumeGomez:migrate-top-button-to-css-var, r=notriddle
Matthias Krüger [Sat, 19 Nov 2022 14:35:23 +0000 (15:35 +0100)]
Rollup merge of #104604 - GuillaumeGomez:migrate-top-button-to-css-var, r=notriddle

Migrate top buttons style to CSS variables

No UI changes.

r? `@notriddle`

19 months agoRollup merge of #104593 - compiler-errors:rpitit-object-safety-spans, r=fee1-dead
Matthias Krüger [Sat, 19 Nov 2022 14:35:23 +0000 (15:35 +0100)]
Rollup merge of #104593 - compiler-errors:rpitit-object-safety-spans, r=fee1-dead

Improve spans for RPITIT object-safety errors

No reason why we can't point at the `impl Trait` that causes the object-safety violation.

Also [drive-by: Add is_async fn to hir::IsAsync](https://github.com/rust-lang/rust/pull/104593/commits/c4165f3a965e258531928180195637455299c6f3), which touches clippy too.

19 months agoRollup merge of #104587 - weihanglo:update-cargo, r=weihanglo
Matthias Krüger [Sat, 19 Nov 2022 14:35:22 +0000 (15:35 +0100)]
Rollup merge of #104587 - weihanglo:update-cargo, r=weihanglo

Update cargo

3 commits in 16b097879b6f117c8ae698aab054c87f26ff325e..eb5d35917b2395194593c9ca70c3778f60c1573b
2022-11-14 23:28:16 +0000 to 2022-11-17 22:08:43 +0000
- Fix several tests that are waiting 60 seconds for publishing to time out (rust-lang/cargo#11388)
- Implement RFC 3139: alternative registry authentication support (rust-lang/cargo#10592)
- Fix cargo install --index when used with registry.default (rust-lang/cargo#11302)

r? `@ghost`

19 months agoRollup merge of #104577 - GuillaumeGomez:remove-focus-on-blur, r=notriddle
Matthias Krüger [Sat, 19 Nov 2022 14:35:22 +0000 (15:35 +0100)]
Rollup merge of #104577 - GuillaumeGomez:remove-focus-on-blur, r=notriddle

Don't focus on notable trait parent when hiding it

I clicked on a notable trait icon so the popup remained and then clicked on the settings menu. When the settings menu was blurred, it scrolled back to when the notable trait was, which isn't great.

r? `@notriddle`

19 months agoRollup merge of #104497 - lyming2007:issue-104379-fix, r=fee1-dead
Matthias Krüger [Sat, 19 Nov 2022 14:35:21 +0000 (15:35 +0100)]
Rollup merge of #104497 - lyming2007:issue-104379-fix, r=fee1-dead

detect () to avoid redundant <> suggestion for type

fix #104379

19 months agoRollup merge of #104469 - estebank:long-types, r=oli-obk
Matthias Krüger [Sat, 19 Nov 2022 14:35:21 +0000 (15:35 +0100)]
Rollup merge of #104469 - estebank:long-types, r=oli-obk

Make "long type" printing type aware and trim types in E0275

Instead of simple string cutting, use a custom printer to hide parts of long printed types.

On E0275, check for type length before printing.

19 months agoRollup merge of #104076 - ozkanonur:fix-ci-rustc-sysroot, r=jyn514
Matthias Krüger [Sat, 19 Nov 2022 14:35:20 +0000 (15:35 +0100)]
Rollup merge of #104076 - ozkanonur:fix-ci-rustc-sysroot, r=jyn514

fix sysroot issue which appears for ci downloaded rustc

Currently when compiler is downloaded rather than compiled, sysroot is being `ci-rustc-sysroot` because of https://github.com/rust-lang/rust/blob/7eef946fc0e0eff40e588eab77b09b287accbec3/src/bootstrap/compile.rs#L1125-L1131 this.

And rustdoc is overriding the downloaded one at the end of the process.

With the condition I add, we simply check if the current compiler stage is target build stage, if so use the proper sysroot instead of `ci-rustc-sysroot`.

Resolves #103206

19 months agoRollup merge of #103989 - arlosi:arm32-panic, r=Amanieu
Matthias Krüger [Sat, 19 Nov 2022 14:35:20 +0000 (15:35 +0100)]
Rollup merge of #103989 - arlosi:arm32-panic, r=Amanieu

Fix build of std for thumbv7a-pc-windows-msvc

Attempting to build std for the tier-3 target `thumbv7a-pc-windows-msvc` fails with the following error:
```
Building stage1 std artifacts (x86_64-pc-windows-msvc -> thumbv7a-pc-windows-msvc)
..
LLVM ERROR: WinEH not implemented for this target
error: could not compile `panic_unwind`
```

EH (unwinding) is not supported by LLVM for 32 bit arm msvc targets. This changes panic unwind to use the dummy implementation for `thumbv7a-pc-windows-msvc`.

19 months agoRollup merge of #103969 - ferrocene:pa-download-rustc-ui-tests, r=jyn514
Matthias Krüger [Sat, 19 Nov 2022 14:35:19 +0000 (15:35 +0100)]
Rollup merge of #103969 - ferrocene:pa-download-rustc-ui-tests, r=jyn514

Partial support for running UI tests with `download-rustc`

Right now trying to run UI tests with `download-rustc` results in a bunch of test failures, requiring someone who wants to only work on tests to also build the full compiler. This PR **partially** addresses the problem by solving a lot of the errors (but not all).

* This installs the `rust-src` component on CI toolchains, since the test output depends on whether the standard library source code is installed; We can't just symlink the current source because the `rustc-dev` component already includes the compiler sources, but not the library sources, and mixing things is worse IMO.
* This ensures the `$SRC_DIR` normalization done by compiletest correctly handles the source code added above.
* This unconditionally sets `remap-prefix` to the prefix used in the downloaded toolchain, to ensure compiletest normalizes it.

19 months agoRollup merge of #103117 - joshtriplett:use-is-terminal, r=eholk
Matthias Krüger [Sat, 19 Nov 2022 14:35:18 +0000 (15:35 +0100)]
Rollup merge of #103117 - joshtriplett:use-is-terminal, r=eholk

Use `IsTerminal` in place of `atty`

In any crate that can use nightly features, use `IsTerminal` rather than
`atty`:

- Use `IsTerminal` in `rustc_errors`
- Use `IsTerminal` in `rustc_driver`
- Use `IsTerminal` in `rustc_log`
- Use `IsTerminal` in `librustdoc`

19 months agoAuto merge of #104571 - clubby789:remove-vec-rc-opt, r=the8472
bors [Sat, 19 Nov 2022 12:44:57 +0000 (12:44 +0000)]
Auto merge of #104571 - clubby789:remove-vec-rc-opt, r=the8472

Revert Vec/Rc storage reuse opt

Remove the optimization for using storage added by #104205.
The perf wins were pretty small, and it relies on non-guarenteed behaviour. On platforms that don't implement shrinking in place, the performance will be significantly worse.

While it could be gated to platforms that do this (such as GNU), I don't think it's worth the overhead of maintaining it for very small gains. (#104565, #104563)

cc `@RalfJung` `@matthiaskrgr`

Fixes #104565
Fixes #104563

19 months agoMerge from rustc
Ralf Jung [Sat, 19 Nov 2022 12:40:56 +0000 (13:40 +0100)]
Merge from rustc

19 months agoPreparing for merge from rustc
Ralf Jung [Sat, 19 Nov 2022 12:40:47 +0000 (13:40 +0100)]
Preparing for merge from rustc

19 months agoMigrate top buttons style to CSS variables
Guillaume Gomez [Sat, 19 Nov 2022 10:07:13 +0000 (11:07 +0100)]
Migrate top buttons style to CSS variables

19 months agoUpdate browser-ui-test version to 0.13.2
Guillaume Gomez [Fri, 18 Nov 2022 23:27:37 +0000 (00:27 +0100)]
Update browser-ui-test version to 0.13.2

19 months agoExtend GUI test to check notable traits blur behaviour
Guillaume Gomez [Fri, 18 Nov 2022 23:25:37 +0000 (00:25 +0100)]
Extend GUI test to check notable traits blur behaviour

19 months agoAuto merge of #103509 - compiler-errors:opaques-w-bound-vars-r-hard, r=oli-obk
bors [Sat, 19 Nov 2022 09:30:35 +0000 (09:30 +0000)]
Auto merge of #103509 - compiler-errors:opaques-w-bound-vars-r-hard, r=oli-obk

Revert "Normalize opaques with escaping bound vars"

This caused a perf regression in #103423, cc `@skyzh` this should fix #103423.

reverts #100980

r? `@oli-obk`

19 months agoAuto merge of #104600 - Dylan-DPC:rollup-glw1e8b, r=Dylan-DPC
bors [Sat, 19 Nov 2022 06:40:38 +0000 (06:40 +0000)]
Auto merge of #104600 - Dylan-DPC:rollup-glw1e8b, r=Dylan-DPC

Rollup of 8 pull requests

Successful merges:

 - #104001 (Improve generating Custom entry function)
 - #104411 (nll: correctly deal with bivariance)
 - #104528 (Properly link `{Once,Lazy}{Cell,Lock}` in docs)
 - #104553 (Improve accuracy of asinh and acosh)
 - #104554 (Use `ErrorGuaranteed::unchecked_claim_error_was_emitted` less)
 - #104566 (couple of clippy::perf fixes)
 - #104575 (deduplicate tests)
 - #104580 (diagnostics: only show one suggestion for method -> assoc fn)

Failed merges:

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

19 months agoRollup merge of #104580 - notriddle:notriddle/issue-102354-hide-sugg, r=compiler...
Dylan DPC [Sat, 19 Nov 2022 06:24:47 +0000 (11:54 +0530)]
Rollup merge of #104580 - notriddle:notriddle/issue-102354-hide-sugg, r=compiler-errors

diagnostics: only show one suggestion for method -> assoc fn

Fixes #102354

19 months agoRollup merge of #104575 - lcnr:dedup-tests, r=jackh726
Dylan DPC [Sat, 19 Nov 2022 06:24:46 +0000 (11:54 +0530)]
Rollup merge of #104575 - lcnr:dedup-tests, r=jackh726

deduplicate tests

originally added in #100514. Using revisions for this reduces the amount of tests in the repo

19 months agoRollup merge of #104566 - matthiaskrgr:clippy_perf_nov18, r=oli-obk
Dylan DPC [Sat, 19 Nov 2022 06:24:46 +0000 (11:54 +0530)]
Rollup merge of #104566 - matthiaskrgr:clippy_perf_nov18, r=oli-obk

couple of clippy::perf fixes

19 months agoRollup merge of #104554 - BoxyUwU:less_unchecked_pls, r=lcnr
Dylan DPC [Sat, 19 Nov 2022 06:24:45 +0000 (11:54 +0530)]
Rollup merge of #104554 - BoxyUwU:less_unchecked_pls, r=lcnr

Use `ErrorGuaranteed::unchecked_claim_error_was_emitted` less

there are only like 3 or 4 call sites left after this but it wasnt obvious to me how to remove them

19 months agoRollup merge of #104553 - mwillsey:asinh-acosh-accuracy, r=thomcc
Dylan DPC [Sat, 19 Nov 2022 06:24:45 +0000 (11:54 +0530)]
Rollup merge of #104553 - mwillsey:asinh-acosh-accuracy, r=thomcc

Improve accuracy of asinh and acosh

This PR addresses the inaccuracy of `asinh` and `acosh` identified by the [Herbie](http://herbie.uwplse.org/) tool, `@pavpanchekha,` `@finnbear` in #104548. It also adds a couple tests that failed in the existing implementations and now pass.

Closes #104548

r? rust-lang/libs

19 months agoRollup merge of #104528 - WaffleLapkin:lazy_lock_docfix, r=matklad
Dylan DPC [Sat, 19 Nov 2022 06:24:44 +0000 (11:54 +0530)]
Rollup merge of #104528 - WaffleLapkin:lazy_lock_docfix, r=matklad

Properly link `{Once,Lazy}{Cell,Lock}` in docs

See https://github.com/rust-lang/rust/issues/74465#issuecomment-1317947443

19 months agoRollup merge of #104411 - lcnr:bivariance-nll, r=compiler-errors
Dylan DPC [Sat, 19 Nov 2022 06:24:44 +0000 (11:54 +0530)]
Rollup merge of #104411 - lcnr:bivariance-nll, r=compiler-errors

nll: correctly deal with bivariance

fixes #104409

when in a bivariant context, relating stuff should always trivially succeed. Also changes the mir validator to correctly deal with higher ranked regions.

r? types cc ``@RalfJung``

19 months agoRollup merge of #104001 - Ayush1325:custom-entry, r=bjorn3
Dylan DPC [Sat, 19 Nov 2022 06:24:43 +0000 (11:54 +0530)]
Rollup merge of #104001 - Ayush1325:custom-entry, r=bjorn3

Improve generating Custom entry function

This commit is aimed at making compiler-generated entry functions (Basically just C `main` right now) more generic so other targets can do similar things for custom entry. This was initially implemented as part of https://github.com/rust-lang/rust/pull/100316.

Currently, this moves the entry function name and Call convention to the target spec.

Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
19 months agoImprove spans for RPITIT object-safety errors
Michael Goulet [Sat, 19 Nov 2022 02:32:55 +0000 (02:32 +0000)]
Improve spans for RPITIT object-safety errors

19 months agoAuto merge of #97870 - eggyal:inplace_fold_spec, r=wesleywiser
bors [Sat, 19 Nov 2022 02:28:47 +0000 (02:28 +0000)]
Auto merge of #97870 - eggyal:inplace_fold_spec, r=wesleywiser

Use liballoc's specialised in-place vec collection

liballoc already specialises in-place vector collection, so manually
reimplementing it in `IdFunctor::try_map_id` was superfluous.

19 months agodrive-by: Add is_async fn to hir::IsAsync
Michael Goulet [Sat, 19 Nov 2022 02:22:24 +0000 (02:22 +0000)]
drive-by: Add is_async fn to hir::IsAsync

19 months agoFix invalid focus when blurring notable traits popover
Guillaume Gomez [Fri, 18 Nov 2022 23:25:21 +0000 (00:25 +0100)]
Fix invalid focus when blurring notable traits popover

19 months agoAuto merge of #104591 - Manishearth:rollup-b3ser4e, r=Manishearth
bors [Fri, 18 Nov 2022 23:20:53 +0000 (23:20 +0000)]
Auto merge of #104591 - Manishearth:rollup-b3ser4e, r=Manishearth

Rollup of 8 pull requests

Successful merges:

 - #102977 (remove HRTB from `[T]::is_sorted_by{,_key}`)
 - #103378 (Fix mod_inv termination for the last iteration)
 - #103456 (`unchecked_{shl|shr}` should use `u32` as the RHS)
 - #103701 (Simplify some pointer method implementations)
 - #104047 (Diagnostics `icu4x` based list formatting.)
 - #104338 (Enforce that `dyn*` coercions are actually pointer-sized)
 - #104498 (Edit docs for `rustc_errors::Handler::stash_diagnostic`)
 - #104556 (rustdoc: use `code-header` class to format enum variants)

Failed merges:

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

19 months agoRollup merge of #104556 - notriddle:notriddle/variant, r=GuillaumeGomez
Manish Goregaokar [Fri, 18 Nov 2022 22:48:19 +0000 (17:48 -0500)]
Rollup merge of #104556 - notriddle:notriddle/variant, r=GuillaumeGomez

rustdoc: use `code-header` class to format enum variants

The font size and weights should be exactly the same after this PR, but the spacing is changed to be the same as methods.

Preview: http://notriddle.com/notriddle-rustdoc-demos/variant/test_dingus_enum/enum.TestEnum.html

19 months agoRollup merge of #104498 - pierwill:stash-diag-docs, r=compiler-errors
Manish Goregaokar [Fri, 18 Nov 2022 22:48:19 +0000 (17:48 -0500)]
Rollup merge of #104498 - pierwill:stash-diag-docs, r=compiler-errors

Edit docs for `rustc_errors::Handler::stash_diagnostic`

Clarify that the diagnostic can be retrieved with `steal_diagnostic`.

r? ```@compiler-errors```

19 months agoRollup merge of #104338 - compiler-errors:pointer-sized, r=eholk
Manish Goregaokar [Fri, 18 Nov 2022 22:48:18 +0000 (17:48 -0500)]
Rollup merge of #104338 - compiler-errors:pointer-sized, r=eholk

Enforce that `dyn*` coercions are actually pointer-sized

Implement a perma-unstable, rudimentary `PointerSized` trait to enforce `dyn*` casts are `usize`-sized for now, at least to prevent ICEs and weird codegen issues from cropping up after monomorphization since currently we enforce *nothing*.

This probably can/should be removed in favor of a more sophisticated trait for handling `dyn*` conversions when we decide on one, but I just want to get something up for discussion and experimentation for now.

r? ```@eholk``` cc ```@tmandry``` (though feel free to claim/reassign)

Fixes #102141
Fixes #102173

19 months agoRollup merge of #104047 - crlf0710:icu_based_list_formatting, r=davidtwco
Manish Goregaokar [Fri, 18 Nov 2022 22:48:17 +0000 (17:48 -0500)]
Rollup merge of #104047 - crlf0710:icu_based_list_formatting, r=davidtwco

Diagnostics `icu4x` based list formatting.

This adds a new kind of `DiagnosticArg` and add the ability to convert it to a `FluentValue::Custom`. When emitting fluent output, it makes use of `ListFormatter` from `icu4x` project to convert it to localized version of list following the fluent locale, as a kind of eager translation.

Tested locally with locales like `en`, `ja`, etc, and they work fine. <del>Though neither `zh-CN` nor `zh-Hans` works correctly, it seems they fallback to `und` locale somehow, emitting only comma-based list. I believe this is an internal issue of `icu4x` itself.</del>(Works fine after https://github.com/rust-lang/rust/pull/104047#issuecomment-1304860940)

Would love to hear what others think.

r? `@davidtwco`
cc `@Manishearth`

19 months agoRollup merge of #103701 - WaffleLapkin:__points-at-implementation__--this-can-be...
Manish Goregaokar [Fri, 18 Nov 2022 22:48:17 +0000 (17:48 -0500)]
Rollup merge of #103701 - WaffleLapkin:__points-at-implementation__--this-can-be-simplified, r=scottmcm

Simplify some pointer method implementations

- Make `pointer::with_metadata_of` const (+simplify implementation) (cc #75091)
- Simplify implementation of various pointer methods

r? ```@scottmcm```

----

`from_raw_parts::<T>(this, metadata(self))` was annoying me for a while and I've finally figured out how it should _actually_ be done.

19 months agoRollup merge of #103456 - scottmcm:fix-unchecked-shifts, r=scottmcm
Manish Goregaokar [Fri, 18 Nov 2022 22:48:17 +0000 (17:48 -0500)]
Rollup merge of #103456 - scottmcm:fix-unchecked-shifts, r=scottmcm

`unchecked_{shl|shr}` should use `u32` as the RHS

The other shift methods, such as https://doc.rust-lang.org/nightly/std/primitive.u64.html#method.checked_shr and https://doc.rust-lang.org/nightly/std/primitive.i16.html#method.wrapping_shl, use `u32` for the shift amount.  That's consistent with other things, like `count_ones`, which also always use `u32` for a bit count, regardless of the size of the type.

This PR changes `unchecked_shl` and `unchecked_shr` to also use `u32` for the shift amount (rather than Self).

cc #85122, the `unchecked_math` tracking issue

19 months agoRollup merge of #103378 - nagisa:fix-infinite-offset, r=scottmcm
Manish Goregaokar [Fri, 18 Nov 2022 22:48:16 +0000 (17:48 -0500)]
Rollup merge of #103378 - nagisa:fix-infinite-offset, r=scottmcm

Fix mod_inv termination for the last iteration

On usize=u64 platforms, the 4th iteration would overflow the `mod_gate` back to 0. Similarly for usize=u32 platforms, the 3rd iteration would overflow much the same way.

I tested various approaches to resolving this, including approaches with `saturating_mul` and `widening_mul` to a double usize. Turns out LLVM likes `mul_with_overflow` the best. In fact now, that LLVM can see the iteration count is limited, it will happily unroll the loop into a nice linear sequence.

You will also notice that the code around the loop got simplified somewhat. Now that LLVM is handling the loop nicely, there isn’t any more reasons to manually unroll the first iteration out of the loop (though looking at the code today I’m not sure all that complexity was necessary in the first place).

Fixes #103361

19 months agoRollup merge of #102977 - lukas-code:is-sorted-hrtb, r=m-ou-se
Manish Goregaokar [Fri, 18 Nov 2022 22:48:16 +0000 (17:48 -0500)]
Rollup merge of #102977 - lukas-code:is-sorted-hrtb, r=m-ou-se

remove HRTB from `[T]::is_sorted_by{,_key}`

Changes the signature of `[T]::is_sorted_by{,_key}` to match `[T]::binary_search_by{,_key}` and make code like https://github.com/rust-lang/rust/issues/53485#issuecomment-885393452 compile.

Tracking issue: https://github.com/rust-lang/rust/issues/53485

~~Do we need an ACP for something like this?~~ Edit: Filed ACP here: https://github.com/rust-lang/libs-team/issues/121