Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 8 pull requests #110967

Merged
merged 25 commits into from
Apr 29, 2023
Merged

Rollup of 8 pull requests #110967

merged 25 commits into from
Apr 29, 2023

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

compiler-errors and others added 25 commits April 27, 2023 00:57
Fixes rust-lang#110912

Checking `flavor == RlibFlavor::Normal` was accidentally lost in
601fc8b
rust-lang#105601

That caused combining +whole-archive and +bundle link modifiers on
non-rlib crates to fail with a confusing error message saying that
combination is unstable for rlibs. In particular, this caused the
build to fail when +whole-archive was used on staticlib crates, even
though +whole-archive effectively does nothing on non-bin crates because
the final linker invocation is left to an external build system.
It's unnecessary. Note that `MemDecoder::read_raw_bytes` how has a `&'a
[u8]` return type, the same as what `read_raw_bytes_inherent` had.
Because I was wondering about it, and this may save a future person from
also wondering.
Checking that `read_raw_bytes(len)` changes the position by `len` is a
reasonable thing for a test, but isn't much use in just one of the
zillion `Decodable` impls.
The methods for `i8`, `bool`, `char`, `str` are the same for all impls,
because they layered on top of other methods.
It's just a synonym for `read_u8`.
I was curious about how many `Encodable`/`Decodable` derives we have.
Some grepping revealed that it's over 500 of each, but the number of
`Encodable` ones was higher, which was weird. Most of the
`Encodable`-only ones were in `hir.rs`. This commit removes them all,
plus some other unnecessary derives in that file and others that I found
via trial and error.
Provide better type hints when a type doesn't support a binary operator

For example, when checking whether `vec![A] == vec![A]` holds, we first evaluate the LHS's ty, then probe for any `PartialEq` implementations for that. If none is found, we report an error by evaluating `Vec<A>: PartialEq<?0>` for fulfillment errors, but the RHS is not yet evaluated and remains an inference variable `?0`!

To fix this, we evaluate the RHS and equate it to that RHS infer var `?0`, so that we are able to provide more detailed fulfillment errors for why `Vec<A>: PartialEq<Vec<A>>` doesn't hold (namely, the nested obligation `A: PartialEq<A>` doesn't hold).

Fixes rust-lang#95285
Fixes rust-lang#110867
…b_fix, r=petrochenkov

only error combining +whole-archive and +bundle for rlibs

Fixes rust-lang#110912

Checking `flavor == RlibFlavor::Normal` was accidentally lost in 601fc8b
rust-lang#105601

That caused combining +whole-archive and +bundle link modifiers on non-rlib crates to fail with a confusing error message saying that combination is unstable for rlibs. In particular, this caused the build to fail when +whole-archive was used on staticlib crates, even though +whole-archive effectively does nothing on non-bin crates because the final linker invocation is left to an external build system.

cc ``@petrochenkov``
…=Nilstrieb

Use `NonNull::new_unchecked` and `NonNull::len` in `rustc_arena`.

This avoids a few extra dereferences as well as an `unwrap`.

According to the docs for [`NonNull::len`](https://doc.rust-lang.org/std/ptr/struct.NonNull.html#method.len) this also ensures that:

> This function is safe, even when the non-null raw slice cannot be dereferenced to a slice because the pointer does not have a valid address.

I am also fairly sure that the `unwrap` is unneeded in this case, as the docs for [`Box::into_raw`](https://doc.rust-lang.org/std/boxed/struct.Box.html#method.into_raw) also state:

> Consumes the Box, returning a wrapped raw pointer.
**The pointer will be properly aligned and non-null.**
…ps, r=scottmcm

Encoder/decoder cleanups

Best reviewed one commit at a time.

r? ``@scottmcm``
share BinOp::Offset between CTFE and Miri

r? ``@oli-obk``
run-make test: using single quotes to not trigger the shell

This test got added in rust-lang#110801.

I'm no expert on Makefiles, but IIUC this command is passed to the shell, which usually tries to execute commands specified in between backticks in double-quoted strings.

Using single quotes should fix this, I think. (Note: Waiting for CI to test this, since I only have a web browser available right now).

r? ``@jyn514``

cc ``@WaffleLapkin``

Since this is breaking our build bot, even if it is not directly LLVM related: ``@rustbot`` label: +llvm-main
…ict_error, r=cjgillot

Fix an ICE in conflict error diagnostics

Fixes  rust-lang#110929
r? ``@cjgillot``
…errors

fix false negative for `unused_mut`

fixes rust-lang#110849

We want to avoid double diagnostics for code like this, but only if an error actually occurs:
```rust
fn main() {
    let mut x: (i32, i32);
    x.0 = 1;
}
```

The first commit fixes the lint and the second one removes all the unused `mut`s it found.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Apr 28, 2023
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=8

@bors
Copy link
Contributor

bors commented Apr 28, 2023

📌 Commit 34ef13b has been approved by matthiaskrgr

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 28, 2023
@bors
Copy link
Contributor

bors commented Apr 28, 2023

⌛ Testing commit 34ef13b with merge 7a96158...

@bors
Copy link
Contributor

bors commented Apr 29, 2023

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing 7a96158 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 29, 2023
@bors bors merged commit 7a96158 into rust-lang:master Apr 29, 2023
@rustbot rustbot added this to the 1.71.0 milestone Apr 29, 2023
@rust-timer
Copy link
Collaborator

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (7a96158): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
1.1% [0.4%, 2.0%] 17
Regressions ❌
(secondary)
1.1% [1.1%, 1.3%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.3% [-0.3%, -0.3%] 2
All ❌✅ (primary) 1.1% [0.4%, 2.0%] 17

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.8% [0.7%, 1.0%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-5.2% [-5.2%, -5.2%] 1
All ❌✅ (primary) 0.8% [0.7%, 1.0%] 2

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
3.0% [1.2%, 5.8%] 13
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.0% [1.2%, 5.8%] 13

@rustbot rustbot added the perf-regression Performance regression. label Apr 29, 2023
@lqd
Copy link
Member

lqd commented May 2, 2023

I think there's a bit of noise here, but e.g. diesel now looks on average a bit slower than before, probably a real regression.

image

The wall-time on typeck seems to be the most impacted query there, though it's less clear in cachegrind (involves inlining within the hot type folding and predicate obligation processing).

So maybe some of the cleanups in #110877 could be related, doing slightly more work than before:
@rust-timer build 068e587367fa4e424eca954201fb0b90e2e4e8de

On clap, it seems like things are now back to more-or-less the same state as before, but this rollup's result look similar to diesel's in cg (some of the wall-time query diffs look more to be about borrowck, however, which also saw changes in this PR).

wg-grammar is not clear as well, seems to be on a slight upward trend starting at this PR but it looks noisy and still within the recent bimodality bumps' ranges.

image

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (068e587367fa4e424eca954201fb0b90e2e4e8de): comparison URL.

Overall result: ❌ regressions - ACTION NEEDED

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
1.6% [1.4%, 2.0%] 6
Regressions ❌
(secondary)
1.1% [1.1%, 1.2%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.6% [1.4%, 2.0%] 6

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 660.129s -> 659.944s (-0.03%)

@lqd
Copy link
Member

lqd commented May 2, 2023

#110877 looks involved in some of these, so let's at least let author @compiler-errors know.

@compiler-errors
Copy link
Member

I have absolutely no idea how that PR could've caused regressions. It hardly touches non-diagnostic code, let alone hot code 😅

@lqd
Copy link
Member

lqd commented May 2, 2023

It could indeed just be some unlucky rejuggling of the folding and predicates codegen. Looking at it wrong, or even just thinking about it, is apparently enough for it to become unstable in benchmarks (just typing this sentence has probably jinxed us with more instability).

@matthiaskrgr matthiaskrgr deleted the rollup-vfbl7gm branch March 16, 2024 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.