Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - Update dependencies (rustc nightly-2022-05-01, viper v.22.04.17-release) #990

Closed
wants to merge 7 commits into from
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
836 changes: 322 additions & 514 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion prusti-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ config = "0.13"
itertools = "0.10.3"
serde = { version = "1.0", features = ["derive"] }
lazy_static = "1.4.0"
uuid = { version = "0.8", features = ["v4"] }
uuid = { version = "1.0", features = ["v4"] }
regex = "1.5"
prusti-utils = { path = "../prusti-utils" }
fxhash = "0.2.1"
2 changes: 1 addition & 1 deletion prusti-launch/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ toml = "0.5"
ctrlc = "3.1"

[target.'cfg(unix)'.dependencies]
nix = "0.23"
nix = "0.24"

[dev-dependencies]
glob = "0.3"
9 changes: 3 additions & 6 deletions prusti-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,9 @@ bincode = "1.0"
url = "2.2.2"
num_cpus = "1.8.0"
serde = { version = "1.0", features = ["derive"] }
# More recent verions of reqwest and warp fail to compile
# due to https://github.com/rust-lang/rust/issues/82151
reqwest = { version = "0.10", features = ["json"] }
warp = "0.2"
# warp 0.2.x only works with tokio 0.2.x
tokio = "0.2"
reqwest = { version = "0.11", features = ["json"] }
warp = "0.3"
tokio = "1.18"

[dev-dependencies]
lazy_static = "1.4.0"
3 changes: 1 addition & 2 deletions prusti-server/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ where
// Here we use a single thread because
// 1. Viper is not thread safe yet (Silicon issue #578), and
// 2. By default Silicon already uses as many cores as possible.
let mut runtime = Builder::new()
.basic_scheduler()
let runtime = Builder::new_current_thread()
.thread_name("prusti-server")
.enable_all()
.build()
Expand Down
3 changes: 1 addition & 2 deletions prusti-server/tests/basic_requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ where
backend_config: Default::default(),
};

Builder::new()
.basic_scheduler()
Builder::new_current_thread()
.enable_all()
.build()
.expect("failed to construct Tokio runtime")
Expand Down
2 changes: 1 addition & 1 deletion prusti-specs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ doctest = false # we have no doc tests
syn = { version = "1.0", features = ["full", "extra-traits", "visit-mut", "parsing", "printing"] }
quote = "1.0"
proc-macro2 = "1.0"
uuid = { version = "0.8", features = ["v4", "serde"] }
uuid = { version = "1.0", features = ["v4", "serde"] }
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
prusti-utils = { path = "../prusti-utils" }
2 changes: 1 addition & 1 deletion prusti-specs/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ pub(crate) fn add_phantom_data_for_generic_params(item_struct: &mut syn::ItemStr

let generate_field_ident = |span: proc_macro2::Span| {
if need_named_fields {
let uuid = Uuid::new_v4().to_simple();
let uuid = Uuid::new_v4().simple();
let field_name = format!("prusti_injected_phantom_field_{}", uuid);
return Some(syn::Ident::new(field_name.as_str(), span));
}
Expand Down
8 changes: 4 additions & 4 deletions prusti-specs/src/specifications/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl Display for SpecificationId {
write!(
f,
"{}",
self.0.to_simple().encode_lower(&mut Uuid::encode_buffer()),
self.0.simple().encode_lower(&mut Uuid::encode_buffer()),
)
}
}
Expand Down Expand Up @@ -97,18 +97,18 @@ impl SpecificationIdGenerator {
}

pub(crate) fn generate_struct_name(item: &syn::ItemImpl) -> String {
let uuid = Uuid::new_v4().to_simple();
let uuid = Uuid::new_v4().simple();
let name_ty = generate_name_for_type(&*item.self_ty).unwrap_or_default();
format!("PrustiStruct{}_{}", name_ty, uuid)
}

pub(crate) fn generate_struct_name_for_trait(item: &syn::ItemTrait) -> String {
let uuid = Uuid::new_v4().to_simple();
let uuid = Uuid::new_v4().simple();
format!("PrustiTrait{}_{}", item.ident, uuid)
}

pub(crate) fn generate_mod_name(ident: &syn::Ident) -> String {
let uuid = Uuid::new_v4().to_simple();
let uuid = Uuid::new_v4().simple();
format!("{}_{}", ident, uuid)
}

Expand Down
2 changes: 1 addition & 1 deletion prusti-specs/src/type_model/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ impl GeneratedIdents {
}
}

let uuid = Uuid::new_v4().to_simple();
let uuid = Uuid::new_v4().simple();

GeneratedIdents {
model_struct_ident: Ident::new(
Expand Down
4 changes: 2 additions & 2 deletions prusti-viper/src/encoder/errors/error_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,14 @@ impl<'tcx> ErrorManager<'tcx> {
}

pub fn get_def_id(&self, ver_error: &VerificationError) -> Option<ProcedureDefId> {
ver_error.pos_id.as_ref()
ver_error.offending_pos_id.as_ref()
.and_then(|id| id.parse().ok())
.and_then(|id| self.position_manager.def_id.get(&id).copied())
}

pub fn translate_verification_error(&self, ver_error: &VerificationError) -> PrustiError {
debug!("Verification error: {:?}", ver_error);
let opt_pos_id: Option<u64> = match ver_error.pos_id {
let opt_pos_id: Option<u64> = match ver_error.offending_pos_id {
Some(ref viper_pos_id) => {
match viper_pos_id.parse() {
Ok(pos_id) => Some(pos_id),
Expand Down
3 changes: 1 addition & 2 deletions prusti-viper/src/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,7 @@ fn verify_programs(env: &Environment, programs: Vec<Program>)
// Here we construct a Tokio runtime to block until completion of the futures returned by
// `client.verify`. However, to report verification errors as early as possible,
// `verify_programs` should return an asynchronous stream of verification results.
let mut runtime = Builder::new()
.basic_scheduler()
let runtime = Builder::new_current_thread()
.thread_name("prusti-viper")
.enable_all()
.build()
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "nightly-2022-04-15"
channel = "nightly-2022-05-01"
components = [ "rustc-dev", "llvm-tools-preview", "rust-std", "rustfmt" ]
profile = "minimal"
4 changes: 4 additions & 0 deletions viper-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,9 @@ fn main() {
java_class!("viper.silver.ast.PermDiv", vec![
constructor!(),
]),
java_class!("viper.silver.ast.Positioned", vec![
method!("pos"),
]),
java_class!("viper.silver.ast.Predicate", vec![
constructor!(),
]),
Expand Down Expand Up @@ -682,6 +685,7 @@ fn main() {
]),
java_class!("viper.silver.verifier.VerificationError", vec![
method!("id"),
method!("offendingNode"),
method!("pos"),
method!("fullId"),
method!("reason"),
Expand Down
2 changes: 1 addition & 1 deletion viper-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v-2022-02-14-1454
v.22.04.17-release
2 changes: 1 addition & 1 deletion viper/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ log = { version = "0.4", features = ["release_max_level_info"] }
error-chain = "0.12"
viper-sys = { path = "../viper-sys" }
jni = { version = "0.19", features = ["invocation"] }
uuid = { version = "0.8", features = ["v4"] }
uuid = { version = "1.0", features = ["v4"] }
serde = { version = "1.0", features = ["derive"] }
bincode = "1.3.3"
rustc-hash = "1.1.0"
Expand Down
6 changes: 6 additions & 0 deletions viper/src/verification_result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ impl VerificationResult {
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct VerificationError {
pub full_id: String,
// Unused since we get pos from the offending_node instead.
// Currently calling pos on e.g. `ExhaleFailed` of Silver returns
// the exhale expression pos, rather than the Exhale node pos.
pub pos_id: Option<String>,
pub offending_pos_id: Option<String>,
pub reason_pos_id: Option<String>,
pub message: String,
pub counterexample: Option<SiliconCounterexample>,
Expand All @@ -40,13 +44,15 @@ impl VerificationError {
pub fn new(
full_id: String,
pos_id: Option<String>,
offending_pos_id: Option<String>,
reason_pos_id: Option<String>,
message: String,
counterexample: Option<SiliconCounterexample>,
) -> Self {
VerificationError {
full_id,
pos_id,
offending_pos_id,
reason_pos_id,
message,
counterexample,
Expand Down
27 changes: 27 additions & 0 deletions viper/src/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ impl<'a> Verifier<'a> {

let verification_error_wrapper = silver::verifier::VerificationError::with(self.env);

let error_node_positioned_wrapper = silver::ast::Positioned::with(self.env);

let failure_context_wrapper = silver::verifier::FailureContext::with(self.env);

let has_identifier_wrapper = silver::ast::HasIdentifier::with(self.env);
Expand Down Expand Up @@ -282,9 +284,34 @@ impl<'a> Verifier<'a> {
None
};

let offending_node = self
.jni
.unwrap_result(verification_error_wrapper.call_offendingNode(viper_error));

let offending_pos = self
.jni
.unwrap_result(error_node_positioned_wrapper.call_pos(offending_node));

let offending_pos_id =
if self
.jni
.is_instance_of(offending_pos, "viper/silver/ast/HasIdentifier")
{
Some(self.jni.get_string(
self.jni.unwrap_result(has_identifier_wrapper.call_id(offending_pos)),
))
} else {
debug!(
"The verifier returned an error whose position has no identifier: {:?}",
self.jni.to_string(viper_error)
);
None
};

errors.push(VerificationError::new(
error_full_id,
pos_id,
offending_pos_id,
reason_pos_id,
message,
counterexample,
Expand Down
4 changes: 2 additions & 2 deletions viper/tests/simple_programs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ fn failure_with_assert_false() {
errors[0].full_id,
"assert.failed:assertion.false".to_string()
);
assert_eq!(errors[0].pos_id, Some("pos-id:123".to_string()));
assert_eq!(errors[0].offending_pos_id, Some("pos-id:123".to_string()));
} else {
unreachable!()
}
Expand Down Expand Up @@ -210,7 +210,7 @@ fn failure_with_assign_if_and_assert() {
errors[0].full_id,
"assert.failed:assertion.false".to_string()
);
assert_eq!(errors[0].pos_id, Some("then".to_string()));
assert_eq!(errors[0].offending_pos_id, Some("then".to_string()));
} else {
unreachable!()
}
Expand Down
2 changes: 1 addition & 1 deletion vir/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ regex = "1.5"
syn = { version = "1.0", features = ["full", "fold", "parsing", "derive"] }
quote = "1.0"
proc-macro2 = { version = "1.0", features = ["span-locations"] }
uuid = { version = "0.8", features = ["v4"] }
uuid = { version = "1.0", features = ["v4"] }
log = { version = "0.4", features = ["release_max_level_info"] }
lazy_static = "1.4.0"
itertools = "0.10.3"
Expand Down