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 #118300

Merged
merged 28 commits into from
Nov 26, 2023
Merged

Rollup of 7 pull requests #118300

merged 28 commits into from
Nov 26, 2023

Conversation

compiler-errors
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

Urgau and others added 28 commits November 16, 2023 11:35
This lets us avoid creating two copies of the node's branch list.
Now that this code path unconditionally calls `make_branch_counters`, we might
as well make that method responsible for creating the node's counter as well,
since it needs the resulting term anyway.
This means that we no longer have to manage the distinction between
`BcbCounter` and `CovTerm` when preparing expressions.
In some cases we need to prepare a coverage expression that is the sum of an
arbitrary number of other terms. This patch simplifies the code paths that
build those sums.

This causes some churn in the mappings, because the previous code was building
its sums in a somewhat idiosyncratic order.
This was previously a helper method in `MakeBcbCounters`, but putting it in the
graph lets us call it from `BcbBranch`, and gives us a more fine-grained
borrow.
`BcbBranch` represented an out-edge of a coverage graph node, but would
silently refer to a node instead in cases where that node only had one in-edge.

Instead we now refer to a graph edge as a `(from_bcb, to_bcb)` pair, or
sometimes as just one of those nodes when the other node is implied by the
surrounding context. The case of sole in-edges is handled by special code added
directly to `get_or_make_edge_counter_operand`.
This explains why we don't have to worry about bcb0 having multiple in-edges.
It's empty, and it doesn't even make sense, because
`rustc_error_messages` is a lower-level crate than `rustc_errors`.
The `fluent_messages!` macro produces uses of
`crate::{D,Subd}iagnosticMessage`, which means that every crate using
the macro must have this import:
```
use rustc_errors::{DiagnosticMessage, SubdiagnosticMessage};
```

This commit changes the macro to instead use
`rustc_errors::{D,Subd}iagnosticMessage`, which avoids the need for the
imports.
Currently we always do this:
```
use rustc_fluent_macro::fluent_messages;
...
fluent_messages! { "./example.ftl" }
```
But there is no need, we can just do this everywhere:
```
rustc_fluent_macro::fluent_messages! { "./example.ftl" }
```
which is shorter.
coverage: Simplify building coverage expressions based on sums

This is a combination of some interlinked changes to the code that creates coverage counters/expressions for nodes and edges in the coverage graph:

- Some preparatory cleanups in `MakeBcbCounters::make_branch_counters`
- Use `BcbCounter` (instead of `CovTerm`) when building coverage expressions
  - This makes it easier to introduce a fold for building sums
- Simplify the creation of coverage expressions based on sums, by having `Iterator::fold` do much of the work
- Get rid of the awkward `BcbBranch` enum, and replace it with graph edges represented as `(from_bcb, to_bcb)`
  - This further simplifies the body of the fold
…lnay

Stabilize `ptr::addr_eq`

This PR stabilize the `ptr_addr_eq` library feature, representing:

```rust
// core::ptr

pub fn addr_eq<T: ?Sized, U: ?Sized>(p: *const T, q: *const U) -> bool;
```

FCP has already started [on the tracking issue](rust-lang#116324 (comment)) and is waiting on the final period comment.

Note: stabilizing this feature is somewhat of requirement for a new T-lang lint, cf. rust-lang#117758 (comment).
…ate, r=compiler-errors

Reduce fluent boilerplate

Best reviewed one commit at a time.

r? `@davidtwco`
… r=cjgillot

Miscellaneous `ObligationCauseCode` cleanups

Remove some dead code/unused `ObligationCauseCode`s.
…,dtolnay

Use `is_{some,ok}_and` more in the compiler

slightly more fluent-reading code
…c, r=fmease

`is_{some,ok}_and` for rustdoc

slightly more fluent-reading code

r? fmease
…d, r=aliemjay

Don't ICE when encountering placeholders in implied bounds computation

I *could* fix this the right way, though I don't really want to think about the implications of the change. This should have minimal side-effects.

r? `@aliemjay`

Fixes rust-lang#118286
@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic labels Nov 25, 2023
@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. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Nov 25, 2023
@compiler-errors
Copy link
Member Author

@bors r+ rollup=never p=7

@bors
Copy link
Contributor

bors commented Nov 25, 2023

📌 Commit 2eccebb has been approved by compiler-errors

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 Nov 25, 2023
@bors
Copy link
Contributor

bors commented Nov 25, 2023

⌛ Testing commit 2eccebb with merge 0999cdf...

bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 25, 2023
…mpiler-errors

Rollup of 7 pull requests

Successful merges:

 - rust-lang#117651 (coverage: Simplify building coverage expressions based on sums)
 - rust-lang#117968 (Stabilize `ptr::addr_eq`)
 - rust-lang#118158 (Reduce fluent boilerplate)
 - rust-lang#118201 (Miscellaneous `ObligationCauseCode` cleanups)
 - rust-lang#118288 (Use `is_{some,ok}_and` more in the compiler)
 - rust-lang#118289 (`is_{some,ok}_and` for rustdoc)
 - rust-lang#118290 (Don't ICE when encountering placeholders in implied bounds computation)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors
Copy link
Contributor

bors commented Nov 26, 2023

💔 Test failed - checks-actions

@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

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

Spurious

@bors retry

@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 Nov 26, 2023
@bors
Copy link
Contributor

bors commented Nov 26, 2023

⌛ Testing commit 2eccebb with merge 33f6af8...

@bors
Copy link
Contributor

bors commented Nov 26, 2023

☀️ Test successful - checks-actions
Approved by: compiler-errors
Pushing 33f6af8 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 26, 2023
@bors bors merged commit 33f6af8 into rust-lang:master Nov 26, 2023
12 checks passed
@rustbot rustbot added this to the 1.76.0 milestone Nov 26, 2023
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#117651 coverage: Simplify building coverage expressions based on s… 8456bb890fd66fbb5c17bba3a8af3e99c8593ec3 (link)
#117968 Stabilize ptr::addr_eq d13281c2e43e16c30bc3777aafef3c6b0e8df1e5 (link)
#118158 Reduce fluent boilerplate 57b4c7ed1a0cf158a80385a75d18a22459dd2f58 (link)
#118201 Miscellaneous ObligationCauseCode cleanups df45e5074403f506f001dd69fc3dd120f60ac33a (link)
#118288 Use is_{some,ok}_and more in the compiler f17dbe312470ef4fb69a4713ffeb5411550e185b (link)
#118289 is_{some,ok}_and for rustdoc af2ef8c1c42bc105fb15785e0cd499bd163d008a (link)
#118290 Don't ICE when encountering placeholders in implied bounds … 13de51c21862aa35b50d5923023256e9489145d8 (link)

previous master: ee80c8d0a8

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (33f6af8): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

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)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.3% [-0.3%, -0.3%] 1
All ❌✅ (primary) - - 0

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)
2.9% [2.9%, 2.9%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.5% [-4.6%, -2.5%] 2
All ❌✅ (primary) 2.9% [2.9%, 2.9%] 1

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: 672.939s -> 674.797s (0.28%)
Artifact size: 313.35 MiB -> 313.34 MiB (-0.01%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic 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. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants