rustc_infer: remove InferCtxt::closure_sig as the FnSig is always shallowly known.#70089
Merged
bors merged 1 commit intorust-lang:masterfrom Mar 21, 2020
Merged
rustc_infer: remove InferCtxt::closure_sig as the FnSig is always shallowly known.#70089bors merged 1 commit intorust-lang:masterfrom
bors merged 1 commit intorust-lang:masterfrom
Conversation
Member
Author
|
@bors try @rust-timer queue |
Collaborator
|
Awaiting bors try build completion |
Collaborator
|
⌛ Trying commit 63811bc with merge 2056ca8947d090a687667e68d89cceab943a3928... |
Collaborator
|
☀️ Try build successful - checks-azure |
Collaborator
|
Queued 2056ca8947d090a687667e68d89cceab943a3928 with parent 7ceebd9, future comparison URL. |
Member
Author
|
Perf looks neutral, probably makes sense outside of explicit closure stress tests. |
nikomatsakis
approved these changes
Mar 19, 2020
|
|
||
| // HACK(eddyb) this forces the types equated above into `substs` but | ||
| // it should rely on `ClosureSubsts` providing a constructor, instead. | ||
| let substs = self.resolve_vars_if_possible(&substs); |
Contributor
There was a problem hiding this comment.
the purpose of this code is to ensure that have a fn type, and not an inference variable that's been equated with a fn type?
Contributor
|
@bors r+ |
Collaborator
|
📌 Commit 63811bc has been approved by |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Mar 21, 2020
Rollup of 8 pull requests Successful merges: - rust-lang#67888 (Prefetch some queries used by the metadata encoder) - rust-lang#69934 (Update the mir inline costs) - rust-lang#69965 (Refactorings to get rid of rustc_codegen_utils) - rust-lang#70054 (Build dist-android with --enable-profiler) - rust-lang#70089 (rustc_infer: remove InferCtxt::closure_sig as the FnSig is always shallowly known.) - rust-lang#70092 (hir: replace "items" terminology with "nodes" where appropriate.) - rust-lang#70138 (do not 'return' in 'throw_' macros) - rust-lang#70151 (Update stdarch submodule) Failed merges: - rust-lang#70074 (Expand: nix all fatal errors) r? @ghost
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
That is,
ClosureSubstsis always created (inrustc_typeck::check::closure) with aFnSig, as the number of inputs is known, even if they might all have inference types.The only useful thing
InferCtxt::closure_sigwas doing is resolving an inference variable used just to get thety::FnPtrcontaining thatFnSigintoClosureSubsts.The ideal way to solve this would be to add a constructor for
ClosureSubsts, that combines the parentSubsts, the closure kind, the signature, and capture types together, but for now I've went with resolving the inference types just after unifying them with the real types.r? @nikomatsakis