Commit Graph

224737 Commits

Author SHA1 Message Date
Erik Desjardins
fb7f1d220c drop-in-place-noalias test: needs -O to ensure attributes are added on nopt builders 2023-05-22 20:20:45 -04:00
Michael Howell
24913bd768 rustdoc: remove unneeded position: relative setting CSS
This was added to control percentage sizes, in
79956b96e8

Now, the only percentage size is [`border-radius`], which is
based on the size of the box itself, not its containing block.
This leaves the property unused.

[`border-radius`]: https://developer.mozilla.org/en-US/docs/Web/CSS/border-radius
2023-05-22 16:46:29 -07:00
Michael Howell
5570fdae88 rustdoc: merge identical CSS rules 2023-05-22 16:40:01 -07:00
Michael Goulet
0307db4a59 Check opaques for mismatch during writeback 2023-05-22 23:33:34 +00:00
Michael Goulet
4cfafb275e Structurally normalize in the new solver 2023-05-22 21:18:20 +00:00
Michael Goulet
eaf10dcb70 Normalize types in writeback results with new solver 2023-05-22 21:18:20 +00: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
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
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
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
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
Matthias Krüger
7358166882
Rollup merge of #111817 - GuillaumeGomez:migrate-gui-test-color-3, r=notriddle
Migrate GUI colors test to original CSS color format

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

r? `@notriddle`
2023-05-21 16:03:01 +02:00
Matthias Krüger
b4752cfbc7
Rollup merge of #111809 - DrMeepster:patch-1, r=jyn514
Unset MIRI_BLESS for mir-opt-level 4 miri tests

When running `x.py test src/tools/miri --bless`, the 2nd test run (with mir-opt-level 4) crashes because it disables ui checking, which is incompatible with blessing. This PR fixes that by not trying to bless that run.
2023-05-21 16:03:01 +02:00
Matthias Krüger
0afa79b53d
Rollup merge of #111797 - GuillaumeGomez:migrate-gui-test-color-2, r=notriddle
Migrate GUI colors test to original CSS color format

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

r? ``@notriddle``
2023-05-21 16:03:00 +02:00
Matthias Krüger
6ccc3de998
Rollup merge of #111770 - liushuyu:ubuntu/beta-rev-no-git, r=ozkanonur
Read beta version from the version file if building from a source tarball

This pull request changes the `bootstrap` behaviour so that when building `rustc` from a source tarball, the beta revision number is correctly read from the `version` file instead of erroring out by invoking `git`.

The `version` file is observed to only exist in the official source tarball and has the following format:

```
1.70.0-beta.4 (2013813b6 2023-05-07)
```
2023-05-21 16:03:00 +02:00
Matthias Krüger
cb5dd1d598
Rollup merge of #111745 - Badel2:emitter-add-overflow, r=compiler-errors
Fix overflow in error emitter

Fix #109854
Close #94171 (was already fixed before but missing test)

This bug happens when a multipart suggestion spans more than one line.

The fix is to update the `acc` variable, which didn't handle the case when the text to remove spans multiple lines but the text to add spans only one line.

Also, use `usize::try_from` instead of  `as usize` to detect overflows earlier in the future, and point to the source of the overflow (the original issue points to a different place where this value is used, not where the overflow had happened).

And finally add an `if start != end` check to avoid doing any extra work in case of empty ranges.

Long explanation:

Given this test case:

```rust
fn generate_setter() {
    String::with_capacity(
    //~^ ERROR this function takes 1 argument but 3 arguments were supplied
    generate_setter,
    r#"
pub(crate) struct Person<T: Clone> {}
"#,
     r#""#,
    );
}
```

The compiler will try to convert that code into the following:

```rust
fn generate_setter() {
    String::with_capacity(
    //~^ ERROR this function takes 1 argument but 3 arguments were supplied
    /* usize */,
    );
}
```

So it creates a suggestion with 3 separate parts:

```
// Replace "generate_setter" with "/* usize */"
SubstitutionPart { span: fuzz_input.rs:4:5: 4:20 (#0), snippet: "/* usize */" }
// Remove second arg (multiline string)
SubstitutionPart { span: fuzz_input.rs:4:20: 7:3 (#0), snippet: "" }
// Remove third arg (r#""#)
SubstitutionPart { span: fuzz_input.rs:7:3: 8:11 (#0), snippet: "" }
```

Each of this parts gets a separate `SubstitutionHighlight` (this marks the relevant text green in a terminal, the values are 0-indexed so `start: 4` means column 5):

```
SubstitutionHighlight { start: 4, end: 15 }
SubstitutionHighlight { start: 15, end: 15 }
SubstitutionHighlight { start: 18446744073709551614, end: 18446744073709551614 }
```

The 2nd and 3rd suggestion are empty (start = end) because they only remove text, so there are no additions to highlight. But the 3rd span has overflowed because the compiler assumes that the 3rd suggestion is on the same line as the first suggestion. The 2nd span starts at column 20 and the highlight starts at column 16 (15+1), so that suggestion is good. But since the 3rd span starts at column 3, the result is `3 - 4`, or column -1, which turns into -2 with 0-indexed, and that's equivalent to `18446744073709551614 as isize`.

With this fix, the resulting `SubstitutionHighlight` are:

```
SubstitutionHighlight { start: 4, end: 15 }
SubstitutionHighlight { start: 15, end: 15 }
SubstitutionHighlight { start: 15, end: 15 }
```

As expected. I guess ideally we shouldn't emit empty highlights when removing text, but I am too scared to change that.
2023-05-21 16:02:59 +02:00
Urgau
6b08a745a4 Rename forget_ref lint to forgetting_references 2023-05-21 14:28:09 +02:00
Marcin S
a4d6d9a24f
doc: Update exploit-mitigations.md, update image3.png 2023-05-21 08:22:03 -04:00
Urgau
c93d9c1794 Rename drop_ref lint to dropping_references 2023-05-21 14:16:41 +02:00