Skip to content

Commit 486b1c7

Browse files
authored
Merge pull request #292 from Nadrieril/cleanup-itemkind
2 parents 0dbf1d6 + 95731c9 commit 486b1c7

File tree

8 files changed

+18
-15
lines changed

8 files changed

+18
-15
lines changed

charon-pin

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# This is the commit from https://github.com/AeneasVerif/charon that should be used with this version of aeneas.
2-
ee335659fe378b51f04b6701632acbc56a205228
2+
177eece7e95be78567500a9aec967f1433492a54

compiler/Extract.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ let extract_fun_decl_register_names (ctx : extraction_ctx)
2020
only use their type for the fields of the records we generate for the trait
2121
declarations *)
2222
match def.f.kind with
23-
| TraitItemDecl _ -> ctx
23+
| TraitDeclItem (_, _, false) -> ctx
2424
| _ -> (
2525
(* Check if the function is builtin *)
2626
let builtin =
@@ -1160,7 +1160,7 @@ let extract_fun_parameters (space : bool ref) (ctx : extraction_ctx)
11601160
*)
11611161
let ctx, trait_decl =
11621162
match def.kind with
1163-
| TraitItemProvided (decl_id, _) ->
1163+
| TraitDeclItem (decl_id, _, true) ->
11641164
let trait_decl = T.TraitDeclId.Map.find decl_id ctx.trans_trait_decls in
11651165
let ctx, _ = ctx_add_trait_self_clause def.item_meta.span ctx in
11661166
let ctx = { ctx with is_provided_method = true } in

compiler/ExtractBase.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2061,7 +2061,7 @@ let ctx_add_global_decl_and_body (def : A.global_decl) (ctx : extraction_ctx) :
20612061
in the trait declaration *)
20622062
let suffix =
20632063
match def.kind with
2064-
| TraitItemProvided _ -> "_default"
2064+
| TraitDeclItem (_, _, true) -> "_default"
20652065
| _ -> ""
20662066
in
20672067
let ctx = ctx_add def.item_meta.span decl (name ^ suffix) ctx in
@@ -2080,7 +2080,7 @@ let ctx_compute_fun_name (def : fun_decl) (ctx : extraction_ctx) : string =
20802080
*)
20812081
let item_meta =
20822082
match def.kind with
2083-
| TraitItemImpl (_, trait_decl_id, item_name, _) -> (
2083+
| TraitImplItem (_, trait_decl_id, item_name, _) -> (
20842084
if Option.is_some def.item_meta.attr_info.rename then def.item_meta
20852085
else
20862086
(* Lookup the declaration. TODO: the trait item impl info

compiler/Interpreter.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ let symbolic_instantiate_fun_sig (span : Meta.span) (ctx : eval_ctx)
7474
eval_ctx * inst_fun_sig =
7575
let tr_self =
7676
match kind with
77-
| RegularKind | TraitItemImpl _ -> UnknownTrait __FUNCTION__
78-
| TraitItemDecl _ | TraitItemProvided _ -> Self
77+
| RegularItem | TraitImplItem _ -> UnknownTrait __FUNCTION__
78+
| TraitDeclItem _ -> Self
7979
in
8080
let generics =
8181
let { regions; types; const_generics; trait_clauses; _ } = sg.generics in

compiler/LlbcAstUtils.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ let crate_get_opaque_non_builtin_decls (k : crate) (filter_assumed : bool) :
4545
(* Something to pay attention to: we must ignore trait method *declarations*
4646
(which don't have a body but must not be considered as opaque) *)
4747
&& (match d.kind with
48-
| TraitItemDecl _ -> false
48+
| TraitDeclItem (_, _, false) -> false
4949
| _ -> true)
5050
&& ((not filter_assumed)
5151
|| (not (NameMatcherMap.mem ctx d.item_meta.name builtin_globals_map))

compiler/Translate.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ let extract_definitions (fmt : Format.formatter) (config : gen_config)
807807
match pure_fun with
808808
| Some pure_fun -> (
809809
match pure_fun.f.Pure.kind with
810-
| TraitItemDecl _ -> ()
810+
| TraitDeclItem (_, _, false) -> ()
811811
| _ ->
812812
(* Translate *)
813813
export_functions_group [ pure_fun ])

flake.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,9 @@
228228
pkgs.ocamlPackages.ocamlformat
229229
pkgs.ocamlPackages.menhir
230230
pkgs.ocamlPackages.odoc
231+
# ocaml-lsp's version must match the ocaml version used. Pinning
232+
# this here to save everyone a headache.
233+
pkgs.ocamlPackages.ocaml-lsp
231234
pkgs.jq
232235
pkgs.rustup
233236
];

0 commit comments

Comments
 (0)