Commit Graph

229001 Commits

Author SHA1 Message Date
Matthias Krüger
205ae163e7
Rollup merge of #113493 - the8472:spec-iocopy-slice, r=Mark-Simulacrum
additional io::copy specializations

- copying from `&[u8]` and `VecDeque<u8>`
- copying to `Vec<u8>`

A user on reddit [mentioned they saw a performance drop](https://www.reddit.com/r/rust/comments/14shv9f/comment/jr0bg6j/?context=3) when copying from a slice.
2023-07-09 16:33:37 +02:00
Matthias Krüger
ec479bae7f
Rollup merge of #113469 - JohnTitor:rm-default-free-fn, r=Amanieu
Remove `default_free_fn` feature

Closes #73014
r? ``@Amanieu``
2023-07-09 16:33:37 +02:00
Matthias Krüger
a46589f76b
Rollup merge of #113273 - hi-rustin:rustin-patch-opt-level, r=Kobzol
Use String or Int to set the opt level

Address https://github.com/rust-lang/rust/pull/112756/files#r1249345725

Use String or Int to set the opt level.

r? ``@jyn514``
2023-07-09 16:33:36 +02:00
Matthias Krüger
6a20f681d5
Rollup merge of #113247 - mirkootter:test-wasm-exceptions-nostd, r=Mark-Simulacrum
Add Tests for native wasm exceptions

### Motivation
In PR #111322, I added support for native WASM exceptions. I was asked by ``@davidtwco`` to add some tests for it in a follow up PR, which seems like a very good idea.

This PR adds three tests for this feature:
* codegen: ensure the correct LLVM instructions are used
* assembly: ensure the correct WASM instructions are used
* run-make: ensure the exception handling works; the WASM code is run using a small nodejs script which demonstrates the exception handling

### Complications
There are a few changes beside adding the tests, which were necessary
* Tests for the wasm32-unknown-unknown target are (as far as I know) only run on `test-various`. Its docker image uses nodejs-15, which is very old. Experimental support for wasm-exceptions was added in nodejs16. In nodejs 18.12 (LTS), they are stable.
  - --> increase nodejs to 18.12 in `test-various`
* codegen/assembly tests are not performed for the wasm32-unknown-unknown target yet
  - --> add those to `test-various` as well

Due to the last point, some tests are run which have not run before (assembly+codegen tests for wasm32-unknown-unknown). I added `// ignore wasm32-bare` for those which failed

### Local testing
I run all tests locally using both `test-various` and `wasm32`. As far as I know, none of the other systems run any test for wasm32 targets.
2023-07-09 16:33:36 +02:00
Matthias Krüger
4406a92cd1
Rollup merge of #111618 - cjgillot:name-return-place, r=tmiasko
Always name the return place.

MIR opts more and more consider `_0` as just another local, so there is no point in keeping the special case in debug-info logic.
2023-07-09 16:33:35 +02:00
bors
ba37a69d30 Auto merge of #113306 - tgross35:debuginfo-better-output, r=Mark-Simulacrum
Update debuginfo test runner to provide more useful output

This change makes debuginfo tests more user friendly. Changes:

 -   Print all lines that fail to match the patterns instead of just the first
 -   Provide better error messages that also say what did match
 -   Strip leading whitespace from directives so they are not skipped if indented
 -   Improve documentation and improve nesting on some related items

 As an example, given the following intentional fail (and a few not shown):

 ```rust
 // from tests/debuginfo/rc_arc.rs

 // cdb-command:dx rc,d
 // cdb-check:rc,d             : 111 [Type: alloc::rc::Rc<i32>]
 // cdb-check:    [Reference count] : 11 [Type: core::cell FAIL::Cell<usize>]
 // cdb-check:    [Weak reference count] : 2 [Type: core::cell FAIL::Cell<usize>]
 ```

 The current output (tested in #113313) will show:

 ```
 2023-07-04T08:10:00.1939267Z ---- [debuginfo-cdb] tests\debuginfo\rc_arc.rs stdout ----
 2023-07-04T08:10:00.1942182Z
 2023-07-04T08:10:00.1957463Z error: line not found in debugger output:     [Reference count] : 11 [Type: core:: cell FAIL::Cell<usize>]
 2023-07-04T08:10:00.1958272Z status: exit code: 0
 ```

With this chane, you are able to see all failures in that check group, as well as what parts were successful. The output is now:

 ```
2023-07-04T09:45:57.2514224Z error: check directive(s) from `C:\a\rust\rust\tests\debuginfo\rc_arc.rs` not found in debugger output. errors:
2023-07-04T09:45:57.2514631Z     (rc_arc.rs:31) `    [Reference count] : 11 [Type: core::cell FAIL::Cell<usize>]`
2023-07-04T09:45:57.2514908Z     (rc_arc.rs:32) `    [Weak reference count] : 2 [Type: core::cell FAIL::Cell<usize>]`
2023-07-04T09:45:57.2515181Z     (rc_arc.rs:41) `    [Reference count] : 21 [Type: core::sync::atomic FAIL::AtomicUsize]`
2023-07-04T09:45:57.2515452Z     (rc_arc.rs:50) `dyn_rc,d         [Type: alloc::rc::Rc<dyn$<core::fmt FAIL::Debug> >]`
2023-07-04T09:45:57.2515695Z the following subset of check directive(s) was found successfully::
2023-07-04T09:45:57.2516080Z     (rc_arc.rs:30) `rc,d             : 111 [Type: alloc::rc::Rc<i32>]`
2023-07-04T09:45:57.2516312Z     (rc_arc.rs:35) `weak_rc,d        : 111 [Type: alloc::rc::Weak<i32>]`
2023-07-04T09:45:57.2516555Z     (rc_arc.rs:36) `    [Reference count] : 11 [Type: core::cell::Cell<usize>]`
2023-07-04T09:45:57.2516881Z     (rc_arc.rs:37) `    [Weak reference count] : 2 [Type: core::cell::Cell<usize>]`
...
 ```

 Which makes it easier to see what did and didn't succeed without manual comparison against the source test file.
2023-07-09 10:38:10 +00:00
bors
1861088f90 Auto merge of #112235 - Kobzol:opt-dist, r=Mark-Simulacrum
Port PGO/LTO/BOLT optimized build pipeline to Rust

This PR ports the `stage-build.py` PGO/LTO/BOLT optimization script from Python to Rust, to make it easier to use dependencies, and make it a bit more robust. The PR switches both the Linux and Windows dist runners to the Rust script and removes the old Python script.

Funnily enough, the Rust port has less lines of code than the Python script :) I think that clearly shows that the Python script really lacked dependencies.
2023-07-09 08:11:57 +00:00
Jakub Beránek
91d2fb2e2b
Port PGO/LTO/BOLT optimized build pipeline to Rust 2023-07-09 08:39:50 +02:00
hi-rustin
92b5d0c4cb Use String or Int to set the opt level
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-07-09 13:53:26 +08:00
bors
f05d743c20 Auto merge of #113276 - Nilstrieb:rustix, r=Mark-Simulacrum
Update rustix

The issue has been fixed.
https://github.com/bytecodealliance/rustix/issues/716
2023-07-09 05:50:31 +00:00
bors
03247fbbe8 Auto merge of #113485 - Mark-Simulacrum:bump-version, r=Mark-Simulacrum
Bump version to 1.73

r? `@Mark-Simulacrum`
2023-07-09 01:55:53 +00:00
The 8472
6f8ba511fa additional io::copy specializations
- copying from `&[u8]` and `VecDeque<u8>`
- copying to `Vec<u8>`
2023-07-09 00:05:56 +02:00
bors
83964c156d Auto merge of #113491 - matthiaskrgr:rollup-mueqz7h, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #113005 (Don't call `query_normalize` when reporting similar impls)
 - #113064 (std: edit [T]::swap docs)
 - #113138 (Add release notes for 1.71.0)
 - #113217 (resolve typerelative ctors to adt)
 - #113254 (Use consistent formatting in Readme)
 - #113482 (Migrate GUI colors test to original CSS color format)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-07-08 20:56:57 +00:00
Matthias Krüger
de9b9c833b
Rollup merge of #113482 - GuillaumeGomez:migrate-gui-test-color-20, 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-07-08 20:53:30 +02:00
Matthias Krüger
dd8322876e
Rollup merge of #113254 - atouchet:rd3, r=Mark-Simulacrum
Use consistent formatting in Readme
2023-07-08 20:53:30 +02:00
Matthias Krüger
b637be7a17
Rollup merge of #113217 - ericmarkmartin:lower-type-relative-ctor-to-adt, r=cjgillot
resolve typerelative ctors to adt

Associated issue: #110508

r? ``@spastorino``
2023-07-08 20:53:29 +02:00
Matthias Krüger
14aeef369c
Rollup merge of #113138 - cuviper:relnotes-1.71.0, r=Mark-Simulacrum
Add release notes for 1.71.0

r? ``@Mark-Simulacrum``
cc ``@rust-lang/release``
2023-07-08 20:53:28 +02:00
Matthias Krüger
8c562996dd
Rollup merge of #113064 - marcospb19:add-note-in-vec-swap-docs, r=Mark-Simulacrum
std: edit [T]::swap docs

Add a note about what happens when index arguments are equal.
2023-07-08 20:53:27 +02:00
Matthias Krüger
48a0d038fa
Rollup merge of #113005 - compiler-errors:dont-query-normalize, r=cjgillot
Don't call `query_normalize` when reporting similar impls

Firstly, It's sketchy to be using `query_normalize` at all during HIR typeck -- it's asking for an ICE 😅. Secondly, we're normalizing an impl trait ref that potentially has parameter types in `ty::ParamEnv::empty()`, which is kinda sketchy as well.

The only UI test change from removing this normalization is that we don't evaluate anonymous constants in impls, which end up giving us really ugly suggestions:

```
error[E0277]: the trait bound `[X; 35]: Default` is not satisfied
 --> /home/gh-compiler-errors/test.rs:4:5
  |
4 |     <[X; 35] as Default>::default();
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Default` is not implemented for `[X; 35]`
  |
  = help: the following other types implement trait `Default`:
            &[T]
            &mut [T]
            [T; 32]
            [T; core::::array::{impl#30}::{constant#0}]
            [T; core::::array::{impl#31}::{constant#0}]
            [T; core::::array::{impl#32}::{constant#0}]
            [T; core::::array::{impl#33}::{constant#0}]
            [T; core::::array::{impl#34}::{constant#0}]
          and 27 others
```

So just fold the impls with a `BottomUpFolder` that calls `ty::Const::eval`. This doesn't work totally correctly with generic-const-exprs, but it's fine for stable code, and this is error reporting after all.
2023-07-08 20:53:27 +02:00
bors
d1389b9b48 Auto merge of #113484 - matthiaskrgr:rollup-goq2u0d, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #112931 (Enable zlib in LLVM on aarch64-apple-darwin)
 - #113158 (tests: unset `RUSTC_LOG_COLOR` in a test)
 - #113173 (CI: include workflow name in concurrency group)
 - #113335 (Reveal opaques in new solver)
 - #113390 (CGU formation tweaks)
 - #113399 (Structurally normalize again for byte string lit pat checking)
 - #113412 (Add basic types to SMIR)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-07-08 18:36:58 +00:00
bors
4353b1ecd6 Auto merge of #113450 - Nilstrieb:src/bootstrap/test.rs, r=flip1995
Fail the build if clippy tests don't pass

This was removed in
de69d556eb (diff-8479eab02701e686aedb15b567dc8fc31220c6e4efb9565ccc9d662b7fee2214) which caused CI to ignore clippy failures. This adds back the exit, which should cause CI to fail again if a test is broken (like right now, as clippy tests are broken on master).

Also see https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/CI.20doesn't.20care.20about.20clippy.20test.20failures.20but.20only.20sometime

r? flip1995
2023-07-08 16:12:28 +00:00
Nilstrieb
d8c29b82c9 Delete to_string_in_format_args_incremental.rs
It fails CI and passes locally. It passes random directores in
`-Cincremental` so maybe something's up. It shouldn't block us here.
2023-07-08 17:17:40 +02:00
Nilstrieb
c80333edfb Fail the build if clippy tests don't pass
This was removed in
de69d556eb (diff-8479eab02701e686aedb15b567dc8fc31220c6e4efb9565ccc9d662b7fee2214)
which caused CI to ignore clippy failures. This adds back the exit,
which should cause CI to fail again if a test is broken (like right
now, as clippy tests are broken on master).
2023-07-08 16:46:42 +02:00
Mark Rousskov
8a08a2954e Bump version 2023-07-08 10:35:49 -04:00
Matthias Krüger
39f558f8cf
Rollup merge of #113412 - spastorino:smir-types-1, r=oli-obk
Add basic types to SMIR

Still incomplete but I think this can be merged and we can keep iterating over it.

r? ``@oli-obk``
2023-07-08 15:49:47 +02:00
Matthias Krüger
8dc9461c91
Rollup merge of #113399 - compiler-errors:next-solver-byte-pat-again, r=oli-obk
Structurally normalize again for byte string lit pat checking

We need to structurally normalize the pointee of a match scrutinee when trying to match byte string patterns -- we used[^1] to call `structurally_resolve_type`, which errors for type vars[^2], but lcnr added `try_structurally_resolve_type`[^3] in the mean time, which is the right thing to use here since it's totally opportunistic.

Fixes rust-lang/trait-system-refactor-initiative#38

[^1]: #112428
[^2]: #112993
[^3]: #113086
2023-07-08 15:49:47 +02:00
Matthias Krüger
d5b1ef98b0
Rollup merge of #113390 - nnethercote:cgu-tweaks, r=wesleywiser
CGU formation tweaks

Minor improvements I found while trying out something bigger that didn't work out.

r? ``@wesleywiser``
2023-07-08 15:49:46 +02:00
Matthias Krüger
f3f1b0394d
Rollup merge of #113335 - compiler-errors:reveal-opaques-in-new-solver, r=lcnr
Reveal opaques in new solver

We were testing against the wrong reveal mode 😨

Also a couple of misc commits that I don't want to really put in separate prs

r? ``@lcnr``
2023-07-08 15:49:46 +02:00
Matthias Krüger
e0b290f1a8
Rollup merge of #113173 - Kobzol:ci-concurrency-group-workflow, r=pietroalbini
CI: include workflow name in concurrency group

Currently, this won't change anything, because we only have one relevant workflow (`CI`), but for future proofing we should probably include the workflow name in the concurrency group.

Found by ``@klensy`` [here](https://github.com/rust-lang/rust/pull/113059#discussion_r1247213606).
2023-07-08 15:49:45 +02:00
Matthias Krüger
b70c5538b6
Rollup merge of #113158 - davidtwco:unset-rustc-log-color-in-test, r=wesleywiser
tests: unset `RUSTC_LOG_COLOR` in a test

Setting `RUSTC_LOG_COLOR=always` is sometimes useful if tools that one pipes `RUSTC_LOG` into support coloured output, but it makes this test fail because it has a `.stderr` file with `WARN` log output.
2023-07-08 15:49:45 +02:00
Matthias Krüger
3e03a48c18
Rollup merge of #112931 - cbeuw:apple-zlib, r=Mark-Simulacrum
Enable zlib in LLVM on aarch64-apple-darwin

Works on macOS 13.4, Xcode version 14.3.1.0.1.1683849156

This was disabled in #75500 on Apple Silicon Developer Transition Kit, but Apple appears to have fixed their zlib now
2023-07-08 15:49:44 +02:00
bors
9bb6fbe261 Auto merge of #113376 - Nilstrieb:pointer-coercions-are-not-casts-because-that-sounds-way-to-general-aaaa, r=oli-obk
Rename `adjustment::PointerCast` and variants using it to `PointerCoercion`

It makes it sounds like the `ExprKind` and `Rvalue` are supposed to represent all pointer related casts, when in reality their just used to share a little enum variants. Make it clear there these are only coercions and that people who see this and think "why are so many pointer related casts not in these variants" aren't insane.

This enum was added in #59987. I'm not sure whether the variant sharing is actually worth it, but this at least makes it less confusing.

r? oli-obk
2023-07-08 13:48:30 +00:00
Camille GILLOT
d7983a2f23 Always name the return place. 2023-07-08 15:38:40 +02:00
Guillaume Gomez
50b4d1f413 Migrate GUI colors test to original CSS color format 2023-07-08 14:56:15 +02:00
bors
ce519c5945 Auto merge of #113474 - compiler-errors:rollup-07x1up7, r=compiler-errors
Rollup of 8 pull requests

Successful merges:

 - #113413 (Add needs-triage to all new issues)
 - #113426 (Don't ICE in `resolve_bound_vars` when associated return-type bounds are in bad positions)
 - #113427 (Remove `variances_of` on RPITIT GATs, remove its one use-case)
 - #113441 (miri: check that assignments do not self-overlap)
 - #113453 (Remove unused from_method from rustc_on_unimplemented)
 - #113456 (Avoid calling report_forbidden_specialization for RPITITs)
 - #113466 (Update cargo)
 - #113467 (Fix comment of `fn_can_unwind`)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-07-08 10:46:29 +00:00
Michael Goulet
7a22c7e6f4
Rollup merge of #113467 - nbdd0121:unwind, r=compiler-errors
Fix comment of `fn_can_unwind`

Reopen of #113213
2023-07-07 22:12:19 -07:00
Michael Goulet
083b2d409c
Rollup merge of #113466 - weihanglo:update-cargo, r=weihanglo
Update cargo

1 commits in 5b377cece0e0dd0af686cf53ce4637d5d85c2a10..45782b6b8afd1da042d45c2daeec9c0744f72cc7
2023-06-30 00:01:00 +0000 to 2023-07-05 16:54:51 +0000
- docs(ref): Provide guidance on version requirements (rust-lang/cargo#12323)

r? ``@ghost``
2023-07-07 22:12:18 -07:00
Michael Goulet
cf1f8c55d5
Rollup merge of #113456 - spastorino:new-rpitit-31, r=compiler-errors
Avoid calling report_forbidden_specialization for RPITITs

Fixes #113438

r? ``@compiler-errors``
2023-07-07 22:12:18 -07:00
Michael Goulet
37a05d8054
Rollup merge of #113453 - spastorino:new-rpitit-30, r=compiler-errors
Remove unused from_method from rustc_on_unimplemented

Fixes #113439

`on_unimplemented_note` was calling `item_name` for RPITITs and that produced ICEs. I've added a regression test for that but also have removed `from_method` symbol entirely because it wasn't even used and by doing that the `item_name` call was also removed.

r? ``@compiler-errors``
2023-07-07 22:12:17 -07:00
Michael Goulet
2b78119671
Rollup merge of #113441 - RalfJung:assign-no-overlap, r=oli-obk
miri: check that assignments do not self-overlap

r? `````@oli-obk`````
2023-07-07 22:12:17 -07:00
Michael Goulet
751dcaceb4
Rollup merge of #113427 - compiler-errors:no-variances-of-rpitit-gat, r=spastorino
Remove `variances_of` on RPITIT GATs, remove its one use-case

It doesn't make sense to implement variances on a GAT anyways, since we don't relate GATs with variance:

85bf07972a/compiler/rustc_middle/src/ty/relate.rs (L569-L579)

r? ``@spastorino``
2023-07-07 22:12:16 -07:00
Michael Goulet
a13b57e636
Rollup merge of #113426 - compiler-errors:rtn-in-impl-header, r=fee1-dead
Don't ICE in `resolve_bound_vars` when associated return-type bounds are in bad positions

I couldn't find a better way to avoid hitting this ICE, so let's just delay it.

The problem is that we really shouldn't even be *trying* to visit associated type bounds in `resolve_bound_vars` when they show up in impl headers, but we don't have enough context to do this.

Fixes #113423
2023-07-07 22:12:16 -07:00
Michael Goulet
77a6c7f3a1
Rollup merge of #113413 - Nilstrieb:this-needs-some-triaging, r=albertlarsan68
Add needs-triage to all new issues

Closes #113261

The label: https://github.com/rust-lang/rust/labels/needs-triage
2023-07-07 22:12:15 -07:00
bors
d4096e0412 Auto merge of #112652 - oli-obk:tait_only_in_sig, r=compiler-errors
Require TAITs to be mentioned in the signatures of functions that register hidden types for them

r? `@lcnr` `@compiler-errors`

This implements the lang team decision from [the TAIT design meeting](https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/design.20meeting.202023-05-31.20TAITs/near/362518164).
2023-07-08 03:22:54 +00:00
Yuki Okushi
a088e7961c
Remove default_free_fn feature
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-07-08 12:10:12 +09:00
bors
eee6b31c0c Auto merge of #113455 - Alexendoo:clippy-tests, r=Nilstrieb
Fix failing clippy tests

Comments out the C string literals due to https://github.com/rust-lang/rust/pull/113334

Fixes https://github.com/rust-lang/rust-clippy/issues/11121

Opened against `rust-lang/rust` in order to unblock https://github.com/rust-lang/rust/pull/113450

r? `@Nilstrieb`
2023-07-08 00:01:19 +00:00
Weihang Lo
b9a4cfe05e
Update cargo 2023-07-07 23:17:40 +01:00
Michael Goulet
b7191d8388 Don't ICE in resolve_bound_vars when associated return-type bounds are in bad positions 2023-07-07 19:43:23 +00:00
Santiago Pastorino
24326ee508
Avoid calling report_forbidden_specialization for RPITITs 2023-07-07 16:24:08 -03:00
Santiago Pastorino
6d80879ab9
Add regression test for RPITITs 2023-07-07 15:58:25 -03:00