diff --git a/.cargo/config b/.cargo/config index ea60d18..8ddeb5a 100644 --- a/.cargo/config +++ b/.cargo/config @@ -3,10 +3,27 @@ # clippy doesn't currently allow for specifiying project-wide lints in a # configuration file. This is a similar workaround to the ones presented here: # -# TODO: add support for --all-features xclippy = [ - "clippy", "--all-targets", "--", + "clippy", "--workspace", "--all-targets", "--", "-Wclippy::all", + "-Wclippy::cast_lossless", + "-Wclippy::dbg_macro", "-Wclippy::disallowed_methods", + "-Wclippy::derive_partial_eq_without_eq", + "-Wclippy::enum_glob_use", + "-Wclippy::filter_map_next", + "-Wclippy::flat_map_option", + "-Wclippy::inefficient_to_string", + "-Wclippy::large_types_passed_by_value", + "-Wclippy::manual_assert", + "-Wclippy::manual_ok_or", + "-Wclippy::map_flatten", + "-Wclippy::map_unwrap_or", + "-Wclippy::needless_borrow", + "-Wclippy::checked_conversions", + "-Wclippy::trait_duplication_in_bounds", + "-Wrust_2018_idioms", + "-Wtrivial_numeric_casts", + "-Wunused_lifetimes", "-Wmissing_debug_implementations", ] diff --git a/crates/bellpepper-core/src/util_cs/test_cs.rs b/crates/bellpepper-core/src/util_cs/test_cs.rs index 50875eb..9fbb317 100644 --- a/crates/bellpepper-core/src/util_cs/test_cs.rs +++ b/crates/bellpepper-core/src/util_cs/test_cs.rs @@ -323,9 +323,11 @@ impl TestConstraintSystem { } fn set_named_obj(&mut self, path: String, to: NamedObject) { - if self.named_objects.contains_key(&path) { - panic!("tried to create object at existing path: {}", path); - } + assert!( + !self.named_objects.contains_key(&path), + "tried to create object at existing path: {}", + path + ); self.named_objects.insert(path, to); } diff --git a/crates/bellpepper/src/util_cs/metric_cs.rs b/crates/bellpepper/src/util_cs/metric_cs.rs index 0c7ff9b..19e8105 100644 --- a/crates/bellpepper/src/util_cs/metric_cs.rs +++ b/crates/bellpepper/src/util_cs/metric_cs.rs @@ -195,9 +195,11 @@ impl MetricCS { } fn set_named_obj(&mut self, path: String, to: NamedObject) { - if self.named_objects.contains_key(&path) { - panic!("tried to create object at existing path: {}", path); - } + assert!( + !self.named_objects.contains_key(&path), + "tried to create object at existing path: {}", + path + ); self.named_objects.insert(path, to); } @@ -284,9 +286,10 @@ impl ConstraintSystem for MetricCS { } fn compute_path(ns: &[String], this: &str) -> String { - if this.chars().any(|a| a == '/') { - panic!("'/' is not allowed in names"); - } + assert!( + !this.chars().any(|a| a == '/'), + "'/' is not allowed in names" + ); let mut name = String::new(); diff --git a/rust-toolchain b/rust-toolchain index 22d6771..5e3a425 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -1.72.1 +1.73.0