Commit Graph

225036 Commits

Author SHA1 Message Date
Michael Goulet
eaf10dcb70 Normalize types in writeback results with new solver 2023-05-22 21:18:20 +00:00
Alex Gaynor
12fd46d691
Enable sanitizers and profiler for aarch64-unknown-linux-musl 2023-05-22 14:13:23 -07:00
León Orell Valerian Liehr
778abc7a00
properly pretty-print inherent projections 2023-05-22 22:39:45 +02:00
bors
8b4b20836b Auto merge of #111848 - Dylan-DPC:rollup-7jqydzg, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #111501 (MIR drive-by cleanups)
 - #111609 (Mark internal functions and traits unsafe to reflect preconditions)
 - #111612 (Give better error when collecting into `&[T]`)
 - #111756 (Rename `{drop,forget}_{copy,ref}` lints to more consistent naming)
 - #111843 (move lcnr to only review types stuff)
 - #111844 (Migrate GUI colors test to original CSS color format)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-05-22 20:33:51 +00:00
Dylan DPC
ec372a17e2
Rollup merge of #111844 - GuillaumeGomez:migrate-gui-test-color-4, r=notriddle
Migrate GUI colors test to original CSS color format

I updated the `browser-ui-test` version because I fixed https://github.com/GuillaumeGomez/browser-UI-test/issues/507. If inside a function, the colors were not considered, preventing the second commit of this PR.

Follow-up of https://github.com/rust-lang/rust/pull/111459.

r? `@notriddle`
2023-05-23 00:32:20 +05:30
Dylan DPC
d935d0d352
Rollup merge of #111843 - lcnr:rm-lcnr, r=Mark-Simulacrum
move lcnr to only review types stuff
2023-05-23 00:32:19 +05:30
Dylan DPC
71f78682be
Rollup merge of #111756 - Urgau:rename_drop_forget_copy_ref_lints, r=fee1-dead
Rename `{drop,forget}_{copy,ref}` lints to more consistent naming

This PR renames previous uplifted lints in https://github.com/rust-lang/rust/pull/109732 to more consistent naming.

I followed the renaming done [here](https://github.com/rust-lang/rust/issues/53224) and also advocated in this [clippy issue](https://github.com/rust-lang/rust-clippy/issues/2845):
   - `drop_copy` to `dropping_copy_types`
   - `forget_copy` to `forgetting_copy_types`
   - `drop_ref` to `dropping_references`
   - `forget_ref` to `forgetting_references`
2023-05-23 00:32:19 +05:30
Dylan DPC
df8b0dfc27
Rollup merge of #111612 - ChayimFriedman2:collect-into-slice-ref, r=petrochenkov
Give better error when collecting into `&[T]`

The detection of slice reference of `{integral}` in `rustc_on_unimplemented` is hacky, but a proper solution requires changing `FmtPrinter` to add a parameter to print integers as `{integral}` and I didn't want to change it just for `rustc_on_unimplemented`. I can do that if requested, though.

I'm open to better wording; this is the best I could come up with.
2023-05-23 00:32:18 +05:30
Dylan DPC
47fe1a3e1f
Rollup merge of #111609 - LegionMammal978:internal-unsafe, r=thomcc
Mark internal functions and traits unsafe to reflect preconditions

No semantics are changed in this PR; I only mark some functions and and a trait `unsafe` which already had implicit preconditions. Although it seems somewhat redundant for `numfmt::Part::Copy` to contain a `&[u8]` instead of a `&str`, given that all of its current consumers ultimately expect valid UTF-8. Is the type also intended to work for byte-slice formatting in the future?
2023-05-23 00:32:18 +05:30
Dylan DPC
df86200965
Rollup merge of #111501 - WaffleLapkin:drivebycleanupuwu, r=oli-obk
MIR drive-by cleanups

Some random drive-by cleanups I did while working with MIR/THIR.
2023-05-23 00:32:17 +05:30
Eric Huss
a2007ef15a Update reference 2023-05-22 11:00:43 -07:00
bors
cfcde247cd Auto merge of #111754 - lcnr:recursion-depth, r=matthewjasper
fix recursion depth handling after confirmation

fixes #111729

I think having to use `Obligation::with_depth` correctly everywhere is very hard because e.g. the nested obligations from `eq` currently do not have the correct obligation depth.

The new solver [completely removes `recursion_depth` from obligations](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/traits/solve/struct.Goal.html) and instead tracks the depth in the solver itself which is far easier to get right. Moving the old solver towards this shouldn't be that hard but is probably somewhat annoying.

r? `@matthewjasper`
2023-05-22 17:56:26 +00:00
Luca Palmieri
cd7688bd30 Verify that ItemEnum can be serialized and then deserialized using bincode 2023-05-22 18:26:20 +01:00
Luca Palmieri
a5e5101375 Serialize all enums as externally tagged to guarantee compatibility with binary formats such as bincode or postcard 2023-05-22 18:22:08 +01:00
rustbot
f098e160ab Update books 2023-05-22 13:00:33 -04:00
Vadim Petrochenkov
edf95b5d8c rustc_privacy: Reach underlying types of impl Traits in a separate pass
outside of fixed point iteration.
2023-05-22 19:59:38 +03:00
Vadim Petrochenkov
e41c422dff rustc_privacy: Merge three matches on ItemKind into one
and remove some more `Option`s as a result
2023-05-22 19:59:35 +03:00
Vadim Petrochenkov
d831141638 rustc_privacy: Remove some Options
in cases where they are guaranteed to be `Some`
2023-05-22 19:58:28 +03:00
Vadim Petrochenkov
e3b830d4da rustc_privacy: Migrate EmbargoVisitor to visit_all_item_likes_in_crate
Previously it had some logic requiring tree visiting, but it was moved to resolve last year.
2023-05-22 19:58:28 +03:00
Vadim Petrochenkov
4082053b00 rustdoc: Cleanup doc string collapsing 2023-05-22 19:35:35 +03:00
Guillaume Gomez
194960bae9 Migrate GUI colors test to original CSS color format 2023-05-22 17:34:48 +02:00
Guillaume Gomez
56b8b1c353 Update browser-ui-test to 0.16.4 2023-05-22 17:33:42 +02:00
bors
2fe47b966a Auto merge of #111634 - marc0246:arc-new-uninit-bloat, r=thomcc
Fix duplicate `arcinner_layout_for_value_layout` calls when using the uninit `Arc` constructors

What this fixes is the duplicate calls to `arcinner_layout_for_value_layout` seen here: https://godbolt.org/z/jr5Gxozhj

The issue was discovered alongside #111603 but is otherwise unrelated to the duplicate `alloca`s, which remain unsolved. Everything I tried to solve said main issue has failed.

As for the duplicate layout calculations, I also tried slapping `#[inline]` and `#[inline(always)]` on everything in sight but the only thing that worked in the end is to dedup the calls by hand.
2023-05-22 15:06:32 +00:00
lcnr
8294131ceb move lcnr to only review types stuff 2023-05-22 16:42:34 +02:00
Matthew Jasper
72d41f3bd3 Run AST validation on match guards correctly 2023-05-22 14:52:52 +01:00
Jamie Cunliffe
a059e68d11 Create a structure to define the features from to_llvm_features.
Rather than returning an array of features from to_llvm_features, return a structure that contains
the dependencies. This also contains metadata on how the features depend on each other to allow for
the correct enabling and disabling.
2023-05-22 14:46:40 +01:00
Jamie Cunliffe
d51db4275b Make v8a match optional in the test feature list. 2023-05-22 14:27:14 +01:00
Jamie Cunliffe
aab0757c66 Only disable folded features when it makes sense.
Some features that are tied together only make sense to be folded
together when enabling the feature. For example on AArch64 sve and
neon are tied together, however it doesn't make sense to disable neon
when disabling sve.
2023-05-22 14:27:14 +01:00
Jamie Cunliffe
4cca436e30 Tie neon with fp-armv8.
In #91608 the fp-armv8 feature was removed as it's tied to the neon
feature. However disabling neon didn't actually disable the use of
floating point registers and instructions, for this `-fp-armv8` is
required.
2023-05-22 14:27:14 +01:00
bors
03761a50a3 Auto merge of #111775 - compiler-errors:triple-check, r=Nilstrieb
Add extra debug assertions for equality for Adt/Variant/FieldDef

Would've made it easier to both catch and test https://github.com/rust-lang/rust/pull/111494. Maybe not worth it, since it does mean that the compiler is doing extra work when debug-assertions are enabled, but also that's what debug assertions are for :^)

This is a revival of #111523 because I think I pushed an empty branch and bors got a bit too excited it closed the PR.
2023-05-22 12:19:16 +00:00
bors
48ec50ae39 Auto merge of #111711 - Jules-Bertholet:document-pin-layout, r=thomcc
Document `Pin` memory layout

The fact that `Pin` is `#[repr(transparent)]` technically isn't documented anywhere currently. I don't see any reason why `Pin`'s layout would ever change, so this PR codifies it.

`@rustbot` label +T-libs-api -T-libs +A-docs +A-layout +A-pin
2023-05-22 09:35:51 +00:00
Lukas Markeffsky
b63cc5c307 rustdoc: add regression test for broken link due to double backticks 2023-05-22 11:35:25 +02:00
Lukas Markeffsky
cb2ba42a10 update pulldown-cmark to 0.9.3 2023-05-22 11:35:25 +02:00
bors
2d66e5a729 Auto merge of #111835 - matthiaskrgr:rollup-qd4b2vu, r=matthiaskrgr
Rollup of 2 pull requests

Successful merges:

 - #111810 (Don't use inner macro in `marker_impls`)
 - #111826 (Render test messages from bootstrap)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-05-22 06:38:20 +00:00
Matthias Krüger
e2362d7e1a
Rollup merge of #111826 - ehuss:bootstrap-test-render-message, r=clubby789
Render test messages from bootstrap

Bootstrap was not rendering messages from the test harness when a test failed. This can include messages like "test did not panic as expected". This fixes it by making sure those messages are printed on failure.

Fixes #111825
2023-05-22 06:54:17 +02:00
Matthias Krüger
b0415dbec7
Rollup merge of #111810 - compiler-errors:less-macro, r=thomcc
Don't use inner macro in `marker_impls`

Just recurse instead of having to define an inner macro to avoid the problem with expansion binders being misnumbered between the `$meta` and `$T` variables.

cc `@Veykril` this should fix rust-lang/rust-analyzer#14862 since we've gotten rid of the inner macro.
2023-05-22 06:54:16 +02:00
bors
7ca94f241f Auto merge of #111781 - the8472:filter-map-chunk, r=thomcc
optimize next_chunk impls for Filter and FilterMap

```
OLD:

benchmarks:
    iter::bench_next_chunk_filter_even                 104.00ns/iter  +/- 1.00ns
    iter::bench_next_chunk_filter_map_even             101.00ns/iter  +/- 1.00ns
    iter::bench_next_chunk_filter_map_mostly_false       1.99µs/iter +/- 10.00ns
    iter::bench_next_chunk_filter_map_predictably_true  56.00ns/iter  +/- 0.00ns
    iter::bench_next_chunk_filter_mostly_false           1.15µs/iter  +/- 6.00ns
    iter::bench_next_chunk_filter_predictably_true      65.00ns/iter  +/- 1.00ns

NEW:

benchmarks:
    iter::bench_next_chunk_filter_even                  42.00ns/iter  +/- 0.00ns
    iter::bench_next_chunk_filter_map_even              49.00ns/iter  +/- 1.00ns
    iter::bench_next_chunk_filter_map_mostly_false     501.00ns/iter  +/- 3.00ns
    iter::bench_next_chunk_filter_map_predictably_true  31.00ns/iter  +/- 0.00ns
    iter::bench_next_chunk_filter_mostly_false         534.00ns/iter +/- 13.00ns
    iter::bench_next_chunk_filter_predictably_true      28.00ns/iter  +/- 1.00ns
```
2023-05-22 03:37:20 +00:00
bors
3869b7b12d Auto merge of #111824 - lukas-code:strike, r=notriddle
rustdoc: include strikethrough in item summary

Fixes https://github.com/rust-lang/rust/issues/111822. Since **bold** and *italic* are included, I don't see why ~~strikethrough~~ shouldn't be.
2023-05-22 00:56:50 +00:00
Scott McMurray
d69725d5d5 Normalize block and local orders in mir-opt tests
Since this only affects `PreCodegen MIR, and it would be nice for that to be resilient to permutations of things that don't affect the actual semantic behaviours.
2023-05-21 17:48:37 -07:00
Scott McMurray
05bf42bfa9 PR feedback: better comments and debug asserts 2023-05-21 17:48:37 -07:00
Scott McMurray
977ac5b4dd MIR: opt-in normalization of BasicBlock and Local numbering 2023-05-21 17:48:36 -07:00
Scott McMurray
57c5ac7894 Tweak the post-order for multi-successor blocks 2023-05-21 17:48:36 -07:00
bors
2440ccabc8 Auto merge of #111808 - Zoxc:query-structs-trim, r=cjgillot
Replace `QueryStruct` with arrays local to `rustc_query_impl`

This removes `QueryStruct` and instead uses constant arrays of function pointers for `try_collect_active_jobs`, `alloc_self_profile_query_strings` and `encode_query_results`. This further decouples `rustc_query_impl` from `rustc_middle`.

r? `@cjgillot`
2023-05-21 22:18:01 +00:00
bors
9d871b0617 Auto merge of #111731 - MU001999:fix/issue-111727, r=cjgillot
Keep only the trait when emitting the error for `MyTrait + 'a`

Fixes #111727
2023-05-21 19:19:49 +00:00
Eric Huss
59dff762bc Render test messages from bootstrap 2023-05-21 10:25:03 -07:00
bors
aee196fb14 Auto merge of #2899 - saethlin:measureme-cleanup, r=RalfJung
Try to ensure measureme output is valid when the interpreter is interrupted

Dropping our `measureme::Profiler` will have the profiler flush its output buffer and write out its string table. If the profiler's `Drop` impl does not run, the output file is not usable.

This approach has zero runtime overhead.
2023-05-21 17:10:02 +00:00
Ben Kimock
56eb08735b Use a signal handler to observe ctrl+c and cleanly drop the measureme profiler 2023-05-21 13:09:15 -04:00
Lukas Markeffsky
f4ce0458e9 rustdoc: include strikethrough in item summary 2023-05-21 18:00:11 +02:00
Erik Desjardins
340827af9b drop_in_place docs: remove pseudocode-ish implementation details 2023-05-21 11:34:01 -04:00
bors
965cf5c1f5 Auto merge of #111820 - matthiaskrgr:rollup-9sb2lw9, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #111745 (Fix overflow in error emitter)
 - #111770 (Read beta version from the version file if building from a source tarball)
 - #111797 (Migrate GUI colors test to original CSS color format)
 - #111809 (Unset MIRI_BLESS for mir-opt-level 4 miri tests)
 - #111817 (Migrate GUI colors test to original CSS color format)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-05-21 14:14:29 +00:00