Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 22 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pcg
Submodule pcg updated 129 files
24 changes: 7 additions & 17 deletions prusti-encoder/src/encoders/impure/fn_wand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,11 @@ pub struct WandEncOutput<'vir> {

impl<'vir> WandEncOutput<'vir> {
pub(crate) fn fn_sig(&self, vcx: &'vir vir::VirCtxt<'vir>) -> ty::FnSig<'vir> {
self.function_data.instantiated_fn_sig(vcx.tcx())
self.function_data.identity_fn_sig(vcx.tcx())
}

pub(crate) fn g_params(&self, vcx: &'vir vir::VirCtxt<'vir>) -> GParams<'vir> {
GParams::new(
self.function_data.substs(),
self.function_data.param_env(vcx.tcx()),
false,
)
pub(crate) fn g_params(&self) -> GParams<'vir> {
GParams::from(self.function_data.def_id())
}

fn encode_predicates_for_function_shape_node(
Expand All @@ -122,7 +118,7 @@ impl<'vir> WandEncOutput<'vir> {
use vir::Reify;
let g = g.into();
let fn_sig = self.fn_sig(vcx);
let ty = RustTyDecomposition::from_ty(g.ty(fn_sig), self.g_params(vcx));
let ty = RustTyDecomposition::from_ty(g.ty(fn_sig), self.g_params());
let predicates = deps
.require_dep::<IndirectPredicatesEnc>(g.with_base(ty))
.unwrap()
Expand Down Expand Up @@ -276,8 +272,8 @@ impl<'tcx> WandEncTask<'tcx> {
pub fn function_shape(
&self,
vcx: &vir::VirCtxt<'tcx>,
) -> Result<FunctionShape, MakeFunctionShapeError> {
self.data.shape(vcx.tcx())
) -> Result<FunctionShape, MakeFunctionShapeError<'tcx>> {
self.data.shape(None, vcx.tcx())
}
}

Expand Down Expand Up @@ -335,13 +331,7 @@ impl TaskEncoder for WandEnc {
)
})?;

let coupled_edges = shape.coupled_edges().map_err(|e| {
EncodeFullError::EncodingError(
WandEncError::Unsupported(format!("coupled edges: {e:?}")),
None,
)
})?;

let coupled_edges = shape.coupled_edges();
let (inputs, outputs) = shape.take_inputs_and_outputs();
let spec = deps.require_dep::<MirSpecEnc>((def_id, false))?;
if coupled_edges.is_empty() {
Expand Down
10 changes: 4 additions & 6 deletions prusti-encoder/src/encoders/local_def.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,10 @@ impl MirLocalDefEncTask {
}
MirLocalDefEncTask::Local { def_id, .. } => {
if should_encode_locals(vcx, def_id) {
let substs = ty::GenericArgs::identity_for_item(vcx.tcx(), def_id);
Some(vcx.body_mut().get_impure_fn_body(
def_id.as_local().unwrap(),
substs,
None,
))
Some(
vcx.body_mut()
.get_impure_fn_body_identity(def_id.as_local().unwrap()),
)
} else {
None
}
Expand Down
2 changes: 1 addition & 1 deletion prusti-encoder/src/encoders/mir_fn/method.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ impl TaskEncoder for MethodEnc {
let mut pres = Vec::new();
let mut posts = Vec::new();
let spec = deps.require_dep_spanned::<MirSpecEnc>((def_id, false), span)?;
let function_data = FunctionData::new(def_id, params.rust_params(), None);
let function_data = FunctionData::new(def_id);
let wands = deps.require_dep_spanned::<WandEnc>(
WandEncTask {
data: function_data,
Expand Down
2 changes: 1 addition & 1 deletion prusti-encoder/src/encoders/mir_impure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ use pcg::{
borrow_pcg_expansion::BorrowPcgExpansion,
edge::{
abstraction::{AbstractionEdge, FunctionCallOrLoop},
borrow_flow::BorrowFlowEdgeKind,
kind::BorrowPcgEdgeKind,
outlives::BorrowFlowEdgeKind,
},
region_projection::PlaceOrConst,
state::BorrowsState,
Expand Down
4 changes: 2 additions & 2 deletions prusti-encoder/src/encoders/ty/rust_ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ pub struct RustTyDecomposition<'tcx> {
pub maybe_inhabited: bool,
}

impl<'tcx, Ctxt> HasRegions<'tcx, Ctxt> for RustTyDecomposition<'tcx> {
fn regions(&self, _ctxt: Ctxt) -> IndexVec<RegionIdx, PcgRegion> {
impl<'tcx, Ctxt: Copy> HasRegions<'tcx, Ctxt> for RustTyDecomposition<'tcx> {
fn regions(&self, _ctxt: Ctxt) -> IndexVec<RegionIdx, PcgRegion<'tcx>> {
self.args
.args()
.iter()
Expand Down
Loading