Skip to content

Commit e0c16b1

Browse files
committed
test(hydroflow): update some compile-fail outputs caused by rustc regression (#1152)
rust-lang/rust#123503
1 parent 4f87a95 commit e0c16b1

7 files changed

+213
-1
lines changed

hydroflow/tests/compile-fail/datalog_join_badtypes.stderr

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,66 @@ note: required by a bound in `check_inputs`
1414
|
1515
8 | out(a) :- in1(a, b), in2(b)
1616
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check_inputs`
17+
18+
error[E0271]: expected `impl Iterator<Item = ((&str,), ())>` to be an iterator that yields `(({integer},), _)`, but it yields `((&str,), ())`
19+
--> tests/compile-fail/datalog_join_badtypes.rs:8:9
20+
|
21+
8 | out(a) :- in1(a, b), in2(b)
22+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `(({integer},), _)`, found `((&str,), ())`
23+
|
24+
= note: expected tuple `(({integer},), _)`
25+
found tuple `((&str,), ())`
26+
note: required by a bound in `check_inputs`
27+
--> tests/compile-fail/datalog_join_badtypes.rs:8:9
28+
|
29+
8 | out(a) :- in1(a, b), in2(b)
30+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check_inputs`
31+
32+
error[E0271]: expected `impl Iterator<Item = ((&str,), ())>` to be an iterator that yields `(({integer},), ())`, but it yields `((&str,), ())`
33+
--> tests/compile-fail/datalog_join_badtypes.rs:4:18
34+
|
35+
4 | let mut df = datalog!(r#"
36+
| __________________^
37+
5 | | .input in1 `source_iter(0..10) -> map(|x| (x, x))`
38+
6 | | .input in2 `source_iter(0..10) -> map(|_| ("string",))`
39+
7 | | .output out `null::<(u32,)>()`
40+
8 | | out(a) :- in1(a, b), in2(b)
41+
9 | | "#);
42+
| |_______^ expected `(({integer},), ())`, found `((&str,), ())`
43+
|
44+
= note: expected tuple `(({integer},), ())`
45+
found tuple `((&str,), ())`
46+
note: required by a bound in `check_inputs`
47+
--> tests/compile-fail/datalog_join_badtypes.rs:8:9
48+
|
49+
8 | out(a) :- in1(a, b), in2(b)
50+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check_inputs`
51+
= note: this error originates in the macro `datalog` (in Nightly builds, run with -Z macro-backtrace for more info)
52+
53+
error[E0271]: expected `impl Iterator<Item = ((&str,), ())>` to be an iterator that yields `(({integer},), ())`, but it yields `((&str,), ())`
54+
--> tests/compile-fail/datalog_join_badtypes.rs:7:17
55+
|
56+
7 | .output out `null::<(u32,)>()`
57+
| ^^^ expected `(({integer},), ())`, found `((&str,), ())`
58+
|
59+
= note: expected tuple `(({integer},), ())`
60+
found tuple `((&str,), ())`
61+
note: required by a bound in `check_inputs`
62+
--> tests/compile-fail/datalog_join_badtypes.rs:8:9
63+
|
64+
8 | out(a) :- in1(a, b), in2(b)
65+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check_inputs`
66+
67+
error[E0271]: expected `impl Iterator<Item = ((&str,), ())>` to be an iterator that yields `(({integer},), ())`, but it yields `((&str,), ())`
68+
--> tests/compile-fail/datalog_join_badtypes.rs:7:17
69+
|
70+
7 | .output out `null::<(u32,)>()`
71+
| ^^^^^^^^^^^^^^^^^^^^^ expected `(({integer},), ())`, found `((&str,), ())`
72+
|
73+
= note: expected tuple `(({integer},), ())`
74+
found tuple `((&str,), ())`
75+
note: required by a bound in `check_inputs`
76+
--> tests/compile-fail/datalog_join_badtypes.rs:8:9
77+
|
78+
8 | out(a) :- in1(a, b), in2(b)
79+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check_inputs`

hydroflow/tests/compile-fail/surface_demuxenum_notenum.stderr

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,47 @@ note: required by a bound in `__typeguard_demux_enum_fn`
8787
17 | | };
8888
| |_____^ required by this bound in `__typeguard_demux_enum_fn`
8989
= note: this error originates in the macro `hydroflow_syntax` (in Nightly builds, run with -Z macro-backtrace for more info)
90+
91+
error[E0277]: the trait bound `Shape: DemuxEnum<(impl Pusherator<Item = _>, (impl Pusherator<Item = _>, (impl Pusherator<Item = _>, (impl Pusherator<Item = _>, ()))))>` is not satisfied
92+
--> tests/compile-fail/surface_demuxenum_notenum.rs:12:15
93+
|
94+
12 | ]) -> demux_enum::<Shape>();
95+
| ^^^^^^^^^^^^^^^^^^^^^ the trait `DemuxEnum<(impl Pusherator<Item = _>, (impl Pusherator<Item = _>, (impl Pusherator<Item = _>, (impl Pusherator<Item = _>, ()))))>` is not implemented for `Shape`
96+
|
97+
note: required by a bound in `__typeguard_demux_enum_fn`
98+
--> tests/compile-fail/surface_demuxenum_notenum.rs:8:18
99+
|
100+
8 | let mut df = hydroflow_syntax! {
101+
| __________________^
102+
9 | | my_demux = source_iter([
103+
10 | | Shape { area: 10.0 },
104+
11 | | Shape { area: 9.0 },
105+
... |
106+
16 | | my_demux[Ellipse] -> for_each(std::mem::drop);
107+
17 | | };
108+
| |_____^ required by this bound in `__typeguard_demux_enum_fn`
109+
= note: this error originates in the macro `hydroflow_syntax` (in Nightly builds, run with -Z macro-backtrace for more info)
110+
111+
error[E0277]: the trait bound `Shape: DemuxEnum<(impl Pusherator<Item = _>, (impl Pusherator<Item = _>, (impl Pusherator<Item = _>, (impl Pusherator<Item = _>, ()))))>` is not satisfied
112+
--> tests/compile-fail/surface_demuxenum_notenum.rs:9:20
113+
|
114+
9 | my_demux = source_iter([
115+
| ____________________^
116+
10 | | Shape { area: 10.0 },
117+
11 | | Shape { area: 9.0 },
118+
12 | | ]) -> demux_enum::<Shape>();
119+
| |___________________________________^ the trait `DemuxEnum<(impl Pusherator<Item = _>, (impl Pusherator<Item = _>, (impl Pusherator<Item = _>, (impl Pusherator<Item = _>, ()))))>` is not implemented for `Shape`
120+
|
121+
note: required by a bound in `__typeguard_demux_enum_fn`
122+
--> tests/compile-fail/surface_demuxenum_notenum.rs:8:18
123+
|
124+
8 | let mut df = hydroflow_syntax! {
125+
| __________________^
126+
9 | | my_demux = source_iter([
127+
10 | | Shape { area: 10.0 },
128+
11 | | Shape { area: 9.0 },
129+
... |
130+
16 | | my_demux[Ellipse] -> for_each(std::mem::drop);
131+
17 | | };
132+
| |_____^ required by this bound in `__typeguard_demux_enum_fn`
133+
= note: this error originates in the macro `hydroflow_syntax` (in Nightly builds, run with -Z macro-backtrace for more info)

hydroflow/tests/compile-fail/surface_identity_wronggeneric.stderr

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,27 @@ note: required by a bound in `check_input`
1111
|
1212
5 | source_iter(0..10) -> identity::<String>() -> for_each(std::mem::drop);
1313
| ^^^^^^^^^^^^^^^^^^^^ required by this bound in `check_input`
14+
15+
error[E0271]: expected `impl Iterator<Item = {integer}>` to be an iterator that yields `String`, but it yields `{integer}`
16+
--> tests/compile-fail/surface_identity_wronggeneric.rs:5:31
17+
|
18+
5 | source_iter(0..10) -> identity::<String>() -> for_each(std::mem::drop);
19+
| ^^^^^^^^^^^^^^^^^^^^ expected `String`, found integer
20+
|
21+
note: required by a bound in `check_input`
22+
--> tests/compile-fail/surface_identity_wronggeneric.rs:5:31
23+
|
24+
5 | source_iter(0..10) -> identity::<String>() -> for_each(std::mem::drop);
25+
| ^^^^^^^^^^^^^^^^^^^^ required by this bound in `check_input`
26+
27+
error[E0271]: expected `impl Iterator<Item = {integer}>` to be an iterator that yields `String`, but it yields `{integer}`
28+
--> tests/compile-fail/surface_identity_wronggeneric.rs:5:31
29+
|
30+
5 | source_iter(0..10) -> identity::<String>() -> for_each(std::mem::drop);
31+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `String`, found integer
32+
|
33+
note: required by a bound in `check_input`
34+
--> tests/compile-fail/surface_identity_wronggeneric.rs:5:31
35+
|
36+
5 | source_iter(0..10) -> identity::<String>() -> for_each(std::mem::drop);
37+
| ^^^^^^^^^^^^^^^^^^^^ required by this bound in `check_input`

hydroflow/tests/compile-fail/surface_join_badtypes.stderr

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,31 @@ note: required by a bound in `check_inputs`
1414
|
1515
5 | j = join() -> for_each(std::mem::drop);
1616
| ^^^^^^ required by this bound in `check_inputs`
17+
18+
error[E0271]: expected `impl Iterator<Item = {integer}>` to be an iterator that yields `({integer}, _)`, but it yields `{integer}`
19+
--> tests/compile-fail/surface_join_badtypes.rs:5:13
20+
|
21+
5 | j = join() -> for_each(std::mem::drop);
22+
| ^^^^^^ expected `({integer}, _)`, found integer
23+
|
24+
= note: expected tuple `({integer}, _)`
25+
found type `{integer}`
26+
note: required by a bound in `check_inputs`
27+
--> tests/compile-fail/surface_join_badtypes.rs:5:13
28+
|
29+
5 | j = join() -> for_each(std::mem::drop);
30+
| ^^^^^^ required by this bound in `check_inputs`
31+
32+
error[E0271]: expected `impl Iterator<Item = {integer}>` to be an iterator that yields `({integer}, _)`, but it yields `{integer}`
33+
--> tests/compile-fail/surface_join_badtypes.rs:5:13
34+
|
35+
5 | j = join() -> for_each(std::mem::drop);
36+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `({integer}, _)`, found integer
37+
|
38+
= note: expected tuple `({integer}, _)`
39+
found type `{integer}`
40+
note: required by a bound in `check_inputs`
41+
--> tests/compile-fail/surface_join_badtypes.rs:5:13
42+
|
43+
5 | j = join() -> for_each(std::mem::drop);
44+
| ^^^^^^ required by this bound in `check_inputs`

hydroflow/tests/compile-fail/surface_merge_badtypes.stderr

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,27 @@ note: required by a bound in `check_inputs`
1212
|
1313
5 | m = union() -> for_each(std::mem::drop);
1414
| ^^^^^^^ required by this bound in `check_inputs`
15+
16+
error[E0271]: expected `impl Iterator<Item = char>` to be an iterator that yields `{integer}`, but it yields `char`
17+
--> tests/compile-fail/surface_merge_badtypes.rs:5:13
18+
|
19+
5 | m = union() -> for_each(std::mem::drop);
20+
| ^^^^^^^ expected integer, found `char`
21+
|
22+
note: required by a bound in `check_inputs`
23+
--> tests/compile-fail/surface_merge_badtypes.rs:5:13
24+
|
25+
5 | m = union() -> for_each(std::mem::drop);
26+
| ^^^^^^^ required by this bound in `check_inputs`
27+
28+
error[E0271]: expected `impl Iterator<Item = char>` to be an iterator that yields `{integer}`, but it yields `char`
29+
--> tests/compile-fail/surface_merge_badtypes.rs:5:13
30+
|
31+
5 | m = union() -> for_each(std::mem::drop);
32+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected integer, found `char`
33+
|
34+
note: required by a bound in `check_inputs`
35+
--> tests/compile-fail/surface_merge_badtypes.rs:5:13
36+
|
37+
5 | m = union() -> for_each(std::mem::drop);
38+
| ^^^^^^^ required by this bound in `check_inputs`

hydroflow/tests/compile-fail/surface_source_iter_badtype.stderr

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,31 @@ note: required by a bound in `check_iter`
1515
|
1616
5 | source_iter(5) -> for_each(std::mem::drop);
1717
| ^^^^^^^^^^^^^^ required by this bound in `check_iter`
18+
19+
error[E0277]: `{integer}` is not an iterator
20+
--> tests/compile-fail/surface_source_iter_badtype.rs:5:9
21+
|
22+
5 | source_iter(5) -> for_each(std::mem::drop);
23+
| ^^^^^^^^^^^^^^ `{integer}` is not an iterator
24+
|
25+
= help: the trait `Iterator` is not implemented for `{integer}`, which is required by `{integer}: IntoIterator`
26+
= note: required for `{integer}` to implement `IntoIterator`
27+
note: required by a bound in `check_iter`
28+
--> tests/compile-fail/surface_source_iter_badtype.rs:5:9
29+
|
30+
5 | source_iter(5) -> for_each(std::mem::drop);
31+
| ^^^^^^^^^^^^^^ required by this bound in `check_iter`
32+
33+
error[E0277]: `{integer}` is not an iterator
34+
--> tests/compile-fail/surface_source_iter_badtype.rs:5:9
35+
|
36+
5 | source_iter(5) -> for_each(std::mem::drop);
37+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `{integer}` is not an iterator
38+
|
39+
= help: the trait `Iterator` is not implemented for `{integer}`, which is required by `{integer}: IntoIterator`
40+
= note: required for `{integer}` to implement `IntoIterator`
41+
note: required by a bound in `check_iter`
42+
--> tests/compile-fail/surface_source_iter_badtype.rs:5:9
43+
|
44+
5 | source_iter(5) -> for_each(std::mem::drop);
45+
| ^^^^^^^^^^^^^^ required by this bound in `check_iter`

hydroflow_lang/src/graph/ops/source_iter.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,15 @@ pub const SOURCE_ITER: OperatorConstraints = OperatorConstraints {
4242
..
4343
},
4444
_| {
45+
let iter = &arguments[0];
4546
let iter_ident = wc.make_ident("iter");
4647
let write_prologue = quote_spanned! {op_span=>
4748
let mut #iter_ident = {
4849
#[inline(always)]
4950
fn check_iter<IntoIter: ::std::iter::IntoIterator<Item = Item>, Item>(into_iter: IntoIter) -> impl ::std::iter::Iterator<Item = Item> {
5051
::std::iter::IntoIterator::into_iter(into_iter)
5152
}
52-
check_iter(#arguments)
53+
check_iter(#iter)
5354
};
5455
};
5556
let write_iterator = quote_spanned! {op_span=>

0 commit comments

Comments
 (0)