From d32df017ecbcb37b1f3353f0fd01589f2b19d91b Mon Sep 17 00:00:00 2001 From: Mingwei Samuel Date: Fri, 6 Mar 2026 22:09:28 +0000 Subject: [PATCH] chore: update to rust 1.93.1, enable a few more clippy lints --- Cargo.toml | 12 ++ benches/benches/futures.rs | 11 +- .../surface_anti_join_badtypes.stderr | 6 +- .../surface_demuxenum_wrongenum.stderr | 107 +++++++++++------- .../surface_demuxenum_wrongfields_1.stderr | 6 +- .../surface_demuxenum_wrongfields_2.stderr | 6 +- .../surface_demuxenum_wrongtype.stderr | 3 +- .../surface_lattice_fold_wronggeneric.stderr | 14 ++- .../surface_demuxenum_wrongenum.rs | 7 +- .../surface_lattice_fold_wronggeneric.rs | 3 +- hydro_lang/src/compile/ir/mod.rs | 8 +- .../deploy/deploy_graph_containerized_ecs.rs | 10 +- .../deploy/deploy_runtime_containerized.rs | 12 +- hydro_lang/src/location/cluster.rs | 4 +- hydro_lang/src/sim/builder.rs | 2 +- hydro_lang/src/sim/compiled.rs | 8 +- hydro_lang/src/sim/graph.rs | 12 +- hydro_lang/src/viz/json.rs | 5 +- .../non_commutative.stderr | 8 +- hydro_test/examples/http_counter.rs | 4 +- hydro_test/examples/http_hello.rs | 4 +- lattices/src/algebra.rs | 4 +- rust-toolchain.toml | 2 +- .../compile-fail/var_type_badtype.stderr | 2 +- .../compile-fail/var_type_badtype_call.stderr | 2 +- .../var_type_spread_badtype.stderr | 13 ++- 26 files changed, 166 insertions(+), 109 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2ee6b08fc6a6..f6c7b6e88d70 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -70,14 +70,26 @@ unused_qualifications = "warn" alloc_instead_of_core = "warn" allow_attributes = "warn" allow_attributes_without_reason = "warn" +as_pointer_underscore = "warn" +as_ptr_cast_mut = "warn" explicit_into_iter_loop = "warn" let_and_return = "allow" +let_underscore_must_use = "allow" +manual_is_variant_and = "warn" +manual_let_else = "warn" +manual_string_new = "warn" +match_bool = "warn" +needless_for_each = "warn" +pub_underscore_fields = "warn" +rc_buffer = "warn" +rc_mutex = "warn" redundant_clone = "warn" self_named_module_files = "warn" str_to_string = "warn" try_err = "warn" uninlined_format_args = "allow" unused_async = "warn" +used_underscore_items = "warn" [workspace.dependencies] stageleft = "0.13.2" diff --git a/benches/benches/futures.rs b/benches/benches/futures.rs index c4002aa09c45..598a29ddedb9 100644 --- a/benches/benches/futures.rs +++ b/benches/benches/futures.rs @@ -26,12 +26,11 @@ impl Future for ManualFut { type Output = (); fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { - match *self.done.borrow() { - true => Poll::Ready(()), - false => { - self.waker.replace(Some(cx.waker().clone())); - Poll::Pending - } + if *self.done.borrow() { + Poll::Ready(()) + } else { + self.waker.replace(Some(cx.waker().clone())); + Poll::Pending } } } diff --git a/dfir_rs/tests/compile-fail-stable/surface_anti_join_badtypes.stderr b/dfir_rs/tests/compile-fail-stable/surface_anti_join_badtypes.stderr index cf55b09a40d8..fb18bf61ee30 100644 --- a/dfir_rs/tests/compile-fail-stable/surface_anti_join_badtypes.stderr +++ b/dfir_rs/tests/compile-fail-stable/surface_anti_join_badtypes.stderr @@ -4,7 +4,11 @@ error[E0277]: the trait bound `&str: Borrow<{integer}>` is not satisfied 5 | j = anti_join() -> for_each(std::mem::drop); | ^^^^^^^^^ the trait `Borrow<{integer}>` is not implemented for `&str` | - = help: the trait `Borrow` is implemented for `std::string::String` +help: the trait `Borrow` is implemented for `std::string::String` + --> $RUST/alloc/src/str.rs + | + | impl Borrow for String { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: required by a bound in `HashSet::::contains` --> $RUST/std/src/collections/hash/set.rs | diff --git a/dfir_rs/tests/compile-fail-stable/surface_demuxenum_wrongenum.stderr b/dfir_rs/tests/compile-fail-stable/surface_demuxenum_wrongenum.stderr index df080289b2b0..de0507af55ea 100644 --- a/dfir_rs/tests/compile-fail-stable/surface_demuxenum_wrongenum.stderr +++ b/dfir_rs/tests/compile-fail-stable/surface_demuxenum_wrongenum.stderr @@ -1,72 +1,93 @@ -error[E0277]: the trait bound `std::option::Option<()>: DemuxEnumBase` is not satisfied - --> tests/compile-fail-stable/surface_demuxenum_wrongenum.rs:17:28 +error[E0277]: the trait bound `WrongEnum: DemuxEnumBase` is not satisfied + --> tests/compile-fail-stable/surface_demuxenum_wrongenum.rs:22:28 | -17 | ]) -> demux_enum::>(); - | ^^^^^^ the trait `DemuxEnumBase` is not implemented for `std::option::Option<()>` +22 | ]) -> demux_enum::(); + | ^^^^^^^^^ unsatisfied trait bound | +help: the trait `DemuxEnumBase` is not implemented for `WrongEnum` + --> tests/compile-fail-stable/surface_demuxenum_wrongenum.rs:12:5 + | +12 | enum WrongEnum { + | ^^^^^^^^^^^^^^ = note: use `#[derive(dfir_rs::DemuxEnum)]` - = help: the trait `DemuxEnumBase` is implemented for `Shape` -note: required by a bound in `check_impl_demux_enum` - --> tests/compile-fail-stable/surface_demuxenum_wrongenum.rs:17:28 +help: the trait `DemuxEnumBase` is implemented for `Shape` + --> tests/compile-fail-stable/surface_demuxenum_wrongenum.rs:5:14 | -17 | ]) -> demux_enum::>(); - | ^^^^^^ required by this bound in `check_impl_demux_enum` - -error[E0599]: no variant named `Circle` found for enum `std::option::Option<()>` - --> tests/compile-fail-stable/surface_demuxenum_wrongenum.rs:19:18 + 5 | #[derive(DemuxEnum)] + | ^^^^^^^^^ +note: required by a bound in `check_impl_demux_enum` + --> tests/compile-fail-stable/surface_demuxenum_wrongenum.rs:22:28 | -19 | my_demux[Circle] -> for_each(std::mem::drop); - | ^^^^^^ variant not found in `std::option::Option<()>` +22 | ]) -> demux_enum::(); + | ^^^^^^^^^ required by this bound in `check_impl_demux_enum` + = note: this error originates in the derive macro `DemuxEnum` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0599]: no variant named `Rectangle` found for enum `std::option::Option<()>` - --> tests/compile-fail-stable/surface_demuxenum_wrongenum.rs:18:18 +error[E0599]: no variant named `Circle` found for enum `WrongEnum` + --> tests/compile-fail-stable/surface_demuxenum_wrongenum.rs:24:18 | -18 | my_demux[Rectangle] -> for_each(std::mem::drop); - | ^^^^^^^^^ variant not found in `std::option::Option<()>` +12 | enum WrongEnum { + | -------------- variant `Circle` not found here +... +24 | my_demux[Circle] -> for_each(std::mem::drop); + | ^^^^^^ variant not found in `WrongEnum` -error[E0599]: no variant named `Square` found for enum `std::option::Option<()>` - --> tests/compile-fail-stable/surface_demuxenum_wrongenum.rs:20:18 +error[E0277]: the trait bound `WrongEnum: DemuxEnumSink<_>` is not satisfied + --> tests/compile-fail-stable/surface_demuxenum_wrongenum.rs:22:28 | -20 | my_demux[Square] -> for_each(std::mem::drop); - | ^^^^^^ variant not found in `std::option::Option<()>` - -error[E0277]: the trait bound `std::option::Option<()>: DemuxEnumSink<_>` is not satisfied - --> tests/compile-fail-stable/surface_demuxenum_wrongenum.rs:17:28 +22 | ]) -> demux_enum::(); + | ^^^^^^^^^ unsatisfied trait bound | -17 | ]) -> demux_enum::>(); - | ^^^^^^^^^^ the trait `DemuxEnumSink<_>` is not implemented for `std::option::Option<()>` +help: the trait `DemuxEnumSink<_>` is not implemented for `WrongEnum` + --> tests/compile-fail-stable/surface_demuxenum_wrongenum.rs:12:5 | +12 | enum WrongEnum { + | ^^^^^^^^^^^^^^ = note: ensure there is exactly one output for each enum variant. = note: ensure that the type for each output is a tuple of the field for the variant: `()`, `(a,)`, or `(a, b, ...)`. - = help: the trait `DemuxEnumSink<(Pin<&mut __SinkCircle>, Pin<&mut __SinkRectangle>, Pin<&mut __SinkSquare>)>` is implemented for `Shape` +help: the trait `DemuxEnumSink<(Pin<&mut __SinkCircle>, Pin<&mut __SinkRectangle>, Pin<&mut __SinkSquare>)>` is implemented for `Shape` + --> tests/compile-fail-stable/surface_demuxenum_wrongenum.rs:5:14 + | + 5 | #[derive(DemuxEnum)] + | ^^^^^^^^^ note: required by a bound in `demux_enum_guard` - --> tests/compile-fail-stable/surface_demuxenum_wrongenum.rs:17:15 + --> tests/compile-fail-stable/surface_demuxenum_wrongenum.rs:22:15 | -17 | ]) -> demux_enum::>(); +22 | ]) -> demux_enum::(); | ^^^^^^^^^^ required by this bound in `demux_enum_guard` + = note: this error originates in the derive macro `DemuxEnum` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `std::option::Option<()>: DemuxEnumSink<(Pin<&mut impl dfir_rs::futures::Sink<_, Error = Infallible>>, Pin<&mut impl dfir_rs::futures::Sink<_, Error = Infallible>>, Pin<&mut impl dfir_rs::futures::Sink<_, Error = Infallible>>)>` is not satisfied - --> tests/compile-fail-stable/surface_demuxenum_wrongenum.rs:17:15 +error[E0277]: the trait bound `WrongEnum: DemuxEnumSink<(Pin<&mut impl dfir_rs::futures::Sink<_, Error = Infallible>>, Pin<&mut impl dfir_rs::futures::Sink<_, Error = Infallible>>, Pin<&mut impl dfir_rs::futures::Sink<_, Error = Infallible>>)>` is not satisfied + --> tests/compile-fail-stable/surface_demuxenum_wrongenum.rs:22:15 | -17 | ]) -> demux_enum::>(); +22 | ]) -> demux_enum::(); | ^^^^^^^^^^ unsatisfied trait bound | - = help: the trait `DemuxEnumSink<(Pin<&mut impl dfir_rs::futures::Sink<_, Error = Infallible>>, Pin<&mut impl dfir_rs::futures::Sink<_, Error = Infallible>>, Pin<&mut impl dfir_rs::futures::Sink<_, Error = Infallible>>)>` is not implemented for `std::option::Option<()>` +help: the trait `DemuxEnumSink<(Pin<&mut impl dfir_rs::futures::Sink<_, Error = Infallible>>, Pin<&mut impl dfir_rs::futures::Sink<_, Error = Infallible>>, Pin<&mut impl dfir_rs::futures::Sink<_, Error = Infallible>>)>` is not implemented for `WrongEnum` + --> tests/compile-fail-stable/surface_demuxenum_wrongenum.rs:12:5 + | +12 | enum WrongEnum { + | ^^^^^^^^^^^^^^ = note: ensure there is exactly one output for each enum variant. = note: ensure that the type for each output is a tuple of the field for the variant: `()`, `(a,)`, or `(a, b, ...)`. - = help: the trait `DemuxEnumSink<(Pin<&mut __SinkCircle>, Pin<&mut __SinkRectangle>, Pin<&mut __SinkSquare>)>` is implemented for `Shape` +help: the trait `DemuxEnumSink<(Pin<&mut __SinkCircle>, Pin<&mut __SinkRectangle>, Pin<&mut __SinkSquare>)>` is implemented for `Shape` + --> tests/compile-fail-stable/surface_demuxenum_wrongenum.rs:5:14 + | + 5 | #[derive(DemuxEnum)] + | ^^^^^^^^^ note: required by a bound in `demux_enum_guard` - --> tests/compile-fail-stable/surface_demuxenum_wrongenum.rs:17:15 + --> tests/compile-fail-stable/surface_demuxenum_wrongenum.rs:22:15 | -17 | ]) -> demux_enum::>(); +22 | ]) -> demux_enum::(); | ^^^^^^^^^^ required by this bound in `demux_enum_guard` + = note: this error originates in the derive macro `DemuxEnum` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `impl dfir_rs::futures::Sink, Error = Infallible>: dfir_rs::futures::Sink` is not satisfied - --> tests/compile-fail-stable/surface_demuxenum_wrongenum.rs:17:15 +error[E0277]: the trait bound `impl dfir_rs::futures::Sink: dfir_rs::futures::Sink` is not satisfied + --> tests/compile-fail-stable/surface_demuxenum_wrongenum.rs:22:15 | -17 | ]) -> demux_enum::>(); - | ^^^^^^^^^^ the trait `dfir_rs::futures::Sink` is not implemented for `impl dfir_rs::futures::Sink, Error = Infallible>` +22 | ]) -> demux_enum::(); + | ^^^^^^^^^^ unsatisfied trait bound | + = help: the trait `dfir_rs::futures::Sink` is not implemented for `impl dfir_rs::futures::Sink` = help: the following other types implement trait `dfir_rs::futures::Sink`: `&dfir_rs::futures::futures_channel::mpsc::UnboundedSender` implements `dfir_rs::futures::Sink` `&mut S` implements `dfir_rs::futures::Sink` @@ -78,7 +99,7 @@ error[E0277]: the trait bound `impl dfir_rs::futures::Sink` implements `dfir_rs::futures::Sink<(usize, Item)>` and $N others note: required by a bound in `pivot_run_sg_1v1` - --> tests/compile-fail-stable/surface_demuxenum_wrongenum.rs:17:15 + --> tests/compile-fail-stable/surface_demuxenum_wrongenum.rs:22:15 | -17 | ]) -> demux_enum::>(); +22 | ]) -> demux_enum::(); | ^^^^^^^^^^ required by this bound in `pivot_run_sg_1v1` diff --git a/dfir_rs/tests/compile-fail-stable/surface_demuxenum_wrongfields_1.stderr b/dfir_rs/tests/compile-fail-stable/surface_demuxenum_wrongfields_1.stderr index 0bf16778c827..4eaff8a18d84 100644 --- a/dfir_rs/tests/compile-fail-stable/surface_demuxenum_wrongfields_1.stderr +++ b/dfir_rs/tests/compile-fail-stable/surface_demuxenum_wrongfields_1.stderr @@ -2,8 +2,9 @@ error[E0277]: the trait bound `impl dfir_rs::futures::Sink tests/compile-fail-stable/surface_demuxenum_wrongfields_1.rs:17:28 | 17 | ]) -> demux_enum::(); - | ^^^^^ the trait `dfir_rs::futures::Sink<(f64,)>` is not implemented for `impl dfir_rs::futures::Sink` + | ^^^^^ unsatisfied trait bound | + = help: the trait `dfir_rs::futures::Sink<(f64,)>` is not implemented for `impl dfir_rs::futures::Sink` = help: the following other types implement trait `dfir_rs::futures::Sink`: `&dfir_rs::futures::futures_channel::mpsc::UnboundedSender` implements `dfir_rs::futures::Sink` `&mut S` implements `dfir_rs::futures::Sink` @@ -32,8 +33,9 @@ error[E0277]: the trait bound `impl dfir_rs::futures::Sink tests/compile-fail-stable/surface_demuxenum_wrongfields_1.rs:17:15 | 17 | ]) -> demux_enum::(); - | ^^^^^^^^^^ the trait `dfir_rs::futures::Sink<(f64,)>` is not implemented for `impl dfir_rs::futures::Sink` + | ^^^^^^^^^^ unsatisfied trait bound | + = help: the trait `dfir_rs::futures::Sink<(f64,)>` is not implemented for `impl dfir_rs::futures::Sink` = help: the following other types implement trait `dfir_rs::futures::Sink`: `&dfir_rs::futures::futures_channel::mpsc::UnboundedSender` implements `dfir_rs::futures::Sink` `&mut S` implements `dfir_rs::futures::Sink` diff --git a/dfir_rs/tests/compile-fail-stable/surface_demuxenum_wrongfields_2.stderr b/dfir_rs/tests/compile-fail-stable/surface_demuxenum_wrongfields_2.stderr index 0103b4b1bd95..98dd01218faf 100644 --- a/dfir_rs/tests/compile-fail-stable/surface_demuxenum_wrongfields_2.stderr +++ b/dfir_rs/tests/compile-fail-stable/surface_demuxenum_wrongfields_2.stderr @@ -2,8 +2,9 @@ error[E0277]: the trait bound `impl dfir_rs::futures::Sink<(u32,), Error = Infal --> tests/compile-fail-stable/surface_demuxenum_wrongfields_2.rs:17:28 | 17 | ]) -> demux_enum::(); - | ^^^^^ the trait `dfir_rs::futures::Sink<(f64,)>` is not implemented for `impl dfir_rs::futures::Sink<(u32,), Error = Infallible>` + | ^^^^^ unsatisfied trait bound | + = help: the trait `dfir_rs::futures::Sink<(f64,)>` is not implemented for `impl dfir_rs::futures::Sink<(u32,), Error = Infallible>` = help: the following other types implement trait `dfir_rs::futures::Sink`: `&dfir_rs::futures::futures_channel::mpsc::UnboundedSender` implements `dfir_rs::futures::Sink` `&mut S` implements `dfir_rs::futures::Sink` @@ -32,8 +33,9 @@ error[E0277]: the trait bound `impl dfir_rs::futures::Sink<(u32,), Error = Infal --> tests/compile-fail-stable/surface_demuxenum_wrongfields_2.rs:17:15 | 17 | ]) -> demux_enum::(); - | ^^^^^^^^^^ the trait `dfir_rs::futures::Sink<(f64,)>` is not implemented for `impl dfir_rs::futures::Sink<(u32,), Error = Infallible>` + | ^^^^^^^^^^ unsatisfied trait bound | + = help: the trait `dfir_rs::futures::Sink<(f64,)>` is not implemented for `impl dfir_rs::futures::Sink<(u32,), Error = Infallible>` = help: the following other types implement trait `dfir_rs::futures::Sink`: `&dfir_rs::futures::futures_channel::mpsc::UnboundedSender` implements `dfir_rs::futures::Sink` `&mut S` implements `dfir_rs::futures::Sink` diff --git a/dfir_rs/tests/compile-fail-stable/surface_demuxenum_wrongtype.stderr b/dfir_rs/tests/compile-fail-stable/surface_demuxenum_wrongtype.stderr index 401c99cc5466..328029c88836 100644 --- a/dfir_rs/tests/compile-fail-stable/surface_demuxenum_wrongtype.stderr +++ b/dfir_rs/tests/compile-fail-stable/surface_demuxenum_wrongtype.stderr @@ -2,8 +2,9 @@ error[E0277]: the trait bound `impl dfir_rs::futures::Sink tests/compile-fail-stable/surface_demuxenum_wrongtype.rs:13:41 | 13 | my_demux = source_iter(0..5) -> demux_enum::(); - | ^^^^^^^^^^ the trait `dfir_rs::futures::Sink<{integer}>` is not implemented for `impl dfir_rs::futures::Sink` + | ^^^^^^^^^^ unsatisfied trait bound | + = help: the trait `dfir_rs::futures::Sink<{integer}>` is not implemented for `impl dfir_rs::futures::Sink` = help: the following other types implement trait `dfir_rs::futures::Sink`: `&dfir_rs::futures::futures_channel::mpsc::UnboundedSender` implements `dfir_rs::futures::Sink` `&mut S` implements `dfir_rs::futures::Sink` diff --git a/dfir_rs/tests/compile-fail-stable/surface_lattice_fold_wronggeneric.stderr b/dfir_rs/tests/compile-fail-stable/surface_lattice_fold_wronggeneric.stderr index 44e6a8708e24..b498d9187008 100644 --- a/dfir_rs/tests/compile-fail-stable/surface_lattice_fold_wronggeneric.stderr +++ b/dfir_rs/tests/compile-fail-stable/surface_lattice_fold_wronggeneric.stderr @@ -1,5 +1,13 @@ error: `lattice_fold` should have exactly 0 generic type arguments, actually has 1. - --> tests/compile-fail-stable/surface_lattice_fold_wronggeneric.rs:6:31 + --> tests/compile-fail-stable/surface_lattice_fold_wronggeneric.rs:7:31 | -6 | ... -> lattice_fold::<'static, dfir_rs::lattices::set_union::SetUnionHashSet>(dfir_rs::lattices::set_union::SetUnionHashSet::... - | ^^^^^^^ +7 | -> lattice_fold::<'static, SetUnionHashSet>(SetUnionHashSet::::default()) + | ^^^^^^^ + +warning: unused import: `dfir_rs::lattices::set_union::SetUnionHashSet` + --> tests/compile-fail-stable/surface_lattice_fold_wronggeneric.rs:2:5 + | +2 | use dfir_rs::lattices::set_union::SetUnionHashSet; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default diff --git a/dfir_rs/tests/compile-fail/surface_demuxenum_wrongenum.rs b/dfir_rs/tests/compile-fail/surface_demuxenum_wrongenum.rs index 65d54e0551b2..b66ced477781 100644 --- a/dfir_rs/tests/compile-fail/surface_demuxenum_wrongenum.rs +++ b/dfir_rs/tests/compile-fail/surface_demuxenum_wrongenum.rs @@ -9,12 +9,17 @@ fn main() { Circle { r: f64 }, } + enum WrongEnum { + Square(f64), + Rectangle { w: f64, h: f64 }, + } + let mut df = dfir_syntax! { my_demux = source_iter([ Shape::Rectangle { w: 10.0, h: 8.0 }, Shape::Square(9.0), Shape::Circle { r: 5.0 }, - ]) -> demux_enum::>(); + ]) -> demux_enum::(); my_demux[Rectangle] -> for_each(std::mem::drop); my_demux[Circle] -> for_each(std::mem::drop); my_demux[Square] -> for_each(std::mem::drop); diff --git a/dfir_rs/tests/compile-fail/surface_lattice_fold_wronggeneric.rs b/dfir_rs/tests/compile-fail/surface_lattice_fold_wronggeneric.rs index a30b5cf3b5f4..f4ad9eda095c 100644 --- a/dfir_rs/tests/compile-fail/surface_lattice_fold_wronggeneric.rs +++ b/dfir_rs/tests/compile-fail/surface_lattice_fold_wronggeneric.rs @@ -1,9 +1,10 @@ use dfir_rs::dfir_syntax; +use dfir_rs::lattices::set_union::SetUnionHashSet; fn main() { let mut df = dfir_syntax! { source_iter([1,2,3,4,5]) - -> lattice_fold::<'static, dfir_rs::lattices::set_union::SetUnionHashSet>(dfir_rs::lattices::set_union::SetUnionHashSet::::default()) + -> lattice_fold::<'static, SetUnionHashSet>(SetUnionHashSet::::default()) -> for_each(|x| println!("Least upper bound: {:?}", x)); }; df.run_available_sync(); diff --git a/hydro_lang/src/compile/ir/mod.rs b/hydro_lang/src/compile/ir/mod.rs index e75defac44ae..1e5717f9ab85 100644 --- a/hydro_lang/src/compile/ir/mod.rs +++ b/hydro_lang/src/compile/ir/mod.rs @@ -1380,14 +1380,14 @@ pub fn traverse_dfir( let mut built_tees = HashMap::new(); let mut next_stmt_id = 0; let mut callback = BuildersOrCallback::Callback(transform_root, transform_node); - ir.iter_mut().for_each(|leaf| { + for leaf in ir.iter_mut() { leaf.emit_core( &mut callback, &mut seen_tees, &mut built_tees, &mut next_stmt_id, ); - }); + } } pub fn transform_bottom_up( @@ -1397,14 +1397,14 @@ pub fn transform_bottom_up( check_well_formed: bool, ) { let mut seen_tees = HashMap::new(); - ir.iter_mut().for_each(|leaf| { + for leaf in ir.iter_mut() { leaf.transform_bottom_up( transform_root, transform_node, &mut seen_tees, check_well_formed, ); - }); + } } pub fn deep_clone(ir: &[HydroRoot]) -> Vec { diff --git a/hydro_lang/src/deploy/deploy_graph_containerized_ecs.rs b/hydro_lang/src/deploy/deploy_graph_containerized_ecs.rs index 1aa18f41c2db..e20b74a88be2 100644 --- a/hydro_lang/src/deploy/deploy_graph_containerized_ecs.rs +++ b/hydro_lang/src/deploy/deploy_graph_containerized_ecs.rs @@ -333,9 +333,8 @@ impl EcsDeploy { }; for (location_id, name_hint, process) in nodes.get_all_processes() { - let raw_id = match location_id { - LocationId::Process(id) => id, - _ => unreachable!(), + let LocationId::Process(raw_id) = location_id else { + unreachable!(); }; let task_family = get_ecs_container_name(&process.name, None); let ports = process.exposed_ports.borrow().clone(); @@ -377,9 +376,8 @@ impl EcsDeploy { } for (location_id, name_hint, cluster) in nodes.get_all_clusters() { - let raw_id = match location_id { - LocationId::Cluster(id) => id, - _ => unreachable!(), + let LocationId::Cluster(raw_id) = location_id else { + unreachable!(); }; let task_family_prefix = cluster.name.clone(); diff --git a/hydro_lang/src/deploy/deploy_runtime_containerized.rs b/hydro_lang/src/deploy/deploy_runtime_containerized.rs index 8e63efb4b9b9..30026dd9e39b 100644 --- a/hydro_lang/src/deploy/deploy_runtime_containerized.rs +++ b/hydro_lang/src/deploy/deploy_runtime_containerized.rs @@ -133,8 +133,8 @@ impl ChannelMux { let magic_frame = match source.next().await { Some(Ok(frame)) => frame, - _ => { - warn!(name: "magic_failed", ?peer, "no magic frame"); + result => { + warn!(name: "magic_failed", ?peer, ?result, "no magic frame"); return; } }; @@ -154,8 +154,8 @@ impl ChannelMux { let version_frame = match source.next().await { Some(Ok(frame)) => frame, - _ => { - warn!(name: "version_failed", ?peer, "no version frame"); + result => { + warn!(name: "version_failed", ?peer, ?result, "no version frame"); return; } }; @@ -175,8 +175,8 @@ impl ChannelMux { let handshake_frame = match source.next().await { Some(Ok(frame)) => frame, - _ => { - warn!(name: "handshake_failed", ?peer, "no handshake frame"); + result => { + warn!(name: "handshake_failed", ?peer, ?result, "no handshake frame"); return; } }; diff --git a/hydro_lang/src/location/cluster.rs b/hydro_lang/src/location/cluster.rs index 8c6f5548f534..b28d43d2991d 100644 --- a/hydro_lang/src/location/cluster.rs +++ b/hydro_lang/src/location/cluster.rs @@ -166,9 +166,7 @@ where where Self: Sized, { - let cluster_id = if let LocationId::Cluster(id) = ctx.root().id() { - id - } else { + let LocationId::Cluster(cluster_id) = ctx.root().id() else { unreachable!() }; diff --git a/hydro_lang/src/sim/builder.rs b/hydro_lang/src/sim/builder.rs index 93fcd4d5aa8d..d77a251ba991 100644 --- a/hydro_lang/src/sim/builder.rs +++ b/hydro_lang/src/sim/builder.rs @@ -1175,5 +1175,5 @@ fn location_for_op(op_meta: &HydroIrOpMetadata) -> (String, String, String) { format!("{:>1$}", "", (colno - 1).try_into().unwrap()), )) }) - .unwrap_or_else(|| ("unknown location".to_owned(), "".to_owned(), "".to_owned())) + .unwrap_or_else(|| ("unknown location".to_owned(), String::new(), String::new())) } diff --git a/hydro_lang/src/sim/compiled.rs b/hydro_lang/src/sim/compiled.rs index 37ce4da4efeb..78291340dbdc 100644 --- a/hydro_lang/src/sim/compiled.rs +++ b/hydro_lang/src/sim/compiled.rs @@ -982,7 +982,7 @@ fn run_hooks(tick_decision_writer: &mut impl std::fmt::Write, hooks: &mut Vec HydroJson<'_, W> { parent_name: Option<&str>, id_remapping: &mut HashMap, ) -> serde_json::Value { - let mut node_obj = match node { - serde_json::Value::Object(obj) => obj, - _ => return node, + let serde_json::Value::Object(mut node_obj) = node else { + return node; }; let current_name = node_obj diff --git a/hydro_lang/tests/compile-fail-stable/non_commutative.stderr b/hydro_lang/tests/compile-fail-stable/non_commutative.stderr index e1dcc5348df8..84a709e69fc6 100644 --- a/hydro_lang/tests/compile-fail-stable/non_commutative.stderr +++ b/hydro_lang/tests/compile-fail-stable/non_commutative.stderr @@ -5,8 +5,12 @@ error[E0277]: Because the input stream has ordering `hydro_lang::live_collection | ^^^^ required for this call | = note: To intentionally process the stream by observing a non-deterministic (shuffled) order of elements, use `.assume_ordering`. This introduces non-determinism so avoid unless necessary. - = help: the trait `ValidCommutativityFor` is not implemented for `NotProved` - but trait `ValidCommutativityFor` is implemented for it +help: the trait `ValidCommutativityFor` is not implemented for `NotProved` + but trait `ValidCommutativityFor` is implemented for it + --> src/properties/mod.rs + | + | impl ValidCommutativityFor for NotProved {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: for that trait implementation, expected `hydro_lang::live_collections::stream::TotalOrder`, found `hydro_lang::live_collections::stream::NoOrder` note: required by a bound in `hydro_lang::prelude::Stream::::fold` --> src/live_collections/stream/mod.rs diff --git a/hydro_test/examples/http_counter.rs b/hydro_test/examples/http_counter.rs index 206263945ec9..e73f6ef326d1 100644 --- a/hydro_test/examples/http_counter.rs +++ b/hydro_test/examples/http_counter.rs @@ -112,9 +112,7 @@ async fn main() -> Result<(), Box> { deployment.start().await.unwrap(); - let port = if let ServerPort::TcpPort(p) = server_port { - p - } else { + let ServerPort::TcpPort(port) = server_port else { panic!("Expected a TCP port"); }; println!("HTTP counter server listening on: http://{:?}", port); diff --git a/hydro_test/examples/http_hello.rs b/hydro_test/examples/http_hello.rs index 039495f05432..229de5e1f43a 100644 --- a/hydro_test/examples/http_hello.rs +++ b/hydro_test/examples/http_hello.rs @@ -113,9 +113,7 @@ async fn main() -> Result<(), Box> { deployment.start().await.unwrap(); - let port = if let ServerPort::TcpPort(p) = server_port { - p - } else { + let ServerPort::TcpPort(port) = server_port else { panic!("Expected a TCP port"); }; println!("HTTP server listening on: http://{:?}", port); diff --git a/lattices/src/algebra.rs b/lattices/src/algebra.rs index 170856dc334e..cb922073d3f5 100644 --- a/lattices/src/algebra.rs +++ b/lattices/src/algebra.rs @@ -1049,7 +1049,7 @@ mod test { semiring( &[ HashSet::from([]), - HashSet::from(["".to_owned()]), + HashSet::from([String::new()]), HashSet::from(["a".to_owned()]), HashSet::from(["aa".to_owned(), "bb".to_owned()]), HashSet::from(["ab".to_owned(), "bb".to_owned(), "cc".to_owned()]), @@ -1072,7 +1072,7 @@ mod test { new_set }, HashSet::from([]), - HashSet::from(["".to_owned()]), + HashSet::from([String::new()]), ) .is_ok() ); diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 103d4815d3b8..ce8d449d33da 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "1.92.0" +channel = "1.93.1" components = [ "rustfmt", "clippy", diff --git a/variadics/tests/compile-fail/var_type_badtype.stderr b/variadics/tests/compile-fail/var_type_badtype.stderr index 380e22f7376c..c7982f9266f6 100644 --- a/variadics/tests/compile-fail/var_type_badtype.stderr +++ b/variadics/tests/compile-fail/var_type_badtype.stderr @@ -1,4 +1,4 @@ -error[E0412]: cannot find type `MyIdent` in this scope +error[E0425]: cannot find type `MyIdent` in this scope --> tests/compile-fail/var_type_badtype.rs:4:41 | 4 | type _List = var_type!(String, u32, MyIdent, bool); diff --git a/variadics/tests/compile-fail/var_type_badtype_call.stderr b/variadics/tests/compile-fail/var_type_badtype_call.stderr index 2c8d01b43e17..e46735cc8cdd 100644 --- a/variadics/tests/compile-fail/var_type_badtype_call.stderr +++ b/variadics/tests/compile-fail/var_type_badtype_call.stderr @@ -1,4 +1,4 @@ -error[E0412]: cannot find type `MyIdent` in this scope +error[E0425]: cannot find type `MyIdent` in this scope --> tests/compile-fail/var_type_badtype_call.rs:4:41 | 4 | type _List = var_type!(String, u32, MyIdent(), bool); diff --git a/variadics/tests/compile-fail/var_type_spread_badtype.stderr b/variadics/tests/compile-fail/var_type_spread_badtype.stderr index c8ff38c3d5e5..7726313bbaa8 100644 --- a/variadics/tests/compile-fail/var_type_spread_badtype.stderr +++ b/variadics/tests/compile-fail/var_type_spread_badtype.stderr @@ -4,6 +4,13 @@ error[E0277]: the trait bound `f64: VariadicExt` is not satisfied 5 | fn check(_: List) {} | ^^^^ the trait `VariadicExt` is not implemented for `f64` | - = help: the following other types implement trait `VariadicExt`: - () - (Item, Rest) +help: the following other types implement trait `VariadicExt` + --> src/lib.rs + | + | / impl VariadicExt for (Item, Rest) + | | where + | | Rest: VariadicExt, + | |______________________^ `(Item, Rest)` +... + | impl VariadicExt for () { + | ^^^^^^^^^^^^^^^^^^^^^^^ `()`