summaryrefslogtreecommitdiff
path: root/compiler/RegionsHierarchy.ml
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/RegionsHierarchy.ml')
-rw-r--r--compiler/RegionsHierarchy.ml26
1 files changed, 13 insertions, 13 deletions
diff --git a/compiler/RegionsHierarchy.ml b/compiler/RegionsHierarchy.ml
index 21be89ee..3ec42f5d 100644
--- a/compiler/RegionsHierarchy.ml
+++ b/compiler/RegionsHierarchy.ml
@@ -40,7 +40,7 @@ module Subst = Substitute
(** The local logger *)
let log = Logging.regions_hierarchy_log
-let compute_regions_hierarchy_for_sig (meta : Meta.meta option)
+let compute_regions_hierarchy_for_sig (span : Meta.span option)
(type_decls : type_decl TypeDeclId.Map.t)
(fun_decls : fun_decl FunDeclId.Map.t)
(global_decls : global_decl GlobalDeclId.Map.t)
@@ -52,11 +52,11 @@ let compute_regions_hierarchy_for_sig (meta : Meta.meta option)
associated types) *)
let norm_ctx : AssociatedTypes.norm_ctx =
let norm_trait_types =
- AssociatedTypes.compute_norm_trait_types_from_preds meta
+ AssociatedTypes.compute_norm_trait_types_from_preds span
sg.preds.trait_type_constraints
in
{
- meta;
+ span;
norm_trait_types;
type_decls;
fun_decls;
@@ -108,8 +108,8 @@ let compute_regions_hierarchy_for_sig (meta : Meta.meta option)
let add_edge ~(short : region) ~(long : region) =
(* Sanity checks *)
- sanity_check_opt_meta __FILE__ __LINE__ (short <> RErased) meta;
- sanity_check_opt_meta __FILE__ __LINE__ (long <> RErased) meta;
+ sanity_check_opt_span __FILE__ __LINE__ (short <> RErased) span;
+ sanity_check_opt_span __FILE__ __LINE__ (long <> RErased) span;
(* Ignore the locally bound regions (at the level of arrow types for instance *)
match (short, long) with
| RBVar _, _ | _, RBVar _ -> ()
@@ -175,14 +175,14 @@ let compute_regions_hierarchy_for_sig (meta : Meta.meta option)
| TTraitType (trait_ref, _) ->
(* The trait should reference a clause, and not an implementation
(otherwise it should have been normalized) *)
- sanity_check_opt_meta __FILE__ __LINE__
+ sanity_check_opt_span __FILE__ __LINE__
(AssociatedTypes.trait_instance_id_is_local_clause trait_ref.trait_id)
- meta;
+ span;
(* We have nothing to do *)
()
| TArrow (regions, inputs, output) ->
(* TODO: *)
- cassert_opt_meta __FILE__ __LINE__ (regions = []) meta
+ cassert_opt_span __FILE__ __LINE__ (regions = []) span
"We don't support arrow types with locally quantified regions";
(* We can ignore the outer regions *)
List.iter (explore_ty []) (output :: inputs)
@@ -226,7 +226,7 @@ let compute_regions_hierarchy_for_sig (meta : Meta.meta option)
(SccId.Map.bindings sccs.sccs)
in
(* The SCC should only contain the 'static *)
- sanity_check_opt_meta __FILE__ __LINE__ (static_scc = [ RStatic ]) meta;
+ sanity_check_opt_span __FILE__ __LINE__ (static_scc = [ RStatic ]) span;
(* Remove the group as well as references to this group from the
other SCCs *)
let { sccs; scc_deps } = sccs in
@@ -282,7 +282,7 @@ let compute_regions_hierarchy_for_sig (meta : Meta.meta option)
(fun r ->
match r with
| RFVar rid -> RegionId.Map.find rid region_id_to_var_map
- | _ -> craise __FILE__ __LINE__ (Option.get meta) "Unreachable")
+ | _ -> craise __FILE__ __LINE__ (Option.get span) "Unreachable")
scc
in
@@ -323,7 +323,7 @@ let compute_regions_hierarchies (type_decls : type_decl TypeDeclId.Map.t)
List.map
(fun ((fid, d) : FunDeclId.id * fun_decl) ->
( FRegular fid,
- (Types.name_to_string env d.name, d.signature, Some d.item_meta.meta)
+ (Types.name_to_string env d.name, d.signature, Some d.item_meta.span)
))
(FunDeclId.Map.bindings fun_decls)
in
@@ -335,8 +335,8 @@ let compute_regions_hierarchies (type_decls : type_decl TypeDeclId.Map.t)
in
FunIdMap.of_list
(List.map
- (fun (fid, (name, sg, meta)) ->
+ (fun (fid, (name, sg, span)) ->
( fid,
- compute_regions_hierarchy_for_sig meta type_decls fun_decls
+ compute_regions_hierarchy_for_sig span type_decls fun_decls
global_decls trait_decls trait_impls name sg ))
(regular @ assumed))