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

hir: Add Become expression kind (explicit tail calls experiment) #112887

Merged
merged 2 commits into from
Jun 26, 2023

Conversation

WaffleLapkin
Copy link
Member

This adds hir::ExprKind::Become alongside ast lowering. During hir-thir lowering we currently lower become as return, so that we can partially test become without ICEing.

cc @scottmcm
r? @Nilstrieb

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 21, 2023
@WaffleLapkin WaffleLapkin added the F-explicit_tail_calls `#![feature(explicit_tail_calls)]` label Jun 21, 2023
@rust-log-analyzer

This comment has been minimized.

@rustbot
Copy link
Collaborator

rustbot commented Jun 21, 2023

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@Noratrieb
Copy link
Member

r? compiler-errors
not familiar enough with typeck

@rustbot rustbot assigned compiler-errors and unassigned Noratrieb Jun 22, 2023
Copy link
Member

@compiler-errors compiler-errors left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=compiler-errors,Nilstrieb with nits applied preferably

compiler/rustc_hir_typeck/src/errors.rs Outdated Show resolved Hide resolved
let call_expr_ty = self.check_expr_with_hint(call, ret_ty);

// N.B. don't coerce here, as tail calls can't support most/all coercions
// FIXME(explicit_tail_calls): add a diagnostic note that `become` doesn't allow coercions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this should be very doable in the future!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool!

tests/ui/typeck/issue-86721-return-expr-ice.rev1.stderr Outdated Show resolved Hide resolved
@compiler-errors compiler-errors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 22, 2023
@WaffleLapkin
Copy link
Member Author

@bors r=compiler-errors,Nilstrieb

@bors
Copy link
Contributor

bors commented Jun 26, 2023

📌 Commit e38576a has been approved by compiler-errors,Nilstrieb

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 26, 2023
@bors
Copy link
Contributor

bors commented Jun 26, 2023

⌛ Testing commit e38576a with merge 6f8c27a...

@bors
Copy link
Contributor

bors commented Jun 26, 2023

☀️ Test successful - checks-actions
Approved by: compiler-errors,Nilstrieb
Pushing 6f8c27a to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 26, 2023
@bors bors merged commit 6f8c27a into rust-lang:master Jun 26, 2023
@rustbot rustbot added this to the 1.72.0 milestone Jun 26, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (6f8c27a): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.5% [-2.5%, -2.5%] 1
All ❌✅ (primary) - - 0

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 662.166s -> 663.81s (0.25%)

flip1995 pushed a commit to flip1995/rust that referenced this pull request Jun 30, 2023
…, r=compiler-errors,Nilstrieb

`hir`: Add `Become` expression kind (explicit tail calls experiment)

This adds `hir::ExprKind::Become` alongside ast lowering. During hir-thir lowering we currently lower `become` as `return`, so that we can partially test `become` without ICEing.

cc `@scottmcm`
r? `@Nilstrieb`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc F-explicit_tail_calls `#![feature(explicit_tail_calls)]` 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. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants