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

Tracking issue for eRFC 2497, "if- and while-let-chains, take 2" #53667

Open
9 of 15 tasks
Tracked by #1568
Centril opened this issue Aug 24, 2018 · 71 comments · Fixed by #94927 · May be fixed by #132833
Open
9 of 15 tasks
Tracked by #1568

Tracking issue for eRFC 2497, "if- and while-let-chains, take 2" #53667

Centril opened this issue Aug 24, 2018 · 71 comments · Fixed by #94927 · May be fixed by #132833
Labels
B-RFC-approved Blocker: Approved by a merged RFC but not yet implemented. C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC F-let_chains `#![feature(let_chains)]` S-tracking-ready-to-stabilize Status: This is ready to stabilize; it may need a stabilization report and a PR T-lang Relevant to the language team, which will review and decide on the PR/issue.

Comments

@Centril
Copy link
Contributor

Centril commented Aug 24, 2018

This is a tracking issue for the eRFC "if- and while-let-chains, take 2" (rust-lang/rfcs#2497).
For the tracking issue for the immediate edition changes, see #53668.

Steps:

Unresolved questions:

Collected issues:

Implementation history:

Unresolved problems

  • Can we be confident that the implementation is correct and well tested?
@Centril Centril added B-RFC-approved Blocker: Approved by a merged RFC but not yet implemented. T-lang Relevant to the language team, which will review and decide on the PR/issue. C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC labels Aug 24, 2018
@Centril Centril self-assigned this Mar 11, 2019
@Centril
Copy link
Contributor Author

Centril commented Mar 11, 2019

I'm working on implementing this in a 3+ PR step fashion based on discussions with @oli-obk.

@oli-obk
Copy link
Contributor

oli-obk commented Mar 11, 2019

for the record, the discussed step list is

  1. remove if from HIR and make lowering emit a match
  2. remove if let from AST and instead have a let expression
  3. "do the rest of the work" (might get split up further).

@alexreg
Copy link
Contributor

alexreg commented Mar 11, 2019

I can't imagine 3 would be a particularly large step (enough to merit splitting), but 3 steps sounds fair enough.

bors added a commit that referenced this issue Apr 17, 2019
[WIP] [let_chains, 1/6] Remove hir::ExprKind::If

Per #53667 (comment).

r? @oli-obk
bors added a commit that referenced this issue May 10, 2019
[let_chains, 1/6] Remove hir::ExprKind::If

Per #53667 (comment).

r? @oli-obk
bors added a commit that referenced this issue May 15, 2019
[let_chains, 2/6] Introduce `Let(..)` in AST, remove IfLet + WhileLet and parse let chains

Here we remove `ast::ExprKind::{IfLet, WhileLet}` and introduce `ast::ExprKind::Let`.
Moreover, we also:
+ connect the parsing logic for let chains
+ introduce the feature gate
+ do some AST validation
+ rewire HIR lowering a bit.

However, this does not connect the new syntax to semantics in HIR.
That will be the subject of a subsequent PR.

Per #53667 (comment).
Next step after #59288.

cc @Manishearth re. Clippy.

r? @oli-obk
bors added a commit that referenced this issue May 16, 2019
[let_chains, 2/6] Introduce `Let(..)` in AST, remove IfLet + WhileLet and parse let chains

Here we remove `ast::ExprKind::{IfLet, WhileLet}` and introduce `ast::ExprKind::Let`.
Moreover, we also:
+ connect the parsing logic for let chains
+ introduce the feature gate
+ do some AST validation
+ rewire HIR lowering a bit.

However, this does not connect the new syntax to semantics in HIR.
That will be the subject of a subsequent PR.

Per #53667 (comment).
Next step after #59288.

cc @Manishearth re. Clippy.

r? @oli-obk
bors added a commit that referenced this issue May 19, 2019
[let_chains, 2/6] Introduce `Let(..)` in AST, remove IfLet + WhileLet and parse let chains

Here we remove `ast::ExprKind::{IfLet, WhileLet}` and introduce `ast::ExprKind::Let`.
Moreover, we also:
+ connect the parsing logic for let chains
+ introduce the feature gate
+ do some AST validation
+ rewire HIR lowering a bit.

However, this does not connect the new syntax to semantics in HIR.
That will be the subject of a subsequent PR.

Per #53667 (comment).
Next step after #59288.

cc @Manishearth re. Clippy.

r? @oli-obk
@estk
Copy link
Contributor

estk commented May 20, 2019

@Centril I'm really jazzed about this feature, lmk if there is any work I can help with.

@traviscross
Copy link
Contributor

We talked about this in the lang planning meeting today. As far as we know, the blockers and semi-blockers to this have been resolved. E.g.:

At this point, we would encourage someone to write up a comprehensive stabilization report and include that in a PR proposing let-chains for stabilization. We're looking forward to considering that proposal.

@est31
Copy link
Member

est31 commented Nov 7, 2024

This is really wonderful news, @traviscross! I've went over the original stabilization PR (now reverted) and related issues to refresh my memory. I've found two possible stabilization blockers that I have opened zulip threads about.

As there is many people subscribed, please try to keep replies in the linked zulip threads.

workingjubilee added a commit to workingjubilee/rustc that referenced this issue Nov 10, 2024
…compiler-errors

Additional tests to ensure let is rejected during parsing

In the original stabilization PR, @ `compiler-errors` has [pointed out](rust-lang#94927 (comment)) that rust-lang#97295 wasn't enough to address the concerns about having `let` in expressions being rejected at parsing time, instead of later.

Thankfully, since then the situation has been greatly improved by rust-lang#115677. This PR adds some additional tests to `disallowed-positions.rs`, and adds two additional revisions to the "normal" case which is now given the `feature` name:

* `no_feature`: Added to incorporate `disallowed-positions-without-feature-gate.rs` into the file, reducing duplication.
* `nothing`: like feature, but all functions are cfg'd out. Ensures that the errors are really emitted during parsing.

cc tracking issue rust-lang#53667
@est31 est31 linked a pull request Nov 10, 2024 that will close this issue
9 tasks
@est31
Copy link
Member

est31 commented Nov 10, 2024

Stabilization report/PR: #132833

rust-timer added a commit to rust-lang-ci/rust that referenced this issue Nov 10, 2024
Rollup merge of rust-lang#132828 - est31:let_chains_parsing_tests, r=compiler-errors

Additional tests to ensure let is rejected during parsing

In the original stabilization PR, @ `compiler-errors` has [pointed out](rust-lang#94927 (comment)) that rust-lang#97295 wasn't enough to address the concerns about having `let` in expressions being rejected at parsing time, instead of later.

Thankfully, since then the situation has been greatly improved by rust-lang#115677. This PR adds some additional tests to `disallowed-positions.rs`, and adds two additional revisions to the "normal" case which is now given the `feature` name:

* `no_feature`: Added to incorporate `disallowed-positions-without-feature-gate.rs` into the file, reducing duplication.
* `nothing`: like feature, but all functions are cfg'd out. Ensures that the errors are really emitted during parsing.

cc tracking issue rust-lang#53667
mati865 pushed a commit to mati865/rust that referenced this issue Nov 12, 2024
…compiler-errors

Additional tests to ensure let is rejected during parsing

In the original stabilization PR, @ `compiler-errors` has [pointed out](rust-lang#94927 (comment)) that rust-lang#97295 wasn't enough to address the concerns about having `let` in expressions being rejected at parsing time, instead of later.

Thankfully, since then the situation has been greatly improved by rust-lang#115677. This PR adds some additional tests to `disallowed-positions.rs`, and adds two additional revisions to the "normal" case which is now given the `feature` name:

* `no_feature`: Added to incorporate `disallowed-positions-without-feature-gate.rs` into the file, reducing duplication.
* `nothing`: like feature, but all functions are cfg'd out. Ensures that the errors are really emitted during parsing.

cc tracking issue rust-lang#53667
@xXA2005

This comment has been minimized.

vindard added a commit to GaloyMoney/lana-bank that referenced this issue Feb 26, 2025
vindard added a commit to GaloyMoney/lana-bank that referenced this issue Feb 27, 2025
vindard added a commit to GaloyMoney/lana-bank that referenced this issue Feb 27, 2025
vindard added a commit to GaloyMoney/lana-bank that referenced this issue Mar 20, 2025
vindard added a commit to GaloyMoney/lana-bank that referenced this issue Mar 20, 2025
vindard added a commit to GaloyMoney/lana-bank that referenced this issue Mar 20, 2025
vindard added a commit to GaloyMoney/lana-bank that referenced this issue Mar 21, 2025
* refactor: rename 'total_outstanding' amounts

* refactor: rename 'outstanding_from_due' & expand disbursed outstanding functions

* feat: introduce interest payment outstanding projection

* chore: make overdue_duration optional

* chore: implement 'defaults_at'

* fix: unstable let expression

See rust-lang/rust#53667 for more

* test: fix maturity offset with 1 interest accrual

* test: add interest_outstanding projection unit tests

* chore: add interest_due_duration in gql layer

* chore: add interestDueDuration defaults to frontend

* chore: ignore 'DAYS' variant for 'durationPeriod' select
hantang pushed a commit to qundao/mirror-mergiraf that referenced this issue Mar 22, 2025
Mainly a preparation for (hopefully) soon-to-be-stabilized if-let-chains[^1]

[^1]: rust-lang/rust#53667

Reviewed-on: https://codeberg.org/mergiraf/mergiraf/pulls/273
Reviewed-by: Antonin Delpeuch <[email protected]>
Co-authored-by: Ada Alakbarova <[email protected]>
Co-committed-by: Ada Alakbarova <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B-RFC-approved Blocker: Approved by a merged RFC but not yet implemented. C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC F-let_chains `#![feature(let_chains)]` S-tracking-ready-to-stabilize Status: This is ready to stabilize; it may need a stabilization report and a PR T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet