File tree Expand file tree Collapse file tree 2 files changed +43
-10
lines changed
crates/cairo-lang-lowering/src Expand file tree Collapse file tree 2 files changed +43
-10
lines changed Original file line number Diff line number Diff line change @@ -995,20 +995,41 @@ End:
995
995
996
996
blk1:
997
997
Statements:
998
- (v2: ()) <- test::foo (v1{`x `})
998
+ (v2: core::option::Option::<test::NonDrop>) <- Option::Some (v1{`maybe_consume(x) `})
999
999
End:
1000
- Goto(blk3, {v2 -> v3 })
1000
+ Goto(blk3, {v2 -> v5 })
1001
1001
1002
1002
blk2:
1003
1003
Statements:
1004
- (v4: ()) <- struct_construct()
1004
+ (v3: ()) <- struct_construct()
1005
+ (v4: core::option::Option::<test::NonDrop>) <- Option::None(v3{`maybe_consume(x)`})
1005
1006
End:
1006
- Goto(blk3, {v4 -> v3 })
1007
+ Goto(blk3, {v4 -> v5 })
1007
1008
1008
1009
blk3:
1009
1010
Statements:
1010
1011
End:
1011
- Return(v3)
1012
+ Match(match_enum(v5{`maybe_consume(x)`}) {
1013
+ Option::Some(v6) => blk4,
1014
+ Option::None(v7) => blk5,
1015
+ })
1016
+
1017
+ blk4:
1018
+ Statements:
1019
+ (v8: ()) <- test::foo(v6{`x`})
1020
+ End:
1021
+ Goto(blk6, {v8 -> v9})
1022
+
1023
+ blk5:
1024
+ Statements:
1025
+ (v10: ()) <- struct_construct()
1026
+ End:
1027
+ Goto(blk6, {v10 -> v9})
1028
+
1029
+ blk6:
1030
+ Statements:
1031
+ End:
1032
+ Return(v9)
1012
1033
1013
1034
//! > lowering_diagnostics
1014
1035
error: Variable not dropped.
Original file line number Diff line number Diff line change @@ -751,13 +751,25 @@ struct MyStruct {
751
751
//! > semantic_diagnostics
752
752
753
753
//! > lowering_diagnostics
754
- error: Unsupported type in if-let. Type: `test::MyStruct`.
755
- --> lib.cairo:7:16
756
- if let _ = a {
757
- ^
754
+ warning: Unreachable clause.
755
+ --> lib.cairo:10:12-12:5
756
+ } else {
757
+ ____________^
758
+ | y = y + 8;
759
+ | }
760
+ |_____^
758
761
759
762
//! > lowering_flat
760
- <Failed lowering function - run with RUST_LOG=warn (or less) to see diagnostics>
763
+ Parameters: v0: test::MyStruct
764
+ blk0 (root):
765
+ Statements:
766
+ (v1: core::felt252) <- 0
767
+ (v2: core::felt252) <- 5
768
+ (v3: core::felt252) <- core::felt252_add(v1, v2)
769
+ (v4: core::felt252) <- 1
770
+ (v5: core::felt252) <- core::felt252_add(v3, v4)
771
+ End:
772
+ Return(v5)
761
773
762
774
//! > ==========================================================================
763
775
You can’t perform that action at this time.
0 commit comments