-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
More rustc_infer
cleanups
#131348
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
changes to the core type system |
lcnr
reviewed
Oct 7, 2024
lcnr
reviewed
Oct 7, 2024
compiler/rustc_infer/src/infer/region_constraints/leak_check.rs
Outdated
Show resolved
Hide resolved
lcnr
reviewed
Oct 7, 2024
r=me after nits |
tjallingt
reviewed
Oct 7, 2024
nnethercote
force-pushed
the
rustc_infer-more-cleanups
branch
from
October 7, 2024 22:34
ac6ff3a
to
9a33391
Compare
I addressed the comments. @bors r=lcnr |
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
☔ The latest upstream changes (presumably #131343) made this pull request unmergeable. Please resolve the merge conflicts. |
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.
It has a single call site.
`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
force-pushed
the
rustc_infer-more-cleanups
branch
from
October 8, 2024 05:39
9a33391
to
3b1eee7
Compare
@bors r=lcnr |
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
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`
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A sequel to #131226.
r? @lcnr