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

More rustc_infer cleanups #131348

Merged
merged 10 commits into from
Oct 8, 2024
Merged

Conversation

nnethercote
Copy link
Contributor

A sequel to #131226.

r? @lcnr

@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. labels Oct 7, 2024
@rustbot
Copy link
Collaborator

rustbot commented Oct 7, 2024

changes to the core type system

cc @compiler-errors, @lcnr

@lcnr
Copy link
Contributor

lcnr commented Oct 7, 2024

r=me after nits

@nnethercote
Copy link
Contributor Author

I addressed the comments.

@bors r=lcnr

@bors
Copy link
Contributor

bors commented Oct 7, 2024

📌 Commit 9a33391 has been approved by lcnr

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 Oct 7, 2024
@bors
Copy link
Contributor

bors commented Oct 8, 2024

☔ The latest upstream changes (presumably #131343) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 8, 2024
`OutlivesEnvironment::new` can call `OutlivesEnvironment::with_bounds`
with an empty `extra_bounds`. And once that's done,
`OutlivesEnvironmentBuilder` has a single use and can be inlined and
removed into `OutlivesEnvironment::with_bounds`.
Prompted by rust-lang#131134, which tried to remove `InferOk<'tcx, ()>`
occurrences.
I.e. fixing comments lines that are too long or too short.
It's a weird method, and used weirdly:
- It's on `RegionConstraintCollector` but operates on
  `RegionConstraintStorage`. So at both call sites we create a temporary
  `RegionConstraintCollector`, using `with_log`, to call it.
- It `take`s just two of the six fields in `RegionConstraintStorage`.
  At one of the two call sites we unnecessarily clone the entire
  `RegionConstraintStorage` just to take those two fields.

This commit just inlines and removes it. We no longer need to `take` the
two fields, we can just use them directly.
`LeakCheck` can own `mini_graph` and `rcc` instead of holding references
to them. This requires inlining `assign_scc_value` to avoid a borrowck
error, but that's fine because it has a single call site.
`Deref`/`DerefMut` can be useful, but they can also obfuscate. I don't
think they're worth it for `RegionConstraintCollector`. They're also not
present on the similar types `OpaqueTypeTable` and `TypeVariableTable`.
@nnethercote
Copy link
Contributor Author

@bors r=lcnr

@bors
Copy link
Contributor

bors commented Oct 8, 2024

📌 Commit 3b1eee7 has been approved by lcnr

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 8, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 8, 2024
…iaskrgr

Rollup of 3 pull requests

Successful merges:

 - rust-lang#131348 (More `rustc_infer` cleanups)
 - rust-lang#131392 (Drop compiletest legacy directive check)
 - rust-lang#131395 (Add a mailmap entry for bjorn3)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 7cb47b5 into rust-lang:master Oct 8, 2024
6 checks passed
@rustbot rustbot added this to the 1.83.0 milestone Oct 8, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Oct 8, 2024
Rollup merge of rust-lang#131348 - nnethercote:rustc_infer-more-cleanups, r=lcnr

More `rustc_infer` cleanups

A sequel to rust-lang#131226.

r? `@lcnr`
@nnethercote nnethercote deleted the rustc_infer-more-cleanups branch October 8, 2024 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

6 participants