Skip to content
Open
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
12 changes: 12 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
11 changes: 5 additions & 6 deletions benches/benches/futures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,11 @@ impl Future for ManualFut {
type Output = ();

fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
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
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<str>` is implemented for `std::string::String`
help: the trait `Borrow<str>` is implemented for `std::string::String`
--> $RUST/alloc/src/str.rs
|
| impl Borrow<str> for String {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: required by a bound in `HashSet::<T, S>::contains`
--> $RUST/std/src/collections/hash/set.rs
|
Expand Down
107 changes: 64 additions & 43 deletions dfir_rs/tests/compile-fail-stable/surface_demuxenum_wrongenum.stderr
Original file line number Diff line number Diff line change
@@ -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::<Option<()>>();
| ^^^^^^ the trait `DemuxEnumBase` is not implemented for `std::option::Option<()>`
22 | ]) -> demux_enum::<WrongEnum>();
| ^^^^^^^^^ 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::<Option<()>>();
| ^^^^^^ 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::<WrongEnum>();
| ^^^^^^^^^ 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::<WrongEnum>();
| ^^^^^^^^^ unsatisfied trait bound
|
17 | ]) -> demux_enum::<Option<()>>();
| ^^^^^^^^^^ 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::<Option<()>>();
22 | ]) -> demux_enum::<WrongEnum>();
| ^^^^^^^^^^ 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::<Option<()>>();
22 | ]) -> demux_enum::<WrongEnum>();
| ^^^^^^^^^^ 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::<Option<()>>();
22 | ]) -> demux_enum::<WrongEnum>();
| ^^^^^^^^^^ 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<std::option::Option<()>, Error = Infallible>: dfir_rs::futures::Sink<Shape>` is not satisfied
--> tests/compile-fail-stable/surface_demuxenum_wrongenum.rs:17:15
error[E0277]: the trait bound `impl dfir_rs::futures::Sink<WrongEnum, Error = Infallible>: dfir_rs::futures::Sink<Shape>` is not satisfied
--> tests/compile-fail-stable/surface_demuxenum_wrongenum.rs:22:15
|
17 | ]) -> demux_enum::<Option<()>>();
| ^^^^^^^^^^ the trait `dfir_rs::futures::Sink<Shape>` is not implemented for `impl dfir_rs::futures::Sink<std::option::Option<()>, Error = Infallible>`
22 | ]) -> demux_enum::<WrongEnum>();
| ^^^^^^^^^^ unsatisfied trait bound
|
= help: the trait `dfir_rs::futures::Sink<Shape>` is not implemented for `impl dfir_rs::futures::Sink<WrongEnum, Error = Infallible>`
= help: the following other types implement trait `dfir_rs::futures::Sink<Item>`:
`&dfir_rs::futures::futures_channel::mpsc::UnboundedSender<T>` implements `dfir_rs::futures::Sink<T>`
`&mut S` implements `dfir_rs::futures::Sink<Item>`
Expand All @@ -78,7 +99,7 @@ error[E0277]: the trait bound `impl dfir_rs::futures::Sink<std::option::Option<(
`DemuxVar<Sinks, Error>` 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::<Option<()>>();
22 | ]) -> demux_enum::<WrongEnum>();
| ^^^^^^^^^^ required by this bound in `pivot_run_sg_1v1`
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ error[E0277]: the trait bound `impl dfir_rs::futures::Sink<u32, Error = Infallib
--> tests/compile-fail-stable/surface_demuxenum_wrongfields_1.rs:17:28
|
17 | ]) -> demux_enum::<Shape>();
| ^^^^^ 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<Item>`:
`&dfir_rs::futures::futures_channel::mpsc::UnboundedSender<T>` implements `dfir_rs::futures::Sink<T>`
`&mut S` implements `dfir_rs::futures::Sink<Item>`
Expand Down Expand Up @@ -32,8 +33,9 @@ error[E0277]: the trait bound `impl dfir_rs::futures::Sink<u32, Error = Infallib
--> tests/compile-fail-stable/surface_demuxenum_wrongfields_1.rs:17:15
|
17 | ]) -> demux_enum::<Shape>();
| ^^^^^^^^^^ 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<Item>`:
`&dfir_rs::futures::futures_channel::mpsc::UnboundedSender<T>` implements `dfir_rs::futures::Sink<T>`
`&mut S` implements `dfir_rs::futures::Sink<Item>`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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::<Shape>();
| ^^^^^ 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<Item>`:
`&dfir_rs::futures::futures_channel::mpsc::UnboundedSender<T>` implements `dfir_rs::futures::Sink<T>`
`&mut S` implements `dfir_rs::futures::Sink<Item>`
Expand Down Expand Up @@ -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::<Shape>();
| ^^^^^^^^^^ 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<Item>`:
`&dfir_rs::futures::futures_channel::mpsc::UnboundedSender<T>` implements `dfir_rs::futures::Sink<T>`
`&mut S` implements `dfir_rs::futures::Sink<Item>`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ error[E0277]: the trait bound `impl dfir_rs::futures::Sink<Shape, Error = Infall
--> tests/compile-fail-stable/surface_demuxenum_wrongtype.rs:13:41
|
13 | my_demux = source_iter(0..5) -> demux_enum::<Shape>();
| ^^^^^^^^^^ the trait `dfir_rs::futures::Sink<{integer}>` is not implemented for `impl dfir_rs::futures::Sink<Shape, Error = Infallible>`
| ^^^^^^^^^^ unsatisfied trait bound
|
= help: the trait `dfir_rs::futures::Sink<{integer}>` is not implemented for `impl dfir_rs::futures::Sink<Shape, Error = Infallible>`
= help: the following other types implement trait `dfir_rs::futures::Sink<Item>`:
`&dfir_rs::futures::futures_channel::mpsc::UnboundedSender<T>` implements `dfir_rs::futures::Sink<T>`
`&mut S` implements `dfir_rs::futures::Sink<Item>`
Expand Down
Original file line number Diff line number Diff line change
@@ -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<u32>>(dfir_rs::lattices::set_union::SetUnionHashSet::<u32>...
| ^^^^^^^
7 | -> lattice_fold::<'static, SetUnionHashSet<u32>>(SetUnionHashSet::<u32>::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
7 changes: 6 additions & 1 deletion dfir_rs/tests/compile-fail/surface_demuxenum_wrongenum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<Option<()>>();
]) -> demux_enum::<WrongEnum>();
my_demux[Rectangle] -> for_each(std::mem::drop);
my_demux[Circle] -> for_each(std::mem::drop);
my_demux[Square] -> for_each(std::mem::drop);
Expand Down
Original file line number Diff line number Diff line change
@@ -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<u32>>(dfir_rs::lattices::set_union::SetUnionHashSet::<u32>::default())
-> lattice_fold::<'static, SetUnionHashSet<u32>>(SetUnionHashSet::<u32>::default())
-> for_each(|x| println!("Least upper bound: {:?}", x));
};
df.run_available_sync();
Expand Down
8 changes: 4 additions & 4 deletions hydro_lang/src/compile/ir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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<HydroRoot> {
Expand Down
10 changes: 4 additions & 6 deletions hydro_lang/src/deploy/deploy_graph_containerized_ecs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();

Expand Down
Loading
Loading