Skip to content

Commit 33fdb78

Browse files
committed
Update charon
1 parent 1a5374f commit 33fdb78

10 files changed

+30
-11
lines changed

charon-pin

+1-1
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-
e341486cc6fece9c176a1189e1a75a6c105360ac
2+
93e45d693a2ad424ec89b934cc1140d72b49f328

flake.lock

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/interp/InterpreterExpansion.ml

+3-2
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ let greedy_expand_symbolics_with_borrows (config : config) (span : Meta.span) :
663663
> 1 variants (option \
664664
[greedy_expand_symbolics_with_borrows] of [config]): "
665665
^ name_to_string ctx def.item_meta.name)
666-
| Alias _ | Opaque | TError _ ->
666+
| Alias _ | Opaque | TDeclError _ ->
667667
craise __FILE__ __LINE__ span
668668
"Attempted to greedily expand an alias or opaque type"
669669
| Union _ ->
@@ -689,7 +689,8 @@ let greedy_expand_symbolics_with_borrows (config : config) (span : Meta.span) :
689689
| TTraitType _
690690
| TArrow _
691691
| TRawPtr _
692-
| TDynTrait _ -> craise __FILE__ __LINE__ span "Unreachable"
692+
| TDynTrait _
693+
| TError _ -> craise __FILE__ __LINE__ span "Unreachable"
693694
in
694695
(* *)
695696
log#ltrace

src/llbc/AssociatedTypes.ml

+3
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,9 @@ let rec norm_ctx_normalize_ty (ctx : norm_ctx) (ty : ty) : ty =
266266
| TDynTrait _ ->
267267
craise_opt_span __FILE__ __LINE__ ctx.span
268268
"Dynamic trait types are not supported yet"
269+
| TError _ ->
270+
craise_opt_span __FILE__ __LINE__ ctx.span
271+
"Found type error in the output of charon"
269272

270273
(** This returns the normalized trait instance id together with an optional
271274
reference to a trait **implementation** (the `trait_ref` we return has

src/llbc/RegionsHierarchy.ml

+3
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ let compute_regions_hierarchy_for_sig (span : Meta.span option) (crate : crate)
181181
| TDynTrait _ ->
182182
craise_opt_span __FILE__ __LINE__ span
183183
"Dynamic trait types are not supported yet"
184+
| TError _ ->
185+
craise_opt_span __FILE__ __LINE__ span
186+
"Found type error in the output of charon"
184187
and explore_generics (outer : region list) (generics : generic_args) =
185188
let { regions; types; const_generics = _; trait_refs = _ } = generics in
186189
List.iter (fun long -> add_edges ~long ~shorts:outer) regions;

src/llbc/TypesAnalysis.ml

+4-1
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,9 @@ let analyze_full_ty (span : Meta.span option) (updated : bool ref)
365365
ty_info inputs
366366
in
367367
analyze span expl_info ty_info output
368+
| TError _ ->
369+
craise_opt_span __FILE__ __LINE__ span
370+
"Found type error in the output of charon"
368371
in
369372
(* Explore *)
370373
analyze span expl_info_init ty_info ty
@@ -394,7 +397,7 @@ let analyze_type_decl (updated : bool ref) (infos : type_infos)
394397
"type aliases should have been removed earlier"
395398
| Union _ ->
396399
craise __FILE__ __LINE__ def.item_meta.span "unions are not supported"
397-
| Opaque | TError _ ->
400+
| Opaque | TDeclError _ ->
398401
craise __FILE__ __LINE__ def.item_meta.span "unreachable"
399402
in
400403
(* Explore the types and accumulate information *)

src/llbc/ValuesUtils.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ let symbolic_value_is_greedily_expandable (span : Meta.span option)
195195
| Struct _ | Enum ([] | [ _ ]) ->
196196
(* Structure or enumeration with <= 1 variant *)
197197
true
198-
| Enum (_ :: _) | Alias _ | Opaque | TError _ | Union _ ->
198+
| Enum (_ :: _) | Alias _ | Opaque | TDeclError _ | Union _ ->
199199
(* Enumeration with > 1 variants *)
200200
false
201201
end

src/pure/PureMicroPasses.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1525,7 +1525,7 @@ let simplify_aggregates (ctx : ctx) (def : fun_decl) : fun_decl =
15251525
in
15261526
let fields =
15271527
match adt_decl.kind with
1528-
| Enum _ | Alias _ | Opaque | TError _ ->
1528+
| Enum _ | Alias _ | Opaque | TDeclError _ ->
15291529
craise __FILE__ __LINE__ def.item_meta.span "Unreachable"
15301530
| Union _ ->
15311531
craise __FILE__ __LINE__ def.item_meta.span

src/symbolic/SymbolicToPure.ml

+10-1
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,9 @@ let rec translate_sty (span : Meta.span option) (ty : T.ty) : ty =
575575
| TDynTrait _ ->
576576
craise_opt_span __FILE__ __LINE__ span
577577
"Dynamic trait types are not supported yet"
578+
| TError _ ->
579+
craise_opt_span __FILE__ __LINE__ span
580+
"Found type error in the output of charon"
578581

579582
and translate_sgeneric_args (span : Meta.span option)
580583
(generics : T.generic_args) : generic_args =
@@ -652,7 +655,7 @@ let translate_type_decl_kind (span : Meta.span) (kind : T.type_decl_kind) :
652655
| Alias _ ->
653656
craise __FILE__ __LINE__ span
654657
"type aliases should have been removed earlier"
655-
| T.Union _ | T.Opaque | T.TError _ -> Opaque
658+
| T.Union _ | T.Opaque | T.TDeclError _ -> Opaque
656659

657660
(** Compute which input parameters should be implicit or explicit.
658661
@@ -813,6 +816,9 @@ let rec translate_fwd_ty (span : Meta.span option) (type_infos : type_infos)
813816
| TDynTrait _ ->
814817
craise_opt_span __FILE__ __LINE__ span
815818
"Dynamic trait types are not supported yet"
819+
| TError _ ->
820+
craise_opt_span __FILE__ __LINE__ span
821+
"Found type error in the output of charon"
816822

817823
and translate_fwd_generic_args (span : Meta.span option)
818824
(type_infos : type_infos) (generics : T.generic_args) : generic_args =
@@ -931,6 +937,9 @@ let rec translate_back_ty (span : Meta.span option) (type_infos : type_infos)
931937
| TDynTrait _ ->
932938
craise_opt_span __FILE__ __LINE__ span
933939
"Dynamic trait types are not supported yet"
940+
| TError _ ->
941+
craise_opt_span __FILE__ __LINE__ span
942+
"Found type error in the output of charon"
934943

935944
(** Simply calls [translate_back_ty] *)
936945
let ctx_translate_back_ty (ctx : bs_ctx) (keep_region : 'r -> bool)

src/symbolic/SynthesizeSymbolic.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ let synthesize_symbolic_expansion (span : Meta.span) (sv : symbolic_value)
9292
| _ -> craise __FILE__ __LINE__ span "Ill-formed borrow expansion")
9393
| TVar _
9494
| TLiteral TChar
95-
| TNever | TTraitType _ | TArrow _ | TRawPtr _ | TDynTrait _ ->
95+
| TNever | TTraitType _ | TArrow _ | TRawPtr _ | TDynTrait _ | TError _ ->
9696
craise __FILE__ __LINE__ span "Ill-formed symbolic expansion"
9797
in
9898
Expansion (place, sv, expansion)

0 commit comments

Comments
 (0)