Skip to content

Commit

Permalink
Rebase in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
cmester0 committed Nov 21, 2023
1 parent 1691697 commit bb5a757
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
2 changes: 1 addition & 1 deletion engine/bin/lib.ml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ let import_thir_items (include_clauses : Types.inclusion_clause list)
match Attrs.status i.attrs with Included _ -> true | _ -> false)
items
in
let items = Deps.sort items in
(* let items = Deps.sort items in *) (* TODO: should keep order for non-dependent functions by default? *)
let reports =
List.concat_map
~f:(fun (item : Ast.Rust.item) ->
Expand Down
12 changes: 2 additions & 10 deletions engine/lib/import_thir.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1057,11 +1057,7 @@ let c_trait_item (item : Thir.trait_item) : trait_item =
let open (val make ~krate:item.owner_id.krate : EXPR) in
let { params; constraints } = c_generics item.generics in
(* TODO: see TODO in impl items *)
let ti_ident =
Concrete_ident.of_def_id
(match (item.kind : _) with Const _ -> Value | _ -> Field)
item.owner_id
in
let ti_ident = Concrete_ident.of_def_id Field item.owner_id in
{
ti_span = Span.of_thir item.span;
ti_generics = { params; constraints };
Expand Down Expand Up @@ -1295,11 +1291,7 @@ and c_item_unwrapped ~ident (item : Thir.item) : item list =
backend will see traits and impls as
records. See https://github.com/hacspec/hacspec-v2/issues/271. *)
let ii_ident =
Concrete_ident.of_def_id
(match (item.kind : _) with
| Const _ -> Value
| _ -> Field)
item.owner_id
Concrete_ident.of_def_id Field item.owner_id
in
{
ii_span = Span.of_thir item.span;
Expand Down
17 changes: 15 additions & 2 deletions frontend/exporter/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,21 @@ impl<'tcx> IntoImplExpr<'tcx> for rustc_middle::ty::PolyTraitRef<'tcx> {
})
.map(|path| (apred, path))
}) else {
return ImplExprAtom::Todo(format!("implsource::param \n\n{:#?}", self))
.with_args(impl_exprs(s, &nested));
return
if predicates.is_empty() {
ImplExprAtom::Concrete {
id: s.owner_id().sinto(s),
generics: Vec::new(),
}
// ImplExprAtom::LocalBound {
// clause_id: rand::random(), // TODO
// path: Vec::<search_clause::PathChunk>::new().sinto(s)
// }
}
else {
ImplExprAtom::Todo(format!("implsource::param \n\n{:#?}", self))
}
.with_args(impl_exprs(s, &nested))
};
if apred.is_extra_self_predicate {
if !path.is_empty() {
Expand Down

0 comments on commit bb5a757

Please sign in to comment.