-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
mir: add used_generic_parameters_needs_subst
#74717
Merged
bors
merged 1 commit into
rust-lang:master
from
davidtwco:issue-74636-polymorphized-closures-inherited-params
Aug 1, 2020
Merged
mir: add used_generic_parameters_needs_subst
#74717
bors
merged 1 commit into
rust-lang:master
from
davidtwco:issue-74636-polymorphized-closures-inherited-params
Aug 1, 2020
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
rust-highfive
added
the
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
label
Jul 24, 2020
r? @oli-obk I got a crash course in polymorphization magic in https://rust-lang.zulipchat.com/#narrow/stream/216091-t-compiler.2Fwg-polymorphization/topic/tokio.20regression.20%28.2374614%29/near/205594913 |
This commit adds a `ensure_monomorphic_enough` utility function which checks whether a type needs substitution, but only for parameters that the `unused_generic_params` query considers used. `ensure_monomorphic_enough` is then used throughout interpret where `needs_subst` checks previously existed (in particular, for some pointer casts and for reflection intrinsics more precise). Signed-off-by: David Wood <david@davidtw.co>
davidtwco
force-pushed
the
issue-74636-polymorphized-closures-inherited-params
branch
from
July 31, 2020 15:37
4d1d988
to
59e621c
Compare
cc @rust-lang/wg-const-eval @bors r+ |
📌 Commit 59e621c has been approved by |
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
Jul 31, 2020
lcnr
reviewed
Jul 31, 2020
☀️ Test successful - checks-actions, checks-azure |
davidtwco
deleted the
issue-74636-polymorphized-closures-inherited-params
branch
August 3, 2020 09:31
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Aug 5, 2020
…optimisations, r=lcnr polymorphization: various improvements This PR includes a handful of polymorphisation-related changes: - @Mark-Simulacrum's suggestions [from this comment](rust-lang#74633 (comment)): - Use a `FiniteBitSet<u32>` over a `FiniteBitSet<u64>` as most functions won't have 64 generic parameters. - Don't encode polymorphisation results in metadata when every parameter is used (in this case, just invoking polymorphisation will probably be quicker). - @lcnr's suggestion [from this comment](rust-lang#74717 (comment)). - Add an debug assertion in `ensure_monomorphic_enough` to make sure that polymorphisation did what we expect. r? @lcnr
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.
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
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.
Fixes #74636.
This PR adds a
used_generic_parameters_needs_subst
helper function which checks whether a type needs substitution, but only for parameters that theunused_generic_params
query considers used. This is used in the MIR interpreter to make the check for some pointer casts and for reflection intrinsics more precise.I've opened this as a draft PR because this might not be the approach we want to fix this issue and we have to decide what to do about the reflection case.
r? @eddyb
cc @lcnr @wesleywiser