Skip to content

Commit 010f6bb

Browse files
Aurel300vakaras
authored andcommitted
wip
1 parent 4f104f4 commit 010f6bb

File tree

16 files changed

+323
-491
lines changed

16 files changed

+323
-491
lines changed

prusti-interface/src/environment/body.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,13 @@ impl<'tcx> EnvBody<'tcx> {
169169
let monomorphised = if let Some(caller_def_id) = caller_def_id {
170170
let param_env = self.tcx.param_env(caller_def_id);
171171
self.tcx
172-
.subst_and_normalize_erasing_regions(substs, param_env, body.0)
172+
.subst_and_normalize_erasing_regions(
173+
substs,
174+
param_env,
175+
ty::EarlyBinder::bind(body.0),
176+
)
173177
} else {
174-
ty::EarlyBinder(body.0).subst(self.tcx, substs)
178+
ty::EarlyBinder::bind(body.0).subst(self.tcx, substs)
175179
};
176180
v.insert(MirBody(monomorphised)).clone()
177181
} else {

prusti-interface/src/environment/diagnostic.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ impl<'tcx> EnvDiagnostic<'tcx> {
4444
help: &Option<String>,
4545
notes: &[(String, Option<S>)],
4646
) {
47-
let mut diagnostic = self.tcx.sess.struct_err(msg);
47+
let mut diagnostic = self.tcx.sess.struct_err(msg.to_string());
4848
Self::configure_diagnostic(&mut diagnostic, sp, help, notes);
4949
for warn in self.warn_buffer.borrow_mut().iter_mut() {
5050
self.tcx.sess.diagnostic().emit_diagnostic(warn);
@@ -60,7 +60,7 @@ impl<'tcx> EnvDiagnostic<'tcx> {
6060
help: &Option<String>,
6161
notes: &[(String, Option<S>)],
6262
) {
63-
let mut diagnostic = self.tcx.sess.struct_warn(msg);
63+
let mut diagnostic = self.tcx.sess.struct_warn(msg.to_string());
6464
Self::configure_diagnostic(&mut diagnostic, sp, help, notes);
6565
diagnostic.emit();
6666
}
@@ -73,7 +73,7 @@ impl<'tcx> EnvDiagnostic<'tcx> {
7373
help: &Option<String>,
7474
notes: &[(String, Option<S>)],
7575
) {
76-
let mut diagnostic = self.tcx.sess.struct_warn(msg);
76+
let mut diagnostic = self.tcx.sess.struct_warn(msg.to_string());
7777
Self::configure_diagnostic(&mut diagnostic, sp, help, notes);
7878
diagnostic.buffer(&mut self.warn_buffer.borrow_mut());
7979
}

prusti-interface/src/environment/query.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ impl<'tcx> EnvQuery<'tcx> {
161161
) -> ty::PolyFnSig<'tcx> {
162162
let def_id = def_id.into_param();
163163
let sig = if self.tcx.is_closure(def_id) {
164-
ty::EarlyBinder(substs.as_closure().sig())
164+
ty::EarlyBinder::bind(substs.as_closure().sig())
165165
} else {
166166
self.tcx.fn_sig(def_id)
167167
};
@@ -255,7 +255,7 @@ impl<'tcx> EnvQuery<'tcx> {
255255
// more precisely. We can do this directly with `impl_method_substs`
256256
// because they contain the substs for the `impl` block as a prefix.
257257
let call_trait_substs =
258-
ty::EarlyBinder(trait_ref.substs).subst(self.tcx, impl_method_substs);
258+
ty::EarlyBinder::bind(trait_ref.substs).subst(self.tcx, impl_method_substs);
259259
let impl_substs = self.identity_substs(impl_def_id);
260260
let trait_method_substs = self.tcx.mk_substs_from_iter(
261261
call_trait_substs
@@ -284,7 +284,7 @@ impl<'tcx> EnvQuery<'tcx> {
284284
debug!("Fetching implementations of method '{:?}' defined in trait '{}' with substs '{:?}'", proc_def_id, self.tcx.def_path_str(trait_id), substs);
285285
let infcx = self.tcx.infer_ctxt().build();
286286
let mut sc = SelectionContext::new(&infcx);
287-
let trait_ref = self.tcx.mk_trait_ref(trait_id, substs);
287+
let trait_ref = ty::TraitRef::new(self.tcx, trait_id, substs);
288288
let obligation = Obligation::new(
289289
self.tcx,
290290
ObligationCause::dummy(),

prusti-viper/src/encoder/encoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ impl<'v, 'tcx> Encoder<'v, 'tcx> {
308308
ct: mir::UnevaluatedConst<'tcx>,
309309
) -> Option<mir::interpret::Scalar> {
310310
let tcx = self.env.tcx();
311-
let param_env = tcx.param_env(ct.def.did);
311+
let param_env = tcx.param_env(ct.def);
312312
tcx.const_eval_resolve(param_env, ct, None)
313313
.ok()
314314
.and_then(|const_value| const_value.try_to_scalar())

prusti-viper/src/encoder/mir/contracts/borrows.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ impl<P: fmt::Debug> fmt::Display for BorrowInfo<P> {
4444
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
4545
let lifetime = match self.region {
4646
None => "static".to_string(),
47-
Some(ty::BoundRegionKind::BrAnon(id, _)) => format!("#{id}"),
47+
Some(ty::BoundRegionKind::BrAnon(_)) => "anon".to_string(),
4848
Some(ty::BoundRegionKind::BrNamed(_, name)) => name.to_string(),
4949
_ => unimplemented!(),
5050
};

prusti-viper/src/encoder/mir/procedures/encoder/builtin_function_encoder.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub(super) trait BuiltinFuncAppEncoder<'p, 'v, 'tcx> {
1212
args: &[mir::Operand<'tcx>],
1313
destination: mir::Place<'tcx>,
1414
target: &Option<mir::BasicBlock>,
15-
cleanup: &Option<mir::BasicBlock>,
15+
unwind: mir::UnwindAction,
1616
) -> SpannedEncodingResult<bool>;
1717
}
1818

@@ -28,7 +28,7 @@ impl<'p, 'v, 'tcx> BuiltinFuncAppEncoder<'p, 'v, 'tcx> for super::ProcedureEncod
2828
args: &[mir::Operand<'tcx>],
2929
destination: mir::Place<'tcx>,
3030
target: &Option<mir::BasicBlock>,
31-
cleanup: &Option<mir::BasicBlock>,
31+
unwind: mir::UnwindAction,
3232
) -> SpannedEncodingResult<bool> {
3333
let full_called_function_name = self
3434
.encoder
@@ -192,9 +192,9 @@ impl<'p, 'v, 'tcx> BuiltinFuncAppEncoder<'p, 'v, 'tcx> for super::ProcedureEncod
192192
debug!("Absence of panic will not be checked")
193193
}
194194
assert!(target.is_none());
195-
if let Some(cleanup) = cleanup {
195+
if let mir::UnwindAction::Cleanup(cleanup) = unwind {
196196
let successor =
197-
vir_high::Successor::Goto(self.encode_basic_block_label(*cleanup));
197+
vir_high::Successor::Goto(self.encode_basic_block_label(cleanup));
198198
block_builder.set_successor_jump(successor);
199199
} else {
200200
unimplemented!();

0 commit comments

Comments
 (0)