File tree Expand file tree Collapse file tree 3 files changed +18
-7
lines changed Expand file tree Collapse file tree 3 files changed +18
-7
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: a4a0c6ad1e76e43f688edbed58347dc4b79ea852
2
+ refs/heads/master: 6cfeac162d4562b07a540af0959cc1d39c882f6d
Original file line number Diff line number Diff line change @@ -1006,6 +1006,21 @@ let trans_visitor
1006
1006
trans_cond_fail " bounds check" jmp;
1007
1007
based elt_reg
1008
1008
1009
+ and trans_lval_item
1010
+ (lv :Ast.lval )
1011
+ : (Il.cell * Ast.ty) =
1012
+ assert (lval_base_is_item cx lv);
1013
+ let ty = lval_ty cx lv in
1014
+ let item = lval_item cx lv in
1015
+ check_concrete item.node.Ast. decl_params () ;
1016
+ match item.node.Ast. decl_item with
1017
+ Ast. MOD_ITEM_const (_ , Some e ) ->
1018
+ (Il. Reg (force_to_reg (trans_expr e)), ty)
1019
+ | _ ->
1020
+ bug ()
1021
+ " trans_lval_full called on unsupported item lval '%a'"
1022
+ Ast. sprintf_lval lv
1023
+
1009
1024
and trans_lval_full
1010
1025
(initializing :bool )
1011
1026
(lv :Ast.lval )
@@ -1062,12 +1077,7 @@ let trans_visitor
1062
1077
else
1063
1078
if initializing
1064
1079
then err None " init item"
1065
- else
1066
- begin
1067
- assert (lval_base_is_item cx lv);
1068
- bug ()
1069
- " trans_lval_full called on item lval '%a'" Ast. sprintf_lval lv
1070
- end
1080
+ else trans_lval_item lv
1071
1081
1072
1082
and trans_lval_maybe_init
1073
1083
(initializing :bool )
Original file line number Diff line number Diff line change 1
1
const int i = 10 ;
2
2
3
3
fn main ( ) {
4
+ log i;
4
5
}
You can’t perform that action at this time.
0 commit comments