-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Use the recorded types in MIR to determine generator auto-trait implementations #65782
Closed
Closed
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
9303810
Use the recorded types in MIR to determine generator auto-trait imple…
Aaron1011 78159e1
Use an Arc in DerivedObligationCauseCode
Aaron1011 46e2d2c
Make generators !Freeze
Aaron1011 5ce4306
Fix rebase fallout
Aaron1011 6840bc4
Update stderr files
Aaron1011 bea0a42
Perform generator field computation before optimizations
Aaron1011 2b2986d
Gate more precise generator auto traits behind feature
Aaron1011 e4684c7
Remove Freeze special-case for generators
Aaron1011 97116eb
Some cleanup
Aaron1011 b3e6f8d
Update tests
Aaron1011 0c92b83
Add check-pass test
Aaron1011 b891e49
Apply nits
Aaron1011 87fc30d
Cleanup trait selection logic
Aaron1011 8f58a71
Fix missed nit
Aaron1011 71c9dd5
Refactor generator interior types calculation
Aaron1011 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,6 +108,11 @@ rustc_queries! { | |
/// unreachable code. | ||
query mir_built(_: DefId) -> &'tcx Steal<mir::BodyCache<'tcx>> {} | ||
|
||
/// Compute the generator interior types for a given `DefId` | ||
/// (if it corresponds to a generator), for use in determining | ||
/// generator auto trait implementation | ||
query mir_generator_interior(_: DefId) -> &'tcx Steal<mir::BodyCache<'tcx>> {} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This won't need to modify the MIR so it should return a |
||
|
||
/// Fetch the MIR for a given `DefId` up till the point where it is | ||
/// ready for const evaluation. | ||
/// | ||
|
@@ -931,6 +936,10 @@ rustc_queries! { | |
query all_traits(_: CrateNum) -> &'tcx [DefId] { | ||
desc { "fetching all foreign and local traits" } | ||
} | ||
|
||
query uses_generator_mir_traits(_: CrateNum) -> bool { | ||
desc { "determining whether crate uses generator MIR traits" } | ||
} | ||
} | ||
|
||
Linking { | ||
|
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These shouldn't be stored in the MIR, and should instead be the return value of the query.