Skip to content

Commit

Permalink
another unsafe core proof workaround for trait resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
Aurel300 committed Jul 29, 2022
1 parent e9e5c78 commit fa449f9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
10 changes: 9 additions & 1 deletion prusti-interface/src/environment/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -523,10 +523,18 @@ impl<'tcx> Environment<'tcx> {
called_def_id: ProcedureDefId, // what are we calling?
call_substs: SubstsRef<'tcx>,
) -> (ProcedureDefId, SubstsRef<'tcx>) {
use prusti_rustc_interface::middle::ty::TypeVisitable;

// Avoids a compiler-internal panic
// this check ignores any lifetimes/regions, which at this point would
// need inference. They are thus ignored.
if self.any_type_needs_infer(call_substs) {
// TODO: different behaviour used for unsafe core proof
let needs_infer = if config::unsafe_core_proof() {
call_substs.needs_infer()
} else {
self.any_type_needs_infer(call_substs)
};
if needs_infer {
return (called_def_id, call_substs);
}

Expand Down
5 changes: 3 additions & 2 deletions viper/src/silicon_counterexample.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,9 @@ fn unwrap_model_entry<'a>(
}
"viper.silicon.reporting.LitPermEntry" => {
let lit_perm_wrapper = silicon::reporting::LitPermEntry::with(env);
let value = jni.unwrap_result(lit_perm_wrapper.call_value(entry));
Some(ModelEntry::LitPerm(value.to_string()))
let value_scala = jni.unwrap_result(lit_perm_wrapper.call_value(entry));
let value = jni.to_string(value_scala);
Some(ModelEntry::LitPerm(value))
}
"viper.silicon.reporting.RefEntry" => {
let ref_wrapper = silicon::reporting::RefEntry::with(env);
Expand Down

0 comments on commit fa449f9

Please sign in to comment.