Skip to content
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

Docs for thir::ExprKind::Use and thir::ExprKind::Let #122526

Merged
merged 1 commit into from
Mar 15, 2024

Conversation

Zalathar
Copy link
Contributor

These docs are based on my own recent investigations; hopefully they're reasonably accurate.

Use was particularly puzzling to me at first, since the name is not very suggestive, and the old docs were quite cryptic.

@rustbot
Copy link
Collaborator

rustbot commented Mar 15, 2024

r? @fee1-dead

rustbot has assigned @fee1-dead.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot 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 Mar 15, 2024
@fee1-dead
Copy link
Member

The docs on Let LGTM. I would like to hear someone else's opinion on Use though, since I haven't dealt with it before.

r? compiler.

@Zalathar
Copy link
Contributor Author

From what I can tell, thir::ExprKind::Use is created from three kinds of HIR:

  • hir::ExprKind::Cast in some specific cases (“coercion cast”)
  • hir::ExprKind::DropTemps, which seems to be a wrapper expression for tweaking drop order
  • A hir::place::Place with HirProjectionKind::OpaqueCast

@michaelwoerister
Copy link
Member

r? types

@rustbot rustbot added the T-types Relevant to the types team, which will review and decide on the PR/issue. label Mar 15, 2024
@rustbot rustbot assigned oli-obk and unassigned michaelwoerister Mar 15, 2024
@oli-obk
Copy link
Contributor

oli-obk commented Mar 15, 2024

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Mar 15, 2024

📌 Commit cac0b12 has been approved by oli-obk

It is now in the queue for this repository.

@bors 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 Mar 15, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 15, 2024
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#121207 (Add `-Z external-clangrt`)
 - rust-lang#122174 (diagnostics: suggest `Clone` bounds when noop `clone()`)
 - rust-lang#122471 (preserve span when evaluating mir::ConstOperand)
 - rust-lang#122515 (Pass the correct DefId when suggesting writing the aliased Self type out)
 - rust-lang#122523 (Ensure RPITITs are created before def-id freezing)
 - rust-lang#122526 (Docs for `thir::ExprKind::Use` and `thir::ExprKind::Let`)
 - rust-lang#122527 (Clean up AstConv)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 7a7b65a into rust-lang:master Mar 15, 2024
11 checks passed
@rustbot rustbot added this to the 1.78.0 milestone Mar 15, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Mar 15, 2024
Rollup merge of rust-lang#122526 - Zalathar:thir-expr-docs, r=oli-obk

Docs for `thir::ExprKind::Use` and `thir::ExprKind::Let`

These docs are based on my own recent investigations; hopefully they're reasonably accurate.

`Use` was particularly puzzling to me at first, since the name is not very suggestive, and the old docs were quite cryptic.
@Zalathar Zalathar deleted the thir-expr-docs branch March 15, 2024 12:02
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. T-types Relevant to the types team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants