Skip to content

Commit

Permalink
Merge pull request #977 from Nadrieril/foo
Browse files Browse the repository at this point in the history
More improvements to trait resolution
  • Loading branch information
W95Psp authored Oct 8, 2024
2 parents 496e381 + 8c0f410 commit 2e8df8b
Show file tree
Hide file tree
Showing 8 changed files with 192 additions and 256 deletions.
1 change: 1 addition & 0 deletions engine/hax-engine.opam
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
version: "0.1.0-alpha.1"
synopsis: "The engine of hax, a Rust verification tool"
description:
"Hax is divided in two: a frontend (written in Rust) and an engine (written in OCaml). This is the engine."
Expand Down
2 changes: 1 addition & 1 deletion frontend/exporter/src/constant_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ mod rustc {
let name = assoc.name.to_string();

// Retrieve the trait information
let impl_expr = get_trait_info(s, generics, assoc);
let impl_expr = self_clause_for_item(s, assoc, generics).unwrap();

ConstantExprKind::TraitConst { impl_expr, name }
}
Expand Down
11 changes: 0 additions & 11 deletions frontend/exporter/src/rustc_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,6 @@ impl<'tcx, T: ty::TypeFoldable<ty::TyCtxt<'tcx>>> ty::Binder<'tcx, T> {
}
}

// TODO: this seems to be constructing a `Self: Trait` clause. Document what it does exactly.
pub fn poly_trait_ref<'tcx, S: UnderOwnerState<'tcx>>(
s: &S,
assoc: &ty::AssocItem,
generics: ty::GenericArgsRef<'tcx>,
) -> Option<ty::PolyTraitRef<'tcx>> {
let tcx = s.base().tcx;
let r#trait = tcx.trait_of_item(assoc.def_id)?;
Some(ty::Binder::dummy(ty::TraitRef::new(tcx, r#trait, generics)))
}

#[tracing::instrument(skip(s))]
pub(crate) fn arrow_of_sig<'tcx, S: UnderOwnerState<'tcx>>(sig: &ty::PolyFnSig<'tcx>, s: &S) -> Ty {
Ty::Arrow(Box::new(sig.sinto(s)))
Expand Down
Loading

0 comments on commit 2e8df8b

Please sign in to comment.