]> git.lizzy.rs Git - rust.git/log
rust.git
18 months agomake ./miri run a bit more silent; add option to control seeds tested by many-seeds
Ralf Jung [Mon, 28 Nov 2022 07:40:41 +0000 (08:40 +0100)]
make ./miri run a bit more silent; add option to control seeds tested by many-seeds

18 months agomove interpreter loop into thread manager; they are pretty tightly coupled anyway
Ralf Jung [Sun, 27 Nov 2022 14:19:00 +0000 (15:19 +0100)]
move interpreter loop into thread manager; they are pretty tightly coupled anyway

18 months agofix TLS on partially supported OSes
Ralf Jung [Sun, 27 Nov 2022 12:19:54 +0000 (13:19 +0100)]
fix TLS on partially supported OSes

18 months agoadd scoped thread test
Ralf Jung [Sun, 27 Nov 2022 11:57:30 +0000 (12:57 +0100)]
add scoped thread test

18 months agoyield the main thread a number of times after its TLS dtors are done
Ralf Jung [Sun, 27 Nov 2022 11:30:50 +0000 (12:30 +0100)]
yield the main thread a number of times after its TLS dtors are done

18 months agocleanup global imports a bit
Ralf Jung [Sun, 27 Nov 2022 11:22:14 +0000 (12:22 +0100)]
cleanup global imports a bit

18 months agorefactor scheduling of TLS dtors
Ralf Jung [Sun, 27 Nov 2022 11:18:23 +0000 (12:18 +0100)]
refactor scheduling of TLS dtors

18 months agoAuto merge of #2702 - RalfJung:rustup, r=RalfJung
bors [Sun, 27 Nov 2022 19:54:04 +0000 (19:54 +0000)]
Auto merge of #2702 - RalfJung:rustup, r=RalfJung

Rustup

No changes happened on the rustc side, but I want to do a push next and would rather make josh's life easier by integrating some recent history first.

18 months agoclippy
Ralf Jung [Sun, 27 Nov 2022 19:50:53 +0000 (20:50 +0100)]
clippy

18 months agoadvice on josh pushing
Ralf Jung [Sun, 27 Nov 2022 19:47:49 +0000 (20:47 +0100)]
advice on josh pushing

18 months agoMerge from rustc
Ralf Jung [Sun, 27 Nov 2022 19:51:52 +0000 (20:51 +0100)]
Merge from rustc

18 months agoPreparing for merge from rustc
Ralf Jung [Sun, 27 Nov 2022 19:51:50 +0000 (20:51 +0100)]
Preparing for merge from rustc

18 months agoAuto merge of #2694 - RalfJung:retag-deref-check, r=saethlin
bors [Sun, 27 Nov 2022 19:03:21 +0000 (19:03 +0000)]
Auto merge of #2694 - RalfJung:retag-deref-check, r=saethlin

fix handling of spurious accesses during retag

The `dereferenceable` attribute we emit for LLVM is checked during retag in Stacked Borrows.
However, we currently don't properly do that for retagging of `&mut !Unpin`, which this PR fixes.
Also this adjusts retagging to inform the data race model of the accesses as well.

Fixes https://github.com/rust-lang/miri/issues/2648.
Also fixes https://github.com/rust-lang/miri/issues/2693 since the same issue arose for retagging as well.

r? `@saethlin`

18 months agoAuto merge of #104048 - cjgillot:split-lifetime, r=compiler-errors
bors [Sun, 27 Nov 2022 14:30:19 +0000 (14:30 +0000)]
Auto merge of #104048 - cjgillot:split-lifetime, r=compiler-errors

Separate lifetime ident from lifetime resolution in HIR

Drive-by: change how suggested generic args are computed.
Fixes https://github.com/rust-lang/rust/issues/103815

I recommend reviewing commit-by-commit.

18 months agoAuto merge of #2685 - Nilstrieb:cargo-miri-wasm, r=RalfJung
bors [Sun, 27 Nov 2022 13:31:05 +0000 (13:31 +0000)]
Auto merge of #2685 - Nilstrieb:cargo-miri-wasm, r=RalfJung

Use `.wasm` extension when building for wasm in cargo-miri

WASM uses the `.wasm` file extension for its binaries (just like how windows uses `.exe`), so we need to set that as well.

I'm not sure whether gating this behind the wasm target is a good idea, maybe it makes more sense to always do it just like on windows.

18 months agoAuto merge of #2701 - RalfJung:smoke, r=RalfJung
bors [Sun, 27 Nov 2022 12:45:34 +0000 (12:45 +0000)]
Auto merge of #2701 - RalfJung:smoke, r=RalfJung

run_tests_minimal: actually run the smoke test on the desired target

18 months agorun_tests_minimal: actually run the smoke test on the desired target
Ralf Jung [Sun, 27 Nov 2022 12:26:31 +0000 (13:26 +0100)]
run_tests_minimal: actually run the smoke test on the desired target

18 months agoAuto merge of #2700 - RalfJung:begingroup, r=RalfJung
bors [Sun, 27 Nov 2022 12:21:26 +0000 (12:21 +0000)]
Auto merge of #2700 - RalfJung:begingroup, r=RalfJung

CI: fix begingroup printing

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 #103917 - oli-obk:layout_math, r=RalfJung,lcnr
bors [Sun, 27 Nov 2022 10:35:00 +0000 (10:35 +0000)]
Auto merge of #103917 - oli-obk:layout_math, r=RalfJung,lcnr

Various cleanups around scalar layout restrictions

Pulled out of https://github.com/rust-lang/rust/pull/103724

18 months agoUse `.wasm` extension when building for wasm in cargo-miri
nils [Mon, 21 Nov 2022 08:01:26 +0000 (09:01 +0100)]
Use `.wasm` extension when building for wasm in cargo-miri

WASM uses the `.wasm` file extension for its binaries (just like how
windows uses `.exe`), so we need to set that as well.

18 months agoAuto merge of #103786 - tshepang:obsolete, r=jyn514
bors [Sun, 27 Nov 2022 07:12:30 +0000 (07:12 +0000)]
Auto merge of #103786 - tshepang:obsolete, r=jyn514

Don't build `compiler_builtins` with `-C panic=abort`

18 months agoAuto merge of #96451 - JakobDegen:dest-prop, r=tmiasko
bors [Sun, 27 Nov 2022 04:09:53 +0000 (04:09 +0000)]
Auto merge of #96451 - JakobDegen:dest-prop, r=tmiasko

Fix Dest Prop

Closes #82678, #79191 .

This was not originally a total re-write of the pass but is has gradually turned into one. Notable changes:

 1. Significant improvements to documentation all around. The top of the file has been extended with a more precise argument for soundness. The code should be fairly readable, and I've done my best to add useful comments wherever possible. I would very much like for the bus factor to not be one on this code.
 3. Improved handling of conflicts that are not visible in normal dataflow.  This was the cause of #79191. Handling this correctly requires us to make decision about the semantics and specifically evaluation order of basically all MIR constructs (see specifically #68364 #71117.  The way this is implemented is based on my preferred resolution to these questions around the semantics of assignment statements.
 4. Some re-architecting to improve performance. More details below.
 5. Possible future improvements to this optimization are documented, and the code is written with the needs of those improvements in mind. The hope is that adding support for more precise analyses will not require a full re-write of this opt, but just localized changes.

### Regarding Performance

The previous approach had some performance issues; letting `l` be the number of locals and `s` be the number of statements/terminators, the runtime of the pass was `O(l^2 * s)`, both in theory and in practice. This version is smarter about not calculating unnecessary things and doing more caching. Our runtime is now dominated by one invocation of `MaybeLiveLocals` for each "round," and the number of rounds is less than 5 in over 90% of cases. This means it's linear-ish in practice.

r? `@oli-obk` who reviewed the last version of this, but review from anyone else would be more than welcome

18 months agoRewrite dest prop.
Jakob Degen [Sun, 24 Apr 2022 21:34:24 +0000 (17:34 -0400)]
Rewrite dest prop.

This fixes a number of correctness issues from the previous version. Additionally, we use a new
strategy which has much better performance charactersitics and also finds more opportunities to
apply the optimization.

18 months agoAuto merge of #104818 - scottmcm:refactor-extend-func, r=the8472
bors [Sun, 27 Nov 2022 00:58:50 +0000 (00:58 +0000)]
Auto merge of #104818 - scottmcm:refactor-extend-func, r=the8472

Stop peeling the last iteration of the loop in `Vec::resize_with`

`resize_with` uses the `ExtendWith` code that peels the last iteration:
https://github.com/rust-lang/rust/blob/341d8b8a2c290b4535e965867e876b095461ff6e/library/alloc/src/vec/mod.rs#L2525-L2529

But that's kinda weird for `ExtendFunc` because it does the same thing on the last iteration anyway:
https://github.com/rust-lang/rust/blob/341d8b8a2c290b4535e965867e876b095461ff6e/library/alloc/src/vec/mod.rs#L2494-L2502

So this just has it use the normal `extend`-from-`TrustedLen` code instead.

r? `@ghost`

18 months agonits
Ralf Jung [Sat, 26 Nov 2022 23:06:00 +0000 (00:06 +0100)]
nits

18 months agomake Stacked Borrows retags act like data races
Ralf Jung [Sat, 26 Nov 2022 13:46:06 +0000 (14:46 +0100)]
make Stacked Borrows retags act like data races

18 months agoslightly adjust and synchronize Machine passing for SB and DataRace
Ralf Jung [Sat, 26 Nov 2022 13:42:27 +0000 (14:42 +0100)]
slightly adjust and synchronize Machine passing for SB and DataRace

18 months ago!Unpin retags must still be reads, to check dereferenceable
Ralf Jung [Sat, 26 Nov 2022 12:22:19 +0000 (13:22 +0100)]
!Unpin retags must still be reads, to check dereferenceable

also fix ICE on deallocation error and avoid redundant find_granting on retag

18 months agoAuto merge of #104950 - jyn514:revert-preview, r=Mark-Simulacrum
bors [Sat, 26 Nov 2022 21:47:17 +0000 (21:47 +0000)]
Auto merge of #104950 - jyn514:revert-preview, r=Mark-Simulacrum

Revert "Don't set `is_preview` for clippy and rustfmt"

This reverts commit fb3e724d7602675f147a9b80e70fb6bd6512738c, which broke `rustup update` for anyone with clippy or rustfmt installed.

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

r? `@Mark-Simulacrum`

`@bors` p=50 fixes nightly

18 months agoRevert "Don't set `is_preview` for clippy and rustfmt"
Joshua Nelson [Sat, 26 Nov 2022 20:23:53 +0000 (15:23 -0500)]
Revert "Don't set `is_preview` for clippy and rustfmt"

This reverts commit fb3e724d7602675f147a9b80e70fb6bd6512738c, which broke `rustup update` for anyone with clippy or rustfmt installed.

18 months agoAuto merge of #104945 - GuillaumeGomez:rollup-ygzbpbe, r=GuillaumeGomez
bors [Sat, 26 Nov 2022 17:58:12 +0000 (17:58 +0000)]
Auto merge of #104945 - GuillaumeGomez:rollup-ygzbpbe, r=GuillaumeGomez

Rollup of 7 pull requests

Successful merges:

 - #104786 (Use the power of adding helper function to simplify code w/ `Mutability`)
 - #104788 (Do not record unresolved const vars in generator interior)
 - #104909 (Rename `normalize_opaque_types` to `reveal_opaque_types_in_bounds`)
 - #104921 (Remove unnecessary binder from `get_impl_future_output_ty`)
 - #104924 (jsondoclint: Accept trait alias is places where trait expected.)
 - #104928 (rustdoc: use flexbox CSS to align sidebar button instead of position)
 - #104943 (jsondoclint: Handle using enum variants and glob using enums.)

Failed merges:

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

18 months agoRollup merge of #104943 - aDotInTheVoid:jsondoclint-use-enum, r=GuillaumeGomez
Guillaume Gomez [Sat, 26 Nov 2022 16:47:26 +0000 (17:47 +0100)]
Rollup merge of #104943 - aDotInTheVoid:jsondoclint-use-enum, r=GuillaumeGomez

jsondoclint: Handle using enum variants and glob using enums.

More work on jsondoclint for `core.json`

Closes #104942

r? `@GuillaumeGomez`

`@rustbot` modify labels: +A-testsuite

18 months agoRollup merge of #104928 - notriddle:notriddle/sidebar-toggle-flexbox, r=GuillaumeGomez
Guillaume Gomez [Sat, 26 Nov 2022 16:47:25 +0000 (17:47 +0100)]
Rollup merge of #104928 - notriddle:notriddle/sidebar-toggle-flexbox, r=GuillaumeGomez

rustdoc: use flexbox CSS to align sidebar button instead of position

This accomplishes the same thing with significantly less code.

Preview: https://notriddle.com/notriddle-rustdoc-demos/sidebar-toggle-flexbox/src/test_dingus/lib.rs.html

18 months agoRollup merge of #104924 - aDotInTheVoid:jsondocck-trait-alias, r=GuillaumeGomez
Guillaume Gomez [Sat, 26 Nov 2022 16:47:25 +0000 (17:47 +0100)]
Rollup merge of #104924 - aDotInTheVoid:jsondocck-trait-alias, r=GuillaumeGomez

jsondoclint: Accept trait alias is places where trait expected.

More work to make `jsondoclint` work for `core.json`

Closes #104923

r? `@GuillaumeGomez`

`@rustbot` modify labels: +A-testsuite

18 months agoRollup merge of #104921 - compiler-errors:no-binder-on-fut-ty, r=cjgillot
Guillaume Gomez [Sat, 26 Nov 2022 16:47:24 +0000 (17:47 +0100)]
Rollup merge of #104921 - compiler-errors:no-binder-on-fut-ty, r=cjgillot

Remove unnecessary binder from `get_impl_future_output_ty`

We never construct an `async fn` with a higher-ranked `impl Future` bound anyways, and basically all the call-sites already skip the binder.

18 months agoRollup merge of #104909 - compiler-errors:normalize_opaque_types-is-misleading, r...
Guillaume Gomez [Sat, 26 Nov 2022 16:47:24 +0000 (17:47 +0100)]
Rollup merge of #104909 - compiler-errors:normalize_opaque_types-is-misleading, r=fee1-dead

Rename `normalize_opaque_types` to `reveal_opaque_types_in_bounds`

1. The query name is a bit misleading, since it doesn't do any associated type normalization, and
2. since it only takes a predicate list, it sounds a bit more powerful than it actually is.

18 months agoRollup merge of #104788 - compiler-errors:unresolved-ct-in-gen, r=fee1-dead
Guillaume Gomez [Sat, 26 Nov 2022 16:47:23 +0000 (17:47 +0100)]
Rollup merge of #104788 - compiler-errors:unresolved-ct-in-gen, r=fee1-dead

Do not record unresolved const vars in generator interior

Don't record types in the generator interior when we see unresolved const variables.

We already do this for associated types -- this is important to avoid unresolved inference variables in the generator results during writeback, since the writeback results get stable hashed in incremental mode.

Fixes #104787

18 months agoRollup merge of #104786 - WaffleLapkin:amp-mut-help, r=compiler-errors
Guillaume Gomez [Sat, 26 Nov 2022 16:47:23 +0000 (17:47 +0100)]
Rollup merge of #104786 - WaffleLapkin:amp-mut-help, r=compiler-errors

Use the power of adding helper function to simplify code w/ `Mutability`

r? `@compiler-errors`

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 agojsondoclint: Handle using enum variants and glob using enums.
Nixon Enraght-Moony [Sat, 26 Nov 2022 15:06:46 +0000 (15:06 +0000)]
jsondoclint: Handle using enum variants and glob using enums.

Closes #104942

18 months agoAuto merge of #104731 - compiler-errors:early-binder-iter-size-hint, r=cjgillot
bors [Sat, 26 Nov 2022 14:59:30 +0000 (14:59 +0000)]
Auto merge of #104731 - compiler-errors:early-binder-iter-size-hint, r=cjgillot

Add size hints to early binder iterator adapters

probably doesn't do anything, but definitely doesn't hurt

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 agoAuto merge of #104935 - matthiaskrgr:rollup-nuca86l, r=matthiaskrgr
bors [Sat, 26 Nov 2022 12:11:32 +0000 (12:11 +0000)]
Auto merge of #104935 - matthiaskrgr:rollup-nuca86l, r=matthiaskrgr

Rollup of 6 pull requests

Successful merges:

 - #104121 (Refine `instruction_set` MIR inline rules)
 - #104675 (Unsupported query error now specifies if its unsupported for local or external crate)
 - #104839 (improve array_from_fn documenation)
 - #104880 ([llvm-wrapper] adapt for LLVM API change)
 - #104899 (rustdoc: remove no-op CSS `#help dt { display: block }`)
 - #104906 (Remove AscribeUserTypeCx)

Failed merges:

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

18 months agoRollup merge of #104906 - spastorino:remove-ascribeusertypecx, r=compiler-errors
Matthias Krüger [Sat, 26 Nov 2022 09:39:12 +0000 (10:39 +0100)]
Rollup merge of #104906 - spastorino:remove-ascribeusertypecx, r=compiler-errors

Remove AscribeUserTypeCx

r? ``@compiler-errors``

This basically inlines `AscribeUserTypeCx::relate_mir_and_user_ty` into `type_op_ascribe_user_type_with_span` which is the only place where it's used and makes direct use of `ObligationCtxt` API.

18 months agoRollup merge of #104899 - notriddle:notriddle/help-dt, r=GuillaumeGomez
Matthias Krüger [Sat, 26 Nov 2022 09:39:12 +0000 (10:39 +0100)]
Rollup merge of #104899 - notriddle:notriddle/help-dt, r=GuillaumeGomez

rustdoc: remove no-op CSS `#help dt { display: block }`

`display: block` is the [default UA style] for dt.

[default UA style]: https://html.spec.whatwg.org/multipage/rendering.html#lists

18 months agoRollup merge of #104880 - krasimirgg:llvm-16-ctx, r=cuviper
Matthias Krüger [Sat, 26 Nov 2022 09:39:11 +0000 (10:39 +0100)]
Rollup merge of #104880 - krasimirgg:llvm-16-ctx, r=cuviper

[llvm-wrapper] adapt for LLVM API change

Adapt for the LLVM API changes from https://github.com/llvm/llvm-project/commit/721f975d3518403502f770ce11f3f02509b30c5b.

Found via our experimental rust + llvm @ HEAD bot: https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/15203#0184ae73-5169-4b9b-92f4-d4e6e9b86ad9/194-531

18 months agoRollup merge of #104839 - HintringerFabian:docs_array_from_fn, r=scottmcm
Matthias Krüger [Sat, 26 Nov 2022 09:39:11 +0000 (10:39 +0100)]
Rollup merge of #104839 - HintringerFabian:docs_array_from_fn, r=scottmcm

improve array_from_fn documenation

Improves array::from_fn documentation
Fixes #102609

There were also unresolved comments from [this PR #100462](https://github.com/rust-lang/rust/pull/100462), which have been added to my PR

18 months agoRollup merge of #104675 - SarthakSingh31:issue-101666, r=jyn514
Matthias Krüger [Sat, 26 Nov 2022 09:39:10 +0000 (10:39 +0100)]
Rollup merge of #104675 - SarthakSingh31:issue-101666, r=jyn514

Unsupported query error now specifies if its unsupported for local or external crate

Fixes #101666.
I had to move `keys.rs` from `rustc_query_impl` to `rustc_middle`. I don't know if that is problematic. I couldn't think of any other way to get the needed information inside `rustc_middle`.

r? ```@jyn514```

18 months agoRollup merge of #104121 - Lokathor:mir-opt-when-instruction-set-missing-on-callee...
Matthias Krüger [Sat, 26 Nov 2022 09:39:10 +0000 (10:39 +0100)]
Rollup merge of #104121 - Lokathor:mir-opt-when-instruction-set-missing-on-callee, r=tmiasko

Refine `instruction_set` MIR inline rules

Previously an exact match of the `instruction_set` attribute was required for an MIR inline to be considered. This change checks for an exact match *only* if the callee sets an `instruction_set` in the first place. When the callee does not declare an instruction set then it is considered to be platform agnostic code and it's allowed to be inline'd into the caller.

cc ``@oli-obk``

[Edit] Zulip Context: https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/What.20exactly.20does.20the.20MIR.20optimizer.20do.3F

18 months agoAuto merge of #103556 - clubby789:specialize-option-partial-eq, r=scottmcm
bors [Sat, 26 Nov 2022 08:56:20 +0000 (08:56 +0000)]
Auto merge of #103556 - clubby789:specialize-option-partial-eq, r=scottmcm

Manually implement PartialEq for Option<T> and specialize non-nullable types

This PR manually implements `PartialEq` and `StructuralPartialEq` for `Option`, which seems to produce slightly better codegen than the automatically derived implementation.

It also allows specializing on the `core::num::NonZero*` and `core::ptr::NonNull` types, taking advantage of the niche optimization by transmuting the `Option<T>` to `T` to be compared directly, which can be done in just two instructions.

A comparison of the original, new and specialized code generation is available [here](https://godbolt.org/z/dE4jxdYsa).

18 months agoAuto merge of #104730 - petrochenkov:modchild5, r=cjgillot
bors [Sat, 26 Nov 2022 05:41:34 +0000 (05:41 +0000)]
Auto merge of #104730 - petrochenkov:modchild5, r=cjgillot

rustc_metadata: Switch module children decoding to an iterator

Previously https://github.com/rust-lang/rust/pull/103578, https://github.com/rust-lang/rust/pull/103524 and previous PRs simplified it as much as possible.

A couple of cleanup commits is also added.
r? `@cjgillot`

18 months agoDo not record unresolved const vars in generator interior
Michael Goulet [Wed, 23 Nov 2022 19:38:22 +0000 (19:38 +0000)]
Do not record unresolved const vars in generator interior

18 months agoRemove unnecessary binder from get_impl_future_output_ty
Michael Goulet [Sat, 26 Nov 2022 00:46:09 +0000 (00:46 +0000)]
Remove unnecessary binder from get_impl_future_output_ty

18 months agorustdoc: use flexbox CSS to align sidebar button instead of position
Michael Howell [Sat, 26 Nov 2022 05:06:22 +0000 (22:06 -0700)]
rustdoc: use flexbox CSS to align sidebar button instead of position

This accomplishes the same thing with significantly less code.

18 months agoAuto merge of #104431 - alistair23:alistair/rv64-profiler, r=Mark-Simulacrum
bors [Sat, 26 Nov 2022 02:43:08 +0000 (02:43 +0000)]
Auto merge of #104431 - alistair23:alistair/rv64-profiler, r=Mark-Simulacrum

Enable profiler in dist-riscv64-linux

Build the profiler runtime to allow using -C profile-generate and -C instrument-coverage on riscv64-linux.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
18 months agojsondoclint: Accept trait alias is places where trait expected.
Nixon Enraght-Moony [Sat, 26 Nov 2022 01:40:08 +0000 (01:40 +0000)]
jsondoclint: Accept trait alias is places where trait expected.

Closes #104923

18 months agoAuto merge of #99798 - JulianKnodt:ac1, r=BoxyUwU
bors [Fri, 25 Nov 2022 22:56:59 +0000 (22:56 +0000)]
Auto merge of #99798 - JulianKnodt:ac1, r=BoxyUwU

Add `ConstKind::Expr`

Starting to implement `ty::ConstKind::Abstract`, most of the match cases are stubbed out, some I was unsure what to add, others I didn't want to add until a more complete implementation was ready.

r? `@lcnr`

18 months agoRefine instruction_set inline rules
Lokathor [Mon, 7 Nov 2022 19:07:07 +0000 (12:07 -0700)]
Refine instruction_set inline rules

Previously an exact match of the `instruction_set` attribute was required for an MIR inline to be considered. This change checks for an exact match *only* if the callee sets an `instruction_set` in the first place. When the callee does not declare an instruction set then it is considered to be platform agnostic code and it's allowed to be inline'd into the caller.

18 months agoRename normalize_opaque_types to reveal_opaque_types_in_bounds
Michael Goulet [Fri, 25 Nov 2022 19:30:37 +0000 (19:30 +0000)]
Rename normalize_opaque_types to reveal_opaque_types_in_bounds

18 months agoAuto merge of #104902 - matthiaskrgr:rollup-oo27a4u, r=matthiaskrgr
bors [Fri, 25 Nov 2022 19:09:30 +0000 (19:09 +0000)]
Auto merge of #104902 - matthiaskrgr:rollup-oo27a4u, r=matthiaskrgr

Rollup of 8 pull requests

Successful merges:

 - #104716 (move 2 candidates into builtin candidate)
 - #104760 (Clarify `SyntaxExtensionKind::LegacyDerive`.)
 - #104797 (rustc_codegen_ssa: write `.dwp` in a streaming fashion)
 - #104835 (Use infcx.partially_normalize_associated_types_in)
 - #104853 (Fix typo in miri sysroot)
 - #104879 (jsondoclint: Recognise Typedef as valid kind for Type::ResolvedPath)
 - #104887 (rustbuild: Don't build doc::SharedAssets when building JSON docs.)
 - #104896 (rustdoc: fix broken tooltip CSS)

Failed merges:

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

18 months agoDefine all clauses as dummy_with_span as the usages are all equivalent
Santiago Pastorino [Fri, 25 Nov 2022 18:36:15 +0000 (15:36 -0300)]
Define all clauses as dummy_with_span as the usages are all equivalent

18 months agoRemove AscribeUserTypeCx
Santiago Pastorino [Fri, 25 Nov 2022 18:07:19 +0000 (15:07 -0300)]
Remove AscribeUserTypeCx

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 agoRollup merge of #104896 - notriddle:notriddle/tooltip, r=GuillaumeGomez
Matthias Krüger [Fri, 25 Nov 2022 17:35:42 +0000 (18:35 +0100)]
Rollup merge of #104896 - notriddle:notriddle/tooltip, r=GuillaumeGomez

rustdoc: fix broken tooltip CSS

text `#ffffff` on background `#fdffd3` fails the [WCAG color contrast checker], and seems like a mistake in https://github.com/rust-lang/rust/commit/16b55903ee16503e7026677c169727d1907704c2.

Making the cursor a pointer is misleading, since clicking it doesn't do anything.

[WCAG color contrast checker]: https://accessibleweb.com/color-contrast-checker/

18 months agoRollup merge of #104887 - aDotInTheVoid:rustbuild-json-doc-shared-assets, r=jyn514
Matthias Krüger [Fri, 25 Nov 2022 17:35:42 +0000 (18:35 +0100)]
Rollup merge of #104887 - aDotInTheVoid:rustbuild-json-doc-shared-assets, r=jyn514

rustbuild: Don't build doc::SharedAssets when building JSON docs.

Previously, running `./x doc library/core/ --json` on a plain build would panic bootstrap.

```
$ ./x doc library/core/ --json
Building rustbuild
    Blocking waiting for file lock on package cache
   Compiling bootstrap v0.0.0 (/home/nixon/dev/rust/rust/src/bootstrap)
    Finished dev [unoptimized] target(s) in 4.47s
thread 'main' panicked at 'fs::write(&version_info, &info) failed with No such file or directory (os error 2) ("/home/nixon/dev/rust/rust/build/x86_64-unknown-linux-gnu/doc/version_info.html")', doc.rs:410:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Build completed unsuccessfully in 0:00:04
```

Becuase the `SharedAssets` step assumes that the HTML out dir has been created. This isn't true for JSON.

The fix is to not build shared assets when doing a JSON doc build, as it doesn't need them.

r? ``@jyn514``

``@rustbot`` modify labels: +A-rustdoc-json

18 months agoRollup merge of #104879 - aDotInTheVoid:jsondoclint-typedef, r=GuillaumeGomez
Matthias Krüger [Fri, 25 Nov 2022 17:35:42 +0000 (18:35 +0100)]
Rollup merge of #104879 - aDotInTheVoid:jsondoclint-typedef, r=GuillaumeGomez

jsondoclint: Recognise Typedef as valid kind for Type::ResolvedPath

Closes #104851

r? ``@GuillaumeGomez``

``@rustbot`` modify labels: +A-testsuite

18 months agoRollup merge of #104853 - jyn514:sysroot-typo, r=RalfJung
Matthias Krüger [Fri, 25 Nov 2022 17:35:41 +0000 (18:35 +0100)]
Rollup merge of #104853 - jyn514:sysroot-typo, r=RalfJung

Fix typo in miri sysroot

r? ``@RalfJung``

18 months agoRollup merge of #104835 - spastorino:use-partially_normalize_associated_types_in...
Matthias Krüger [Fri, 25 Nov 2022 17:35:41 +0000 (18:35 +0100)]
Rollup merge of #104835 - spastorino:use-partially_normalize_associated_types_in, r=lcnr

Use infcx.partially_normalize_associated_types_in

r? ``@lcnr``

18 months agoRollup merge of #104797 - weihanglo:stream-write-dwp, r=jackh726
Matthias Krüger [Fri, 25 Nov 2022 17:35:40 +0000 (18:35 +0100)]
Rollup merge of #104797 - weihanglo:stream-write-dwp, r=jackh726

rustc_codegen_ssa: write `.dwp` in a streaming fashion

When writing a `.dwp` file, rustc writes to a Vec first then to a BufWriter-wrapped file. It seems very likely that we can write in a streaming fashion to avoid double buffering in an intermediate Vec.

On my Linux machine, `.dwp` from the latest rust-lang/cargo is 113MiB. It may worth a stream writer, though I didn't do any benchmark 🙇🏾‍♂️.

18 months agoRollup merge of #104760 - nnethercote:rm-LegacyDerive, r=petrochenkov
Matthias Krüger [Fri, 25 Nov 2022 17:35:39 +0000 (18:35 +0100)]
Rollup merge of #104760 - nnethercote:rm-LegacyDerive, r=petrochenkov

Clarify `SyntaxExtensionKind::LegacyDerive`.

It's always treated the same as `SyntaxExtensionKind::Derive`.

18 months agoRollup merge of #104716 - lcnr:selection-candidate, r=jackh726
Matthias Krüger [Fri, 25 Nov 2022 17:35:39 +0000 (18:35 +0100)]
Rollup merge of #104716 - lcnr:selection-candidate, r=jackh726

move 2 candidates into builtin candidate

having separate candidates for these isn't too helpful i think

r? types

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.

18 months agorustdoc: remove no-op CSS `#help dt { display: block }`
Michael Howell [Fri, 25 Nov 2022 17:07:21 +0000 (10:07 -0700)]
rustdoc: remove no-op CSS `#help dt { display: block }`

`display: block` is the [default UA style] for dt.

[default UA style]: https://html.spec.whatwg.org/multipage/rendering.html#lists

18 months agorustdoc: revert tooltip background color on light theme to readable
Michael Howell [Fri, 25 Nov 2022 16:17:58 +0000 (09:17 -0700)]
rustdoc: revert tooltip background color on light theme to readable

text #fff on background #fdffd3 fails the [WCAG color contrast checker], and
seems like a mistake in 16b55903ee16503e7026677c169727d1907704c2.

[WCAG color contrast checker]: https://accessibleweb.com/color-contrast-checker/

18 months agorustdoc: remove `cursor: pointer` from unclickable tooltip
Michael Howell [Fri, 25 Nov 2022 16:16:27 +0000 (09:16 -0700)]
rustdoc: remove `cursor: pointer` from unclickable tooltip

It's misleading unless it gets changed to respond to being clicked.

18 months agoAuto merge of #104846 - spastorino:santa-clauses-make-goals-early-christmas-🎄, r...
bors [Fri, 25 Nov 2022 15:59:31 +0000 (15:59 +0000)]
Auto merge of #104846 - spastorino:santa-clauses-make-goals-early-christmas-🎄, r=oli-obk

Branch Clause from Predicate

r? `@oli-obk`

This is part of what's proposed in https://github.com/rust-lang/compiler-team/issues/531

18 months agoremove unused code
Tshepang Mbambo [Fri, 25 Nov 2022 14:28:18 +0000 (16:28 +0200)]
remove unused code

18 months agoremove obsolete comment
Tshepang Mbambo [Mon, 31 Oct 2022 02:23:46 +0000 (04:23 +0200)]
remove obsolete comment

18 months agorustbuild: Don't build doc::SharedAssets when building JSON docs.
Nixon Enraght-Moony [Fri, 25 Nov 2022 13:50:41 +0000 (13:50 +0000)]
rustbuild: Don't build doc::SharedAssets when building JSON docs.

18 months agoAuto merge of #104877 - matthiaskrgr:rollup-s7taiq8, r=matthiaskrgr
bors [Fri, 25 Nov 2022 13:01:45 +0000 (13:01 +0000)]
Auto merge of #104877 - matthiaskrgr:rollup-s7taiq8, r=matthiaskrgr

Rollup of 6 pull requests

Successful merges:

 - #103648 (Don't set `is_preview` for clippy and rustfmt)
 - #104654 (Add `#![deny(unsafe_op_in_unsafe_fn)]` in liballoc tests)
 - #104793 (unstable-book: Add page for the `abi_efiapi` feature)
 - #104841 (Assert that we don't capture escaping bound vars in `Fn` trait selection)
 - #104849 (Migrate source code elements style to CSS variables)
 - #104873 (RefCell::get_mut: fix typo)

Failed merges:

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

18 months ago[llvm-wrapper] adapt for LLVM API change
Krasimir Georgiev [Fri, 25 Nov 2022 11:29:00 +0000 (11:29 +0000)]
[llvm-wrapper] adapt for LLVM API change

Adapt for the LLVM API changes from
https://github.com/llvm/llvm-project/commit/721f975d3518403502f770ce11f3f02509b30c5b#diff-5a347903b8412ed1b1b1948c3fce47f9a6ff05dc70bfaeedb6d06b622e399d91.

18 months agoadd comment
lcnr [Wed, 23 Nov 2022 16:39:51 +0000 (17:39 +0100)]
add comment

18 months agomove 2 candidates into builtin candidate
lcnr [Tue, 22 Nov 2022 14:46:01 +0000 (15:46 +0100)]
move 2 candidates into builtin candidate

18 months agojsondoclint: Recognise Typedef as valid kind for Type::ResolvedPath
Nixon Enraght-Moony [Fri, 25 Nov 2022 10:53:14 +0000 (10:53 +0000)]
jsondoclint: Recognise Typedef as valid kind for Type::ResolvedPath

Closes #104851

18 months agoRollup merge of #104873 - RalfJung:therefore, r=Dylan-DPC
Matthias Krüger [Fri, 25 Nov 2022 09:44:40 +0000 (10:44 +0100)]
Rollup merge of #104873 - RalfJung:therefore, r=Dylan-DPC

RefCell::get_mut: fix typo

and fix the same typo in a bunch of other places

18 months agoRollup merge of #104849 - GuillaumeGomez:source-code-sidebar-css-migration, r=notriddle
Matthias Krüger [Fri, 25 Nov 2022 09:44:40 +0000 (10:44 +0100)]
Rollup merge of #104849 - GuillaumeGomez:source-code-sidebar-css-migration, r=notriddle

Migrate source code elements style to CSS variables

r? ``@notriddle``

18 months agoRollup merge of #104841 - compiler-errors:fishy-bound-var, r=jackh726
Matthias Krüger [Fri, 25 Nov 2022 09:44:39 +0000 (10:44 +0100)]
Rollup merge of #104841 - compiler-errors:fishy-bound-var, r=jackh726

Assert that we don't capture escaping bound vars in `Fn` trait selection

Fixes #104825

18 months agoRollup merge of #104793 - nicholasbishop:bishop-add-efiapi, r=JohnTitor
Matthias Krüger [Fri, 25 Nov 2022 09:44:39 +0000 (10:44 +0100)]
Rollup merge of #104793 - nicholasbishop:bishop-add-efiapi, r=JohnTitor

unstable-book: Add page for the `abi_efiapi` feature

Tracking issue for `abi_efiapi`: https://github.com/rust-lang/rust/issues/65815

18 months agoRollup merge of #104654 - thomcc:alloc-tests-unsafe_op_in_unsafe_fn, r=Mark-Simulacrum
Matthias Krüger [Fri, 25 Nov 2022 09:44:38 +0000 (10:44 +0100)]
Rollup merge of #104654 - thomcc:alloc-tests-unsafe_op_in_unsafe_fn, r=Mark-Simulacrum

Add `#![deny(unsafe_op_in_unsafe_fn)]` in liballoc tests

In https://github.com/rust-lang/rust/pull/104647#discussion_r1027332930 it was mentioned that liballoc tests should probably have this enabled (we have it pretty much everywhere else in the stdlib), so I added it.

This will probably conflict with https://github.com/rust-lang/rust/pull/104647 so I'll rebase after that lands.

18 months agoRollup merge of #103648 - jyn514:no-preview, r=Mark-Simulacrum
Matthias Krüger [Fri, 25 Nov 2022 09:44:37 +0000 (10:44 +0100)]
Rollup merge of #103648 - jyn514:no-preview, r=Mark-Simulacrum

Don't set `is_preview` for clippy and rustfmt

These have been shipped on stable for many years now and it would be very disruptive to ever remove them.
Remove the `-preview` suffix from their dist components.

Based on https://github.com/rust-lang/rust/pull/102565.

18 months agoAuto merge of #104650 - BlackHoleFox:stuck-with-xcode-13, r=Mark-Simulacrum
bors [Fri, 25 Nov 2022 09:44:16 +0000 (09:44 +0000)]
Auto merge of #104650 - BlackHoleFox:stuck-with-xcode-13, r=Mark-Simulacrum

Build macOS distribution artifacts with XCode 13

After all of the `rust-lang/rust` Apple runners started using macOS 12, the builds created by CI began to use XCode 14.0.1. Due to this (as far as we can tell), XCode's build tools started to ignore the `MACOSX_DEPLOYMENT_TARGET` being defined by us for the distributed builds that let both `rustc` and `libstd` work on older versions. The current idea is that since XCode 14's macOS SDK doesn't support deployment targets before 10.13, it uses some default of its own. You can see the difference between stable's and the most recent nighty's supported versions [here](https://github.com/rust-lang/rust/issues/104570#issuecomment-1321225907).

I wasn't able to confirm my SDK versioning hypothesis locally since I think there's something jammed with my XCode installation, but hopefully this should still fix it for releases.

Closes https://github.com/rust-lang/rust/issues/104570

r? `@Mark-Simulacrum`