Skip to content

Commit

Permalink
Merge pull request #906 from Nadrieril/cleanup-trait-resolution
Browse files Browse the repository at this point in the history
Cleanup trait resolution
  • Loading branch information
Nadrieril authored Sep 27, 2024
2 parents a8cc8d6 + 1679eb7 commit 29d28fc
Show file tree
Hide file tree
Showing 7 changed files with 287 additions and 189 deletions.
14 changes: 13 additions & 1 deletion frontend/exporter/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ pub type StateWithThir<'tcx> =
pub type StateWithMir<'tcx> =
State<Base<'tcx>, (), types::RcMir<'tcx>, rustc_hir::def_id::DefId, ()>;

impl<'tcx> State<Base<'tcx>, (), (), (), ()> {
impl<'tcx> StateWithBase<'tcx> {
pub fn new(
tcx: rustc_middle::ty::TyCtxt<'tcx>,
options: hax_frontend_exporter_options::Options,
Expand Down Expand Up @@ -247,6 +247,18 @@ impl<'tcx> StateWithThir<'tcx> {
}
}

impl<'tcx> StateWithOwner<'tcx> {
pub fn from_under_owner<S: UnderOwnerState<'tcx>>(s: &S) -> Self {
Self {
base: s.base(),
owner_id: s.owner_id(),
thir: (),
mir: (),
binder: (),
}
}
}

/// Updates the OnwerId in a state, making sure to override `opt_def_id` in base as well.
pub fn with_owner_id<'tcx, THIR, MIR>(
mut base: types::Base<'tcx>,
Expand Down
Loading

0 comments on commit 29d28fc

Please sign in to comment.