Skip to content
Merged
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
3 changes: 0 additions & 3 deletions .cargo/config
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ move-clippy = [
"-Aclippy::manual_slice_size_calculation",
"-Aclippy::unwrap-or-default",
"-Aclippy::incorrect_partial_ord_impl_on_ord_type",
"-Aclippy::useless_attribute",
"-Aclippy::manual_while_let_some",
"-Aclippy::redundant_closure",
]

[build]
Expand Down
4 changes: 2 additions & 2 deletions external-crates/move/move-model/src/spec_translator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,15 @@ impl TranslatedSpec {
.mk_join_opt_bool(
Operation::And,
Some(exp.clone()),
code.as_ref().map(|c| eq_code(c)),
code.as_ref().map(eq_code),
)
.unwrap()
})
.chain(
self.aborts_with
.iter()
.flat_map(|(_, codes)| codes.iter())
.map(|c| eq_code(c)),
.map(eq_code),
),
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -707,8 +707,7 @@ impl TypeIdentToken {

segments.reverse();
let mut cursor = segments.pop().unwrap();
while !segments.is_empty() {
let next = segments.pop().unwrap();
while let Some(next) = segments.pop() {
cursor = format!("ConcatVec({}, {})", cursor, next);
}
cursor
Expand Down
9 changes: 3 additions & 6 deletions external-crates/move/move-prover/bytecode/src/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ impl<T: Ord + Copy + Debug> Graph<T> {
let mut stack = vec![];
visited.insert(self.entry, false);
stack.push(self.entry);
while !stack.is_empty() {
let n = stack.pop().unwrap();
while let Some(n) = stack.pop() {
if visited[&n] {
visited.entry(n).and_modify(|x| {
*x = false;
Expand Down Expand Up @@ -122,8 +121,7 @@ impl<T: Ord + Copy + Debug> Graph<T> {
loop_body.insert(loop_latch);
stack.push(loop_latch);
}
while !stack.is_empty() {
let m = stack.pop().unwrap();
while let Some(m) = stack.pop() {
for p in &self.predecessors[&m] {
if !loop_body.contains(p) {
loop_body.insert(*p);
Expand Down Expand Up @@ -194,8 +192,7 @@ impl<T: Ord + Copy + Debug> DomRelation<T> {
let mut grey = BTreeSet::new();
stack.push(graph.entry);
visited.insert(graph.entry);
while !stack.is_empty() {
let curr = stack.pop().unwrap();
while let Some(curr) = stack.pop() {
if grey.contains(&curr) {
let curr_num = self.postorder_num_to_node.len();
self.postorder_num_to_node.push(curr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,7 @@ impl<'a> Analyzer<'a> {

// Next do todo-list for regular functions, while self.inst_opt contains the
// specific instantiation.
while !self.todo_funs.is_empty() {
let (fun, variant, inst) = self.todo_funs.pop().unwrap();
while let Some((fun, variant, inst)) = self.todo_funs.pop() {
self.inst_opt = Some(inst);
self.analyze_fun(
self.targets
Expand All @@ -246,8 +245,7 @@ impl<'a> Analyzer<'a> {
}

// Finally do spec functions, after all regular functions and axioms are done.
while !self.todo_spec_funs.is_empty() {
let (fun, inst) = self.todo_spec_funs.pop().unwrap();
while let Some((fun, inst)) = self.todo_spec_funs.pop() {
self.inst_opt = Some(inst);
self.analyze_spec_fun(fun);
let inst = std::mem::take(&mut self.inst_opt).unwrap();
Expand Down
5 changes: 2 additions & 3 deletions external-crates/move/tools/move-cli/src/sandbox/utils/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) The Diem Core Contributors
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0
#[allow(hidden_glob_reexports)]
#![allow(hidden_glob_reexports)]
use crate::sandbox::utils::on_disk_state_view::OnDiskStateView;
use anyhow::{bail, Result};
use colored::Colorize;
Expand Down Expand Up @@ -391,8 +391,7 @@ pub(crate) fn explain_publish_error(
stack.push((code_cache.get_module(&dep)?, false));
}

while !stack.is_empty() {
let (cur, is_exit) = stack.pop().unwrap();
while let Some((cur, is_exit)) = stack.pop() {
let cur_id = cur.self_id();
if is_exit {
state.insert(cur_id, false);
Expand Down