Commit Graph

211661 Commits

Author SHA1 Message Date
Jubilee Young
47ddca6812 Attempt to solve problem with globs 2022-11-26 20:07:07 -08:00
Jubilee Young
353cef9654 Use target exe_suffix for doctests
This will use rust_out.exe for doctests on Windows,
rust_out.wasm for doctests in the wasm case, and
also handles cross-compiling or user-provided targets.
2022-11-26 20:06:13 -08:00
Weihang Lo
1e5dad0bef
Update cargo
5 commits in ba607b23db8398723d659249d9abf5536bc322e5..e027c4b5d25af2119b1956fac42863b9b3242744
2022-11-22 20:52:39 +0000 to 2022-11-25 19:44:46 +0000
- fix: Move off atty to resolve soundness issue (rust-lang/cargo#11420)
- add newline char to `cargo install .` error message for easier reading. (rust-lang/cargo#11401)
- chore: Upgrade to env_logger (rust-lang/cargo#11417)
- Change rustdoc-scrape-examples to be a target-level configuration (rust-lang/cargo#10343)
- temporarily disable test `lto::test_profile` (rust-lang/cargo#11419)
2022-11-27 03:02:08 +00:00
Jakob Degen
245c60749a 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.
2022-11-26 18:04:54 -08:00
bors
faf1891deb 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:
341d8b8a2c/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:
341d8b8a2c/library/alloc/src/vec/mod.rs (L2494-L2502)

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

r? `@ghost`
2022-11-27 00:58:50 +00:00
Eric Huss
be18880745 Assign myself for docs updates
This sets myself as the reviewer for docs submodule updates.
Now with https://github.com/rust-lang/triagebot/pull/1673 automating
the process, this piece of the puzzle handles the assignment step.
2022-11-26 15:24:01 -08:00
Ralf Jung
edf8154695 nits 2022-11-27 00:06:00 +01:00
Ralf Jung
a3bd57823f make Stacked Borrows retags act like data races 2022-11-27 00:03:49 +01:00
Ralf Jung
a7f72218c8 slightly adjust and synchronize Machine passing for SB and DataRace 2022-11-27 00:03:49 +01:00
Ralf Jung
f479404b12 !Unpin retags must still be reads, to check dereferenceable
also fix ICE on deallocation error and avoid redundant find_granting on retag
2022-11-27 00:03:07 +01:00
Michael Goulet
4149923ff0 Revert "Do not need to account for overflow in predicate_can_apply"
This reverts commit cbe9328018.
2022-11-26 22:15:51 +00:00
Michael Goulet
c285218f43 Revert "Drive-by: Don't manually call evaluate_obligation_no_overflow"
This reverts commit a884a9e634.
2022-11-26 22:15:43 +00:00
Markus Everling
acf95adfe2 Add second test case in make_contiguous_head_to_end 2022-11-26 23:08:57 +01:00
Michael Goulet
69a07f796c Revert "Add fatal overflow test"
This reverts commit 9decfff6f8.
2022-11-26 21:57:04 +00:00
Markus Everling
451259811a Improve slow path in make_contiguous 2022-11-26 22:55:39 +01:00
bors
c0e9c86b3f Auto merge of #104950 - jyn514:revert-preview, r=Mark-Simulacrum
Revert "Don't set `is_preview` for clippy and rustfmt"

This reverts commit fb3e724d76, 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
2022-11-26 21:47:17 +00:00
Guillaume Gomez
b19e034745 Switch rustdoc-gui test to function call 2022-11-26 22:35:05 +01:00
Michael Howell
c26074afde rustdoc: pass "true" to reset focus for notable traits 2022-11-26 14:32:57 -07:00
Joshua Nelson
c80b484eff Revert "Don't set is_preview for clippy and rustfmt"
This reverts commit fb3e724d76, which broke `rustup update` for anyone with clippy or rustfmt installed.
2022-11-26 15:24:46 -05:00
Arpad Borsos
c96d888bdf
Pretty-print generators with their generator_kind
After removing `GenFuture`, I special-cased async generators to pretty-print as `impl Future<Output = X>` mainly to avoid too much diagnostics changes originally.

This now reverses that change so that async fn/blocks are pretty-printed as `[$movability `async` $something@$source-position]` in various diagnostics, and updates the tests that this touches.
2022-11-26 20:42:50 +01:00
bors
80a96467ec 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
2022-11-26 17:58:12 +00:00
Camille GILLOT
b22418eac3 Verify that HIR parenting and Def parenting match. 2022-11-26 17:28:59 +00:00
Michael Howell
74de78a414 rustdoc: improve popover focus handling JS
This commit fixes a few inconsistencies and erratic behavior from the
notable traits, settings, and sidebar popups:

* It makes it so that pressing Escape closes the mobile sidebar.
  This is a bit difficult to do on iPhone, but on other setups like
  desktop tiling window managers, it's easy and makes sense.
* It makes sure that pressing escape while a notable trait popover is
  open focuses the popover's toggle button, instead of leaving nothing
  focused, since that makes more sense with keyboard navigation. Clicking
  the settings, help, or sidebar buttons, however, will not focus the
  notable trait popover toggle button.
* It ensures that notable trait and settings popovers are exclusive
  with the mobile sidebar. Nothing should ever overlap a popover, and
  there should never be more than one popover open at once.
2022-11-26 10:19:22 -07:00
Guillaume Gomez
95e63560a0
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
2022-11-26 17:47:26 +01:00
Guillaume Gomez
d99201c381
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
2022-11-26 17:47:25 +01:00
Guillaume Gomez
c4f8546fbc
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
2022-11-26 17:47:25 +01:00
Guillaume Gomez
4019c8aaf7
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.
2022-11-26 17:47:24 +01:00
Guillaume Gomez
75352dddf3
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.
2022-11-26 17:47:24 +01:00
Guillaume Gomez
e6c83d9e42
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
2022-11-26 17:47:23 +01:00
Guillaume Gomez
a2e485c25c
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`
2022-11-26 17:47:23 +01:00
Nixon Enraght-Moony
09818a8cca Add a test that makes sense 2022-11-26 16:24:43 +00:00
Lukas Markeffsky
946d51e8ba fix broken link fragment 2022-11-26 16:56:29 +01:00
Nixon Enraght-Moony
4b2a1eb775 Support unit tests for jsondoclint 2022-11-26 15:32:49 +00:00
bors
144b4859ad 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.`
2022-11-26 15:15:22 +00:00
Ralf Jung
3158a8d476 support no_std on Windows 2022-11-26 16:14:58 +01:00
Ralf Jung
245857beb7 refactor try_resolve_did and also support resolving crates/modules 2022-11-26 16:14:58 +01:00
Lukas Markeffsky
e06b61c8f9 explain how to get the discriminant out of a #[repr(T)] enum 2022-11-26 16:14:03 +01:00
Nixon Enraght-Moony
ed0f097e4d jsondoclint: Handle using enum variants and glob using enums.
Closes #104942
2022-11-26 15:08:40 +00:00
bors
c3a1c023c0 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
2022-11-26 14:59:30 +00:00
DrMeepster
0822c311fb add namespace to resolve_path 2022-11-26 15:58:02 +01:00
bors
b3e44029cf Auto merge of #2695 - RalfJung:ci-pretty, r=RalfJung
prettify our CI logs
2022-11-26 13:53:27 +00:00
Ralf Jung
56a1d07cb7 prettify our CI logs 2022-11-26 14:53:10 +01:00
bors
4d3e565004 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.
2022-11-26 13:24:26 +00:00
Ralf Jung
166e60e2bb update lockfile 2022-11-26 14:16:45 +01:00
bors
7d0db1efdb 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)
2022-11-26 13:02:15 +00:00
Ralf Jung
726b9d09d4 caller_span only makes sense when there are 2 frames on the stack 2022-11-26 14:01:26 +01:00
bors
579c993b35 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
2022-11-26 12:11:32 +00:00
Chris Denton
2ab3f76442
Remove more redundant alls 2022-11-26 09:54:54 +00:00
Camille GILLOT
89afda7811 Ignore bivariant parameters in test_type_match. 2022-11-26 09:50:01 +00:00
Matthias Krüger
1fe18a5dad
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.
2022-11-26 10:39:12 +01:00