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 7 pull requests #90966

Merged
merged 16 commits into from
Nov 17, 2021
Merged

Rollup of 7 pull requests #90966

merged 16 commits into from
Nov 17, 2021

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

JohnTitor and others added 16 commits November 11, 2021 08:35
Since our musl targets link to a version of musl we build and bundle
with the targets, if users need to debug into musl or generate
backtraces which contain parts of the musl library, they will be unable
to do so unless we enable and ship the debug info.

This patch changes our dist builds so they enabled debug info when
building musl. This patch also includes a fix for CFI detection in
musl's `configure` script which has been posted upstream[1].

The net effect of this is that we now ship debug info for musl in those
targets. This adds ~90kb to those artifacts but running `strip` on
binaries produced removes all of that. For a "hello world" Rust binary
on x86_64, the numbers are:

|                        | debug | release | release + strip |
|           -            |   -   |    -    |        -        |
| without musl debuginfo | 507kb |  495kb  |      410kb      |
| with musl debuginfo    | 595kb |  584kb  |      410kb      |

Once stripped, the final binaries are the same size (down to the byte).

[1]: https://www.openwall.com/lists/musl/2021/10/21/2
This should significantly reduce the frequency of merge conflicts.
…Simulacrum

Build musl dist artifacts with debuginfo enabled

Since our musl targets link to a version of musl we build and bundle
with the targets, if users need to debug into musl or generate
backtraces which contain parts of the musl library, they will be unable
to do so unless we enable and ship the debug info.

This patch changes our dist builds so they enabled debug info when
building musl. This patch also includes a fix for CFI detection in
musl's `configure` script which has been [posted upstream](https://www.openwall.com/lists/musl/2021/10/21/2).

The net effect of this is that we now ship debug info for musl in those
targets. This adds ~90kb to those artifacts but running `strip` on
binaries produced removes all of that. For a "hello world" Rust binary
on x86_64, the numbers are:

|                        | debug | release | release + strip |
|           -            |   -   |    -    |        -        |
| without musl debuginfo | 507kb |  495kb  |      410kb      |
| with musl debuginfo    | 595kb | 584kb | 410kb |

Once stripped, the final binaries are the same size (down to the byte).

Fixes rust-lang#90103

r? `@Mark-Simulacrum`
…r=oli-obk

Add `#[inline]`s to `SortedIndexMultiMap`

They're small enough and good candidates to add `#[inline]` generally.
…=lnicola

⬆️ rust-analyzer

r? ``@ghost``
Fix await suggestion on non-future type

Remove a match block that would suggest to add `.await` in the case where the expected type's `Future::Output` equals the found type. We only want to suggest `.await`ing in the opposite case (the found type's `Future::Output` equals the expected type).

The code sample is here: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=6ba6b83d4dddda263553b79dca9f6bcb

Before:
```
➜  ~ rustc --edition=2021 --crate-type=lib test.rs
error[E0308]: `match` arms have incompatible types
 --> test.rs:4:14
  |
2 |       let x = match 1 {
  |  _____________-
3 | |         1 => other(),
  | |              ------- this is found to be of type `impl Future`
4 | |         2 => other().await,
  | |              ^^^^^^^^^^^^^ expected opaque type, found enum `Result`
5 | |     };
  | |_____- `match` arms have incompatible types
  |
  = note: expected type `impl Future`
             found enum `Result<(), ()>`
help: consider `await`ing on the `Future`
  |
4 |         2 => other().await.await,
  |                           ++++++

error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.
```

After:
```
➜  ~ rustc +stage1 --edition=2021 --crate-type=lib test.rs
error[E0308]: `match` arms have incompatible types
 --> test.rs:4:14
  |
2 |       let x = match 1 {
  |  _____________-
3 | |         1 => other(),
  | |              ------- this is found to be of type `impl Future`
4 | |         2 => other().await,
  | |              ^^^^^^^^^^^^^ expected opaque type, found enum `Result`
5 | |     };
  | |_____- `match` arms have incompatible types
  |
  = note: expected type `impl Future`
             found enum `Result<(), ()>`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.
```

Fixes rust-lang#90931
…htriplett

Alphabetize language features

This should significantly reduce the frequency of merge conflicts.

r? ````@joshtriplett````

````@rustbot```` label: +A-contributor-roadblock +S-waiting-on-review
…oli-obk

Mark `<*const _>::align_offset` and `<*mut _>::align_offset` as `const fn`

This PR marks the following APIs as `const`:
```rust
impl<T> *const T {
    pub const fn align_offset(self, align: usize) -> usize;
}

impl<T> *mut T {
    pub const fn align_offset(self, align: usize) -> usize;
}
```

`const` implementation simply returns `usize::MAX`.

---

Previous discussion: rust-lang#90607 (comment)

---

r? `@oli-obk`
@rustbot rustbot added the rollup A PR which is a rollup label Nov 16, 2021
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=7

@bors
Copy link
Contributor

bors commented Nov 16, 2021

📌 Commit 0c3a662 has been approved by matthiaskrgr

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Nov 16, 2021
@bors
Copy link
Contributor

bors commented Nov 17, 2021

⌛ Testing commit 0c3a662 with merge 41301c3...

@bors
Copy link
Contributor

bors commented Nov 17, 2021

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing 41301c3 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 17, 2021
@bors bors merged commit 41301c3 into rust-lang:master Nov 17, 2021
@rustbot rustbot added this to the 1.58.0 milestone Nov 17, 2021
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (41301c3): comparison url.

Summary: This change led to very large relevant improvements 🎉 in compiler performance.

  • Very large improvement in instruction counts (up to -5.9% on incr-unchanged builds of inflate)

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

@matthiaskrgr matthiaskrgr deleted the rollup-4akzcrh branch November 20, 2021 15:03
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. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.