-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: make lattice_fold and lattice_reduce consistent with fold/reduce (
#902)
- Loading branch information
Showing
18 changed files
with
99 additions
and
136 deletions.
There are no files selected for viewing
26 changes: 22 additions & 4 deletions
26
hydroflow/tests/compile-fail/surface_flow_props_cumul_warn_cumul.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 11 additions & 5 deletions
16
hydroflow/tests/compile-fail/surface_flow_props_cumul_warn_none.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
hydroflow/tests/compile-fail/surface_lattice_fold_noarg.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
error: `lattice_fold` should have exactly 0 generic type arguments, actually has 1. | ||
--> tests/compile-fail/surface_lattice_fold_noarg.rs:6:31 | ||
| | ||
6 | -> lattice_fold::<hydroflow::lattices::set_union::SetUnionHashSet<u32>>() | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: expected 1 argument(s), found 0 | ||
--> tests/compile-fail/surface_lattice_fold_noarg.rs:6:16 | ||
| | ||
6 | -> lattice_fold::<hydroflow::lattices::set_union::SetUnionHashSet<u32>>() | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
5 changes: 0 additions & 5 deletions
5
hydroflow/tests/compile-fail/surface_lattice_fold_nogeneric.stderr
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 4 additions & 28 deletions
32
hydroflow/tests/compile-fail/surface_lattice_fold_wronggeneric.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,5 @@ | ||
warning: `lattice_fold` expects lattice flow input, has sequential input. This may be an error in the future. | ||
--> tests/compile-fail/surface_lattice_fold_wronggeneric.rs:6:16 | ||
error: `lattice_fold` should have exactly 0 generic type arguments, actually has 1. | ||
--> tests/compile-fail/surface_lattice_fold_wronggeneric.rs:6:31 | ||
| | ||
6 | -> lattice_fold::<'static, hydroflow::lattices::set_union::SetUnionHashSet<u32>>() | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error[E0308]: mismatched types | ||
--> tests/compile-fail/surface_lattice_fold_wronggeneric.rs:6:16 | ||
| | ||
4 | let mut df = hydroflow_syntax! { | ||
| __________________- | ||
5 | | source_iter([1,2,3,4,5]) | ||
6 | | -> lattice_fold::<'static, hydroflow::lattices::set_union::SetUnionHashSet<u32>>() | ||
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `SetUnion<_>`, found integer | ||
7 | | -> for_each(|x| println!("Least upper bound: {:?}", x)); | ||
8 | | }; | ||
| |_____- arguments to this function are incorrect | ||
| | ||
= note: expected struct `SetUnion<_>` | ||
found type `{integer}` | ||
note: method defined here | ||
--> $WORKSPACE/lattices/src/lib.rs | ||
| | ||
| fn merge(&mut self, other: Other) -> bool; | ||
| ^^^^^ | ||
help: try wrapping the expression in `hydroflow::lattices::set_union::SetUnion` | ||
| | ||
6 | -> hydroflow::lattices::set_union::SetUnion(lattice_fold::<'static, hydroflow::lattices::set_union::SetUnionHashSet<u32>>()) | ||
| +++++++++++++++++++++++++++++++++++++++++ + | ||
6 | ... -> lattice_fold::<'static, hydroflow::lattices::set_union::SetUnionHashSet<u32>>(hydroflow::lattices::set_union::SetUnionHashSet::<... | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
10 changes: 0 additions & 10 deletions
10
hydroflow/tests/compile-fail/surface_lattice_reduce_nogeneric.rs
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
hydroflow/tests/compile-fail/surface_lattice_reduce_nogeneric.stderr
This file was deleted.
Oops, something went wrong.
22 changes: 3 additions & 19 deletions
22
hydroflow/tests/compile-fail/surface_lattice_reduce_wronggeneric.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,5 @@ | ||
warning: `lattice_reduce` expects lattice flow input, has sequential input. This may be an error in the future. | ||
--> tests/compile-fail/surface_lattice_reduce_wronggeneric.rs:6:16 | ||
error: `lattice_reduce` should have exactly 0 generic type arguments, actually has 1. | ||
--> tests/compile-fail/surface_lattice_reduce_wronggeneric.rs:6:33 | ||
| | ||
6 | -> lattice_reduce::<'static, hydroflow::lattices::set_union::SetUnionHashSet<u32>>() | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error[E0271]: expected `Drain<'_, {integer}>` to be an iterator that yields `SetUnion<HashSet<u32>>`, but it yields `{integer}` | ||
--> tests/compile-fail/surface_lattice_reduce_wronggeneric.rs:5:9 | ||
| | ||
5 | source_iter([1,2,3,4,5]) | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ expected `SetUnion<HashSet<u32>>`, found integer | ||
6 | -> lattice_reduce::<'static, hydroflow::lattices::set_union::SetUnionHashSet<u32>>() | ||
| ---------------------------------------------------- required by a bound introduced by this call | ||
| | ||
= note: expected struct `SetUnion<HashSet<u32>>` | ||
found type `{integer}` | ||
note: required by a bound in `check_inputs` | ||
--> tests/compile-fail/surface_lattice_reduce_wronggeneric.rs:6:42 | ||
| | ||
6 | -> lattice_reduce::<'static, hydroflow::lattices::set_union::SetUnionHashSet<u32>>() | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check_inputs` | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.