-
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
Extend documentation for Ty::to_opt_closure_kind
method
#121083
Merged
Merged
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
Feb 14, 2024
This comment has been minimized.
This comment has been minimized.
GuillaumeGomez
force-pushed
the
doc-to_opt_closure_kind
branch
from
February 14, 2024 14:03
be8acf1
to
6d18764
Compare
compiler/rustc_middle/src/ty/sty.rs
Outdated
@@ -2362,6 +2362,19 @@ impl<'tcx> Ty<'tcx> { | |||
/// to represent the closure kind, because it has not yet been | |||
/// inferred. Once upvar inference (in `rustc_hir_analysis/src/check/upvar.rs`) | |||
/// is complete, that type variable will be unified. | |||
/// | |||
/// To be noted that you can use [`ClosureArgs::kind()`] or [`CoroutineClosureArgs::kind()`] | |||
/// to get the same information, which you can get by calling [`GenericArgs::as_closure()`]. |
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.
or as_coroutine_closure -- depends on the type
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.
Adding it. 👍
GuillaumeGomez
force-pushed
the
doc-to_opt_closure_kind
branch
from
February 14, 2024 14:24
6d18764
to
9ef9f73
Compare
@bors r+ rollup |
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
Feb 14, 2024
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Feb 14, 2024
…llaumeGomez Rollup of 6 pull requests Successful merges: - rust-lang#120893 (Move some tests) - rust-lang#120966 (Remove importing suggestions when there is a shadowed typo candidate) - rust-lang#121035 (Format `async` trait bounds in rustfmt) - rust-lang#121075 (Fix false positive with if let and ranges) - rust-lang#121083 (Extend documentation for `Ty::to_opt_closure_kind` method) - rust-lang#121084 (Make sure `tcx.create_def` also depends on the forever red node, instead of just `tcx.at(span).create_def`) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Feb 14, 2024
Rollup merge of rust-lang#121083 - GuillaumeGomez:doc-to_opt_closure_kind, r=compiler-errors Extend documentation for `Ty::to_opt_closure_kind` method This API was... surprising to use. With a little extra documentation, the weirdness can be reduced quite a lot. :) r? `@compiler-errors`
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.
This API was... surprising to use. With a little extra documentation, the weirdness can be reduced quite a lot. :)
r? @compiler-errors