Commit Graph

211619 Commits

Author SHA1 Message Date
bors
df04d28163 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
2022-11-27 10:35:00 +00:00
nils
958d5918b0 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.
2022-11-27 10:25:32 +01:00
Maybe Waffle
5ba0056346 Use TyCtxt::is_fn_trait is a couple more places 2022-11-27 07:20:28 +00:00
Maybe Waffle
ea447924ce micro doc fixes 2022-11-27 07:19:30 +00:00
Maybe Waffle
fa89f53352 Simplify ty::ClosureKind::extends
This is valid per the comment of the `ClosureKind` defition
2022-11-27 07:19:30 +00:00
Maybe Waffle
4b6e1d1c5f Add TyCtxt::is_fn_trait 2022-11-27 07:19:29 +00:00
Maybe Waffle
d0c7ed3bea Remove ty::ClosureKind::from_def_id
…in favour of `TyCtxt::fn_trait_kind_from_def_id`
2022-11-27 07:18:36 +00:00
Maybe Waffle
881862ecb7 Rename fn_trait_kind_from_{from_lang=>def_id} to better convey meaning 2022-11-27 07:14:49 +00:00
bors
5ac7e08aaf Auto merge of #103786 - tshepang:obsolete, r=jyn514
Don't build `compiler_builtins` with `-C panic=abort`
2022-11-27 07:12:30 +00:00
bors
0e9eee6811 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
2022-11-27 04:09:53 +00:00
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