public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] Merge #1279
@ 2022-06-08 12:49 Thomas Schwinge
0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2022-06-08 12:49 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:79d977e759b073a0a4d422b9a1032427ddc05295
commit 79d977e759b073a0a4d422b9a1032427ddc05295
Merge: d09b135116f ec9a03a03b5
Author: bors[bot] <26634292+bors[bot]@users.noreply.github.com>
Date: Wed May 25 11:21:26 2022 +0000
Merge #1279
1279: Implement type checking for the `IfLet` expression. r=philberty a=antego
Addresses #1177.
This change implements the type check for the `IfLet` expression. This is the adapted type checking code from the `MatchExpr`.
Tested on this code
```
enum E {
X(u8),
}
fn main() -> i32 {
let mut res = 0;
let v = E::X(4);
if let E::X(n) = v {
res = n;
}
0
}
```
Compilation finishes without errors.
Next is the implementation of the code generation but I'll need help to find where it's located.
Co-authored-by: antego <antego@users.noreply.github.com>
Diff:
gcc/rust/hir/tree/rust-hir-expr.h | 13 +++++++++++++
gcc/rust/typecheck/rust-hir-type-check-expr.h | 23 +++++++++++++++++++++++
2 files changed, 36 insertions(+)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-06-08 12:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-08 12:49 [gcc/devel/rust/master] Merge #1279 Thomas Schwinge
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).